// // ContentView.swift // JustOneThing // // Created by Alan Francis on 02/06/2023. // import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) #if os(iOS) Text("Hello \(UIDevice.isIPad ? "iPadOS" : "iOS")") #elseif os(macOS) Text("Hello macOS") #elseif os(tvOS) Text("Hello tvOS") #elseif os(watchOS) Text("Hello watchOS") #endif } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } #if os(iOS) extension UIDevice { static var isIPad: Bool { UIDevice.current.userInterfaceIdiom == .pad } static var isIPhone: Bool { UIDevice.current.userInterfaceIdiom == .phone } } #endif