ios - Meaning of each Cocoapods build target -


what purpose of each target in cocoapods workspace?

when created new cocoapods library via "pod lib create foo", expected 2 targets: 1 build library, , 1 build example.

but resulting xcworkspace has total of 4 targets:

  • project foo
    1. target foo_tests
  • project pods
    1. target pods-foo_tests
    2. target pods-foo_tests-foo
    3. target pods-foo_tests-foo-foo

what's meaning of these targets?

(i chose no demo application, view-based testing, or testing frameworks.)

there 2 project in workspace 1 yours , other cocoapods, , cocoapods adds new target each pod add in podfile. example, let's podfile :

platform :ios, '7.0'  pod 'afnetworking', '~> 2.5.4' pod 'bpxluuidhandler' 

you should see in pod project's target list :

enter image description here

but mean?

targets cocoapods manage each pod. example if choose afnwtworking target in pod project, must see :

enter image description here

but example how cocoapods know add "link binary libraries" frameworks above? well, please check afnetworking's podspec file :

 s.public_header_files = 'afnetworking/*.h'   s.source_files = 'afnetworking/afnetworking.h'    s.subspec 'serialization' |ss|     ss.source_files = 'afnetworking/afurl{request,response}serialization.{h,m}'     ss.ios.frameworks = 'mobilecoreservices', 'coregraphics'     ss.osx.frameworks = 'coreservices'   end    s.subspec 'security' |ss|     ss.source_files = 'afnetworking/afsecuritypolicy.{h,m}'     ss.frameworks = 'security'   end    s.subspec 'reachability' |ss|     ss.source_files = 'afnetworking/afnetworkreachabilitymanager.{h,m}'     ss.frameworks = 'systemconfiguration'   end 

as can see above lines "ss.ios.frameworks" describe going on there.

hope clear now.


Comments

Popular posts from this blog

What Are The Best Universities In The World?

Hard vs. Soft Water: What's The Difference?

Why People Get Naked Before Freezing To Death