Skip to content

Instantly share code, notes, and snippets.

@Dimon70007
Last active November 18, 2019 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dimon70007/aa97b596b480ddca7ef3e6729bb5e1a6 to your computer and use it in GitHub Desktop.
Save Dimon70007/aa97b596b480ddca7ef3e6729bb5e1a6 to your computer and use it in GitHub Desktop.
resolving static and dynamic frameworks or libraries with cocoapods
# Add this code at the top of Podfile
use_frameworks!
dynamic_frameworks = ['Alamofire', 'Async', 'Moya', 'Result', 'RxCocoa', 'RxSwift', 'SwiftyXMLParser', 'TrueTime']
# make all the other frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
puts "Overriding the static_framework? method for #{pod.name}"
def pod.build_type;
Pod::Target::BuildType.static_library
# for static framework - Pod::Target::BuildType.static_framework
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment