简体   繁体   中英

Import Framework only for one device type

In my universal iOS app written in Objective-C , I use the Facebook SDK, which unfortunately takes a lot of space and import it using the following statement at the top of my file:

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

As I only require this for the iPhone part of the app, I'm wondering whether it would be maybe possible to import the Framework only if the app is installed on an iPhone to save my iPad users some storage. Is there any way to realise that?

This can't be done because the inclusion and use of the Facebook SDK is done at compile/link time. But for a universal app, the detection of the device is done at runtime. At that point there is just the one binary that already has the SDK built into it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM