Search code examples
frameworksmapkittvosapple-tv

Should I import a weak framework?


I have a framework that needs the Apple MapKit framework. I want to be sure that this framework is usable even on machine where MapKit is not available (aka AppleTV). Is it safe to use

#import <MapKit/MapKit.h>

or should I use only reflection?


Solution

  • At this point, there is no MapKit on tvOS, thus not even the headers are present. I have split my (huge) support framework into a bunch of nicely separated individual frameworks. Everything that depends on MapKit is in a dedicated framework, which does not get included nor linked for my tvOS build. In my opinion, this works best.