Last active
September 1, 2020 20:06
-
-
Save csknns/7a8faa6497770c6d93ecf610ae35903a to your computer and use it in GitHub Desktop.
Post integration Cocoapods hook workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://github.com/CocoaPods/Specs.git' | |
platform :ios, '9.0' | |
use_frameworks! | |
target 'TargetName' do | |
end | |
class Pod::Installer | |
# The only way to run my custom method after the pod integrates with the project (http://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html) | |
# Repace the method implementation integrate_user_project with ours | |
alias_method :integrate_user_project_old, :integrate_user_project | |
def integrate_user_project | |
# integrate with the user project | |
integrate_user_project_old | |
# run custom post_integrate_method | |
patch_pod_xcconfig_files | |
end | |
def post_integrate_method | |
# Add your post integrate code here | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hacky wacky but worky for me 👍
had to change
patch_pod_xcconfig_files
topost_integrate_method
though (and i think it makes more sense in the gist).Thanks