-
[SwiftUI] iPad, iPhone 대응하기Swift/SwiftUI 2023. 7. 9. 20:43
extension UIDevice { static var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom } } struct ContentView: View { var body: some View { Group { if UIDevice.idiom == .phone { iPhone() } else if UIDevice.idiom == .pad { iPad() } } } }
'Swift > SwiftUI' 카테고리의 다른 글
[SwiftUI] NavigationStack (0) 2023.11.26 [SwiftUI] Pro Max landscape NavigationView bug (0) 2023.07.13 StoreKit2 References (0) 2023.07.09 [SwiftUI] GeometryReader 란? (0) 2023.06.03 [SwiftUI] Data 로 Lottie 보여주기 (0) 2023.05.18