NewSelf
NewSelf

Reputation: 247

Change one pod to framework

My project use static library to integrate with third-part pods. I want to change one pod to dynamic framework. But I don't want to add use_frameworks! because this will cause all pods become dynamic framework. So is there any way to change one pod to dynamic framework and keep others the static lib (.a file)?

Upvotes: 0

Views: 1249

Answers (1)

NewSelf
NewSelf

Reputation: 247

I found a solution, put the code at the end of your podfile

dynamic_frameworks = ['AFNetworking', 'OtherLibToBecomeFramework']
pre_install do |installer|
  installer.pod_targets.each do |pod|
    if dynamic_frameworks.include?(pod.name)
      puts "Overriding the build_type to dynamic_framework for #{pod.name}"
      def pod.build_type;
        Pod::BuildType.dynamic_framework
      end
    end
  end
end

Upvotes: 4

Related Questions