diff --git a/AppShared/ContentView.swift b/AppShared/ContentView.swift index 5a832c2..82ad708 100644 --- a/AppShared/ContentView.swift +++ b/AppShared/ContentView.swift @@ -13,7 +13,16 @@ struct ContentView: View { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) - Text("Hello, world!") + + #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() } @@ -24,3 +33,15 @@ struct ContentView_Previews: PreviewProvider { ContentView() } } + +#if os(iOS) +extension UIDevice { + static var isIPad: Bool { + UIDevice.current.userInterfaceIdiom == .pad + } + + static var isIPhone: Bool { + UIDevice.current.userInterfaceIdiom == .phone + } +} +#endif