I have been a web developer for about 10 years. My goal when I started was to be an apple developer. I am finally diving into that world. I’ve been learning SwiftUI with the understanding that I can use the same code to built for iOD and MacOS. I found a snippet that lets me check this at compile, but is that the right way to do this. Is there documentation on what the right way to do this is? As I would intend to have completely different views for the Mac and iOS
New to SwiftUI
Recommended
Hi @jacobSimpson ,
So glad you're getting into SwiftUI!
You can use availability checks as shown here: Running code on a specific platform or OS version.
Example:
#if os(iOS)
// iOS code
#endif
Best, Sydney