Post

Replies

Boosts

Views

Activity

Comment on Compile for different macOS versions
Thank you for your speedy reply, but I must still be missing something. I created a simple macOS app and modified the ContenView struct. ''' struct ContentView: View {          var text: String {         if #available(macOS 12, *) {             return "Hello, world! OSX12"         } else {             return "Hello, world! OSX11"         }     }          var body: some View {         Text(text)             .padding()     } } ''' But no matter how I set the macOS Deployment Target in the project or deployment target in the target, it always displays Hello, world OSX 12 when I run it. Thanks
Nov ’21
Comment on Xcode Simulator Rotate
Thanks for the reply. I understand that the simulator has no sensor to determine orientation, if I rotate the simulator ⌘ + left or right arrow key on the keyboard, the simulator rotates on the Mac screen, going from portrait to landscape. If I exit the simulator while it is in landscape mode, when I restart the simulator, it comes up on the screen with the screen in landscape mode (home button on the right or left), but the contents are displayed in portrait mode (i.e. sideways). If I use the keyboard to rotate the simulator back to portrait mode, it displays properly in portrait mode. If I then rotate to landscape mode, it displays properly in landscape mode, but if I exit the simulator and restart it again displays the device in landscape mode but the screen in portrait mode (sideways).
Nov ’21
Comment on XCODE SwiftUI Preview
Thanks for the reply. I see your answer addressed my question, but in this case,I think there was something else wrong with the design of the application, but I don't know what, I'm still learning about observable objects and environment objects. When I restructured the app to clean up those, the problem went away.
Oct ’21
Comment on XCODE SwiftUI Preview
I'm sure my app is crashing. My question is not why the app is crashing - I know it is crashing because it can't communicate with the external device (I will eventually need to fix that). Is there a way to get the PreviewProvider to use a UI context other than the main app? Or, am I missing the point of Previewing? I realize I don't have a "live" preview, but I don't need one. I just want to see (and adjust) how the various parts of the views look as I adjust the layout and options.
Oct ’21