ios8 - How to build iOS framework with XCode 6 -


i know of familiar tutorials on this, introduction of framework xcode 6 template has changed game.

i watched wwdc 2014 video building modern frameworks talks more building extensions, framework & app inside single project. not specify if framework make reusable across project.

i building framework xcode 6 way (file->new project->framework , library->cocoa touch framework), when import inside test app project (separate framework project) - keep getting various errors.

example: include of non-modular header inside framework, , on.

i know not says, , there quite missing steps in whatever doing. older tricks may have worked everyone, don't find way follow after xcode 6.

for example, there some folder structure framework needs, xcode 6 doesn't comply while building it. right? if not, how can change way xcode builds framework folder hierarchy?

do go old school or screwing tiny thing in xcode 6 unable create reusable framework?

i not sure if trying build framework objective-c or swift question doesn't state it. i've encountered errors mentioning swift i'll give method build swift frameworks.

i found process objective-c straightforward , documented, i'll skip this.

as swift, there few things consider. first, swift static libraries not supported, must exclusively use framework (aka dynamic library) when linking app library.

here steps:

  1. create framework using new > project under ios > framework & library, select cocoa touch framework

  2. to avoid "ld: warning: directory not found option..." goto library search paths in build settings target , delete paths.

  3. you can't mix objective-c swift don't consider adding swift-header bridge file in code.

  4. there cases in swift need import code unexposed frameworks. i've used module-map inside framework deal these case.

  5. i select clang_allow_non_modular_includes_in_framework_modules = yes in build settings solve 'include of non-modular header inside framework module'. seems work

  6. i make sure header file gets generated marked public (not project). click on file , you'll see selection in inspector under 'target membership'

you may run bizarre error messages when building. xcode has tendency report linker errors when code can't compile correctly resulting in missing files linker needs output binaries. xcode won't show errors in files compiling , need go manually on build output , go files. other time, you'll problem need delete cache. issues call xcode blues , deal constantly. found type of problems happens more when building libraries. rest should work expected.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -