Using Cocoapods in an app extension using a framework

后端 未结 3 1361
滥情空心
滥情空心 2020-12-09 03:14

I have an app (let\'s call it MyApp) written in Swift with the following targets :

  • MyApp : the main target
  • MyAppKit : a targ
3条回答
  •  一整个雨季
    2020-12-09 04:12

    So, what gives :

    • My concern of "separating pods between targets" is absurd because you can still import them anywhere.
    • The "you have to manually link" issue is fixed by an easy import RealmSwift statement.

    The fixed and working Podfile therefore is :

    platform :ios, '8.0'
    use_frameworks!
    
    target 'MyApp' do
        pod 'Eureka', '~> 2.0.0-beta'
        pod 'PKHUD', '~> 4.0'
        pod '1PasswordExtension', '~> 1.8'
    end
    
    target 'MyAppKit' do
        pod 'Fuzi', '~> 1.0'
        pod 'RealmSwift', '~> 2.0'
        pod 'Alamofire', '~> 4.0'
        pod 'KeychainAccess', '~> 3.0'
        pod 'Result', '~> 3.0'
    
        target 'MyAppWidget' do
            inherit! :search_paths
        end
    end
    

    And that's it. I would say that the old behaviour was more obvious and didn't require reading up on "podfile target inheritance". I did learn a lot though. Cheers!

提交回复
热议问题