Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using <a href="https://github.com/jverkoey/iOS-Framework" rel="nofollow">https://github.com/jverkoey/iOS-Framework</a> to achieve something quite similar to your needs. Give him all the credit, I'm just summarizing how I do it.</p> <p>Create a static library as usual plus these tweaks:</p> <ul> <li>Add a copy files phase to copy the headers. I don't use a proper "Copy headers" phase because I read somewhere it's not recommended for iOS static libraries. <ul> <li>Destination: Products Directory</li> <li>Subpath: <code>${PROJECT_NAME}/Headers</code></li> </ul></li> <li>Change a few settings: <ul> <li>"Dead Code Stripping" => No (for all settings)</li> <li>"Strip Debug Symbols During Copy" => No (for all settings)</li> <li>"Strip Style" => Non-Global Symbols (for all settings)</li> </ul></li> <li>Add a run script to prepare a framework with the library: <ul> <li>Use the script <code>prepare_framework.sh</code>.</li> </ul></li> </ul> <p>You can use the static library project in your app: drag it to your app project, add the <code>.a</code> library as dependency and link with it. You can debug the library along with your app, step into methods, navigate to symbol definitions, etc.</p> <p>The prepared framework will be used to distribute a binary version:</p> <p>In the same static library project add an Aggregate target:</p> <ul> <li>Add the static library as dependency. </li> <li>Add a run script phase to build the missing architectures. Use the script <code>build_framework.sh</code>.</li> </ul> <p>The script guess what's the <strong>other</strong> platform and use <code>xcodebuild</code> to compile it. Then use <code>lipo</code> to create a fat binary with all the architectures. The destination of the fat static library will be the framework tree we created before. The final framework is copied to the products folder in the build folder.</p> <p>With this approach you can:</p> <ul> <li><strong>Build and debug</strong> your app with the static library as nested project.</li> <li><strong>Build a distributable</strong> version of the library in <strong>one step</strong> with the headers embedded in a framework-like bundle. The built framework is located in the project Products directory.</li> <li>Use Xcode Archive function. For some reason final files are not copied to the archive location. You can use it to build a stripped version of the framework.</li> </ul> <p>Feel free to clone a project using this technique to package the library: <a href="https://github.com/madmw/json-framework" rel="nofollow">json-framework fork</a>. I have modified slightly the scripts, check my fork of <a href="https://github.com/madmw/iOS-Framework" rel="nofollow">iOS-framework</a>.</p> <p><strike>Regarding <code>armv6</code>, I guess you need and old iOS SDK 4.3 and add manually the literal <code>armv6</code> to the list of valid architectures and actual architectures. I don't have and old SDK to test it right now.</strike></p>
    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. 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