Is it possible to distribute a single library that works on both iOS and AppleTV? I know the APIs aren't quite the same, but I'm wondering if I do enough weak-linking and if-defing in the headers if I can get the same .a/framework working across iOS and AppleTV. I'm still looking at this, but having trouble getting Xcode launching, so I thought I'd put the question out there on the forums.
We're a library vendor and I'm just wondering if I'd have to do an AppleTV specific library, or if I could just have developers use the same single distribution.
Just a few clarifications here.. The answer is yes and no - depending on exactly which question you are asking.
Any static library or framework that you link against in your tvOS application *must* also be built against the tvOS SDK. You cannot submit a tvOS application that links against a framework that was built for iOS. During the beta period, Xcode will simply warn when it sees you trying to do this. That way, you can get started on development now, while you wait for your dependent libraries to be updated for tvOS.
However, it is possible to create a framework/library target that successfully builds for both OSs. I believe Xcode will require you to create a separate target for each platform - but if you're careful to call only API that are available on both, you should be fine.
Make sense?