Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>CocoaPods 1.0 has changed the syntax for this. It now looks like this: </p> <pre><code>def shared_pods pod 'SSKeychain', '~&gt; 0.1.4' pod 'INAppStoreWindow', :head pod 'AFNetworking', '1.1.0' pod 'Reachability', '~&gt; 3.1.0' pod 'KSADNTwitterFormatter', '~&gt; 0.1.0' pod 'MASShortcut', '~&gt; 1.1' pod 'MagicalRecord', '2.1' pod 'MASPreferences', '~&gt; 1.0' end target 'Sail' do shared_pods end target 'Sail-iOS' do shared_pods end </code></pre> <hr> <p><strong>OUTDATED</strong> Pre CocoaPods 1.0 answer:</p> <p>Yes there is a better way! Check out <a href="http://docs.cocoapods.org/podfile.html#link_with" rel="noreferrer"><code>link_with</code></a> where you can do <code>link_with 'MyApp', 'MyOtherApp'</code> to specify multiple targets.</p> <p>I use this with unit tests like <code>link_with 'App', 'App-Tests'</code> (beware of spaces in target's names).</p> <p>Example:</p> <pre><code>platform :osx, '10.8' link_with 'Sail', 'Sail-Tests' pod 'SSKeychain', '~&gt; 0.1.4' pod 'INAppStoreWindow', :head pod 'AFNetworking', '1.1.0' pod 'Reachability', '~&gt; 3.1.0' pod 'KSADNTwitterFormatter', '~&gt; 0.1.0' pod 'MASShortcut', '~&gt; 1.1' pod 'MagicalRecord', '2.1' pod 'MASPreferences', '~&gt; 1.0' </code></pre> <hr> <h3>2017 update</h3> <p>You can use <a href="https://guides.cocoapods.org/syntax/podfile.html#abstract_target" rel="noreferrer">abstract_target</a></p> <pre><code># Note: There are no targets called "Shows" in any of this workspace's Xcode projects abstract_target 'Shows' do pod 'ShowsKit' # The target ShowsiOS has its own copy of ShowsKit (inherited) + ShowWebAuth (added here) target 'ShowsiOS' do pod 'ShowWebAuth' end # The target ShowsTV has its own copy of ShowsKit (inherited) + ShowTVAuth (added here) target 'ShowsTV' do pod 'ShowTVAuth' end # Our tests target has its own copy of # our testing frameworks, and has access # to ShowsKit as well because it is # a child of the abstract target 'Shows' target 'ShowsTests' do inherit! :search_paths pod 'Specta' pod 'Expecta' end end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload