0

I know use_framework! is used for swift libraries but what to do if want to use Obj-C and Swift libraries in one project

Is there any method to use

use_framework! for seperate pods

Usama Sadiq
  • 587
  • 1
  • 4
  • 21

1 Answers1

0

With cocoa pods 1.1.1 you can now have use_frameworks! inside one or more targets in your Podfile. This allows you to use frameworks for some targets and not for others!

EricWasTaken
  • 1,654
  • 14
  • 19
  • Yes @ericWasTaken you are right but i am using only one Target where some pods are Swift and some are Objective C. Among Objective C pods some are compiled and some are not. For example you can try on your Xcode for Alamofire and RestComm Mobile - iOS SDK in one project – Usama Sadiq Nov 25 '16 at 11:45
  • @UsamaSadiq, I see what you mean. There are multiple bugs that speak to this, including https://github.com/CocoaPods/CocoaPods/issues/4605. – EricWasTaken Nov 27 '16 at 06:14
  • @UsamaSadiq, BTW, I don't know if this is a feasible alternative for you. But, AlamoFire actually is the "swift" rewrite of AFNetworking. Since mixing Swift and Objc-C is proving difficult, perhaps try AFNetworking. I just tested `pod 'AFNetworking', '~> 3.0'` instead of AlamoFire and commented out use_frameworks! - and that builds correctly as we'd expect. I realize this might not be the best alternative for you, though. – EricWasTaken Nov 27 '16 at 06:18