Skip to content

Using LIFXKit in iOS App extensions #20

@DCMaxxx

Description

@DCMaxxx

Issue :
The latest version of LIFXKit (0.6.1) won't compile in an iOS App extension, using Xcode 6.2 and iOS 8.2 SDK.

Cause :
Usage of +[UIApplication sharedApplication] in :

  • LFXWiFiObserverIOS.m, line 30
  • LFXLocalTransportManager.m, line 86

sharedApplication is declared as NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead."); in UIApplication.h line 215.

Possible solution :
Make the user define a preprocessor macro (such as #LIFXKIT_APP_EXTENSIONS) to disable codes that calls unavailable APIs when compiling an app extension. That's what AFNetworking does (see issue #2119.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions