Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- iOS 13.0+
- composablearchitecture
- iOS 개발자
- Alamofire
- swiftdata
- 개발
- github
- Navigation
- Firebase
- test
- concurrency
- regex
- combine
- Tuist
- 모바일
- ios18
- uikit
- xcode
- navigationsplitview
- TCA
- 정규표현식
- SWIFTUI
- UI
- tuist #xcodecloud #ios #ci/cd #swiftlint #firebase
- network
- xcodecloud
- IOS
- Git
- SWIFT
- ObjC
Archives
- Today
- Total
iOS 개발 기록
[iOS] Device Model 체크 본문
728x90
DeviceModel 체크
코드
func deviceModelName() -> String {
// 실제 디바이스 체크
let device = UIDevice.current
let selName = "_\("deviceInfo")ForKey:"
let selector = NSSelectorFromString(selName)
if device.responds(to: selector) {
let modelName = String(describing: device.perform(selector, with: "marketing-name").takeRetainedValue())
return modelName
}
// 시뮬레이터 체크
if let modelName = ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"],
modelName.count > 0 {
return modelName
}
return "unknowned device"
}
Machine Code
'iOS' 카테고리의 다른 글
[Tuist] Xcode Cloud 적용하기 (SwiftLint, FirebaseCrashlytics) (7) | 2024.05.23 |
---|---|
[Tuist] 4.x로 업데이트하며 느낀 경험 (feat. TCA) (4) | 2024.03.15 |
[iOS] 로컬 푸쉬 - Local Notification (0) | 2022.09.07 |
iOS - 앱의 라이프 사이클 (0) | 2022.07.21 |