access parent project OTHER_SWIFT_FLAGS from pod
Building a custom pod for a private framework, in my main project i use custom OTHER_SWIFT_FLAGS.
In theory it should be possible to override the settings of the pod during the install based on the main project but there is no documentation on how to do so.
So far my attempts failed, any hint?
Looks like project(https://guides.cocoapods.org/syntax/podfile.html#project) should be the way to go but again, no documentation.
- Cocoapods ld: library not found for -lPods-Projectname
- PBXCp error no such file or directory
- Pods.framework in red, doesn't exist in DerivedData
- Swift error: failed to get module 'My_App' from AST context
- Linker errors in a Swift project with Google Maps for iOS added via CocoaPods
- PayPal-iOS-SDK using cocoapods throws error in bridging header
Solutions Collect From Internet About “access parent project OTHER_SWIFT_FLAGS from pod”
So basically it looks like this.
Accessing the xcode project, then accessing the pod and looping through each config to set the proper value.
post_install do |installer| require 'xcodeproj' project_path = 'pathTo/myProj.xcodeproj' # path to your xcode project project = Xcodeproj::Project.open(project_path) project.targets.each do |target| if target.name == 'myTarget' # name of the target in your main project containing the custom flag installer.pods_project.targets.each do |podTarget| if podTarget.name == 'myPod' #name of your pod target.build_configurations.each do |targetConfig| podTarget.build_configurations.each do |podConfig| podConfig.build_settings["OTHER_SWIFT_FLAGS"] = targetConfig.build_settings["OTHER_SWIFT_FLAGS"] end end end end end end
- Changing tab bar item image and text color iOS
- Instead of push segue how to replace view controller (or remove from navigation stack)?
- Xcode 6.3.2 can't run on OSX 10.11 El Capitan Developer Preview 3
- CNContactPickerViewcontroller navigationBar color
- Disabling NSLog For Production In Swift Project
- NSMutableArray Access Issue
- Xcode 7: linker command failed with exit code 1 (use -v to see invocation) again
- How to convert NSURL to String in Swift
- How to import module into xcode
- Facebook ShareDialog always returns .canceled on completion
- How can i change the NSArray to MKPolyline polylineWithCoordinates compatible type？
- Memory leak with “libBacktraceRecording.dylib” in React Native ios application
- How to put a badge on customized UIBarButtonItem
- SenTestingKit in Xcode 4: Asynchronous testing?
- Split UInt32 into in swift