Reputation: 2522
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.
Upvotes: 3
Views: 1453
Reputation: 1396
Objective-C
#if !TARGET_OS_MACCATALYST
// Code to exclude from Mac.
#endif
Swift
#if !targetEnvironment(macCatalyst)
// Code to exclude from Mac.
#endif
Sources:
Upvotes: 2
Reputation: 2808
If you're using objective-c and not swift you should use:
#if !TARGET_OS_UIKITFORMAC
#endif
Upvotes: 0