title: Use Cocoapods for private iOS Framework
body: <p>I'm working on an iOS framework and I would like to make it available to other developers to integrate within their "client" apps by including them in their Podfile, such as:</p>
  
  <pre><code>pod 'MyFramework'
  </code></pre>
  
  <p>But I can't share the actual source code for it due to some licensing restrictions. The examples I found online for developing iOS frameworks and setting up their podspec files are typically pointing to a repository on github or others and that seems to make the source code available in the developers' app after they run:</p>
  
  <pre><code>pod install
  </code></pre>
  
  <p>Do I have to share the source code from my framework with the developer? What is the best way (on both the framework setup in cocoapods and the client app in its Podfile) to make sure I can share MyFramework.framework but not its source code?
  Note that I'm using Swift 3 for this project.</p>
  
  <p>Thank you</p>
  
  <p>al</p>
  
  <p><a href="https://i.stack.imgur.com/52fbX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/52fbX.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Podfile (client):</p>
  
  <pre><code>target 'TestSDK' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
  pod 'MySDK', :path =&gt; '/path/to/SDK/'
    # Pods for TestSDK
  end
  </code></pre>
  
  <p>MySDK.podspec:</p>
  
  <pre><code>Pod::Spec.new do |s|  
      s.name              = 'MySDK'
      s.version           = '1.0.0'
      s.summary           = 'A really cool SDK that logs stuff.'
      s.homepage          = 'http://example.com/'
  
      s.author            = { 'Name' =&gt; 'sdk@example.com' }
      s.license           = { :type =&gt; 'Apache-2.0', :file =&gt; 'LICENSE' }
  
      s.platform          = :ios
  s.source = { :http =&gt; 'https://bitbucket.org/username/reponame/src/master/MySDK.zip' }
      s.ios.deployment_target = '9.3'
      s.ios.vendored_frameworks = 'MySDK.framework'
  end  
  </code></pre>