forked from PureLayout/PureLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
App Extensions
smileyborg edited this page Nov 17, 2014
·
13 revisions
When using PureLayout in an App Extension, you must define the preprocessor macro PURELAYOUT_APP_EXTENSIONS in the Build Settings of your App Extension's target to prevent usage of unavailable APIs.
If you do not do this, you will see an error such as:
'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
To fix this:
- In Xcode, select your Project
- Choose the Target for your App Extension
- Click Build Settings
- Find (or search) Preprocessor Macros under
Apple LLVM 6.0 - Preprocessing - For all build configurations (Debug & Release) add the macro
PURELAYOUT_APP_EXTENSIONS=1
Now, when your App Extension target is selected, PureLayout will not use unavailable APIs.