Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Added preprocessor check for iOS8 extensions #460

Merged
merged 1 commit into from
Jun 15, 2015

Conversation

fraserscottmorrison
Copy link

Ive done a fix for this bug #438

Got MKNetworkKit working in a Share Extension. A new preprocessor macro TARGET_IS_EXTENSION is needed to avoid calls to [UIApplication sharedApplication]

To set up with cocoa pods was a little tricky, on 'pod install' it'll create a separate pod target and add the preprocessor macro - podfile looks like this

link_with 'App', 'Extension'

pod 'MKNetworkKit'

target 'Extension' do
    post_install do |installer_representation|
        installer_representation.project.targets.each do |target|
            if target.name == 'Pods-Extension-MKNetworkKit'
                target.build_configurations.each do |config|
                    config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'TARGET_IS_EXTENSION=1']
                end
            end
        end
    end
end

MugunthKumar added a commit that referenced this pull request Jun 15, 2015
Added preprocessor check for iOS8 extensions
@MugunthKumar MugunthKumar merged commit d2247ed into MugunthKumar:master Jun 15, 2015
@MugunthKumar
Copy link
Owner

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants