vicc / chameleon

Color framework for Swift & Objective-C (Gradient colors, hexcode support, colors from images & more).
Other
12.43k stars 1.31k forks source link

Add Chameleon to app extension #96

Open chika-kasymov opened 8 years ago

chika-kasymov commented 8 years ago

Hello! I have problem after adding Chameleon with Cocoapods to keyboard app extension. When I compile Xcode project, there are errors like 'sharedApplication' is unavailable: not available on iOS (App Extension). I installed PureLayout and solved this problem with code on repo's wiki:

post_install do |installer|
        # NOTE: If you are using a CocoaPods version prior to 0.38, replace `pods_project` with `project` on the below line
        installer.pods_project.targets.each do |target|
            if target.name.end_with? "PureLayout"
                target.build_configurations.each do |build_configuration|
                    if build_configuration.build_settings['APPLICATION_EXTENSION_API_ONLY'] == 'YES'
                        build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'PURELAYOUT_APP_EXTENSIONS=1']
                    end
                end
            end
        end
    end

Is it possible to solve problem with similar code snippet?

vicc commented 8 years ago

Let me take a look, and I'll get back to you on this. Thanks for bringing it up!

im-jersh commented 8 years ago

I would also like to know the feasibility of using Chameleon on app extensions. Currently trying to use it for an Apple Watch extension and getting a Module file was created for incompatible target i386-apple-ios8.0 error

vicc commented 8 years ago

Haven't had time to look at it, but will make it happen this weekend.

vicc commented 8 years ago

@oriyentel You can now use Chameleon in your app extensions. Check out the app-extension branch.

@bre7 Feel free to look it over to make sure I didn't make any dangerous changes to the .swift files. I did remove several shorthand methods. Once you've made sure, I can merge it into the master branch.

Urkman commented 8 years ago

I can't use this, as I'm using the swift-3 branch in my main app.

I get this from CocoaPods:

[!] There are multiple dependencies with different sources for ChameleonFramework in Podfile:

  • ChameleonFramework (from https://github.com/ViccAlexander/Chameleon, branch swift3)
  • ChameleonFramework (from https://github.com/ViccAlexander/Chameleon, branch app-extension)
sirnacnud commented 7 years ago

Any chance we can get this updated for swift 3? I'd like to test it out.

cerupcat commented 7 years ago

Any update to this? Any chance of getting this merged in?

itsjustcon commented 6 years ago

+1 I've been waiting for this to get merged for ~1y @ViccAlexander @bre7