You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
//
|
|
|
|
// 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
|