So I'm trying to compile my iOS project for the mac, and when I try to use
#if !targetEnvironment(UIKitForMac)
I'm getting the error from the title.
I tried setting the build target to iOS 13, but didn't seem to have any effect.
Objective-C
#if !TARGET_OS_MACCATALYST
// Code to exclude from Mac.
#endif
Swift
#if !targetEnvironment(macCatalyst)
// Code to exclude from Mac.
#endif
Sources:
https://developer.apple.com/documentation/uikit/creating_a_mac_version_of_your_ipad_app?language=objc
https://developer.apple.com/documentation/xcode/creating_a_mac_version_of_your_ipad_app
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With