Does iPadOS really exist? If so, why is there no Xcode compiler directive for it?

For some time now Apple has been referring to iPadOS (eg in https://developer.apple.com/download/ ), but there is no compiler directive in Xcode to check for iPadOS - even though Xcode now has supported destinations for iPhone, iPad and Mac (catalyst).

I have a couple of use cases where I'd really prefer to include/exclude large chunks of code (frameworks) based on whether the device is an iPad or an iPhone, not just because of the different user-interface characteristics - which can be accommodated using the UIUserInterfaceIdiom.

Regards,

Michaela

Replies

You said the quiet part out loud. Indeed “iPadOS” is mostly a marketing gimmick. On the technical side nothing really changed and there’s still a single iOS SDK. If you have separate build targets for iPad and iPhone (“and iPod touch!” says a lonely voice from the back row) then of course you can define your own compile-time condition for that in each target. But for App Store distribution it still needs to be a single build for all iOS devices, so building different binaries for different idioms wouldn’t be useful.

  • Thanks for your reply Scott: you confirmed my perception. Most of my apps now are multi-platform (Mac, iPad, iPhone, Watch and sometimes TV) with CoreData/CloudKit storage and sync, so I use a common framework, fencing off functions that are not appropriate for a particular device. Only a couple of these apps might make it onto the AppStore, the rest for personal use, but I do need to think through the design implications before I get too far down the track. Regards, Michaela

Add a Comment