swift - Adding Framework and App Extension targets to IOS App project, am I doing it correctly? -
i'm studying ios/swift development , i'd build ios app in future have own today extension. i've read better put common logic (for example logic accesses internet resources, performs job on result etc) between app , extension custom framework.. since think i'll need change both framework , app code during development of app, i'd avoid building framework in separate project, use show in finder function locate framework bundle , drag-and-dropping within app project.. i'd know if correct way set workspace app, framework uses , today extension of app:
- create new project ios app target
- select project in project navigator , editor->add target... , specify cocoa touch framework
- editor->add target... , specify today extension
- add framework in linked frameworks , libraries
in way i've seen changes framework sources not need framework target recompilation, maybe because project knows need recompile framework sources if build & run ios app target uses framework? doing right? i've seen today extension created in such way not lists framework in build phases -> target dependencies while ios app does, both of them correctly use updated code of framework when update it.
then, i've noticed following warning when compile project, don't know if related way i've setup project:
ld: warning: linking against dylib not safe use in application extensions: /users/gianni/library/developer/xcode/deriveddata/testframeworkapp-dshihhfiuepeqzddbnpgnfwilhem/build/products/debug-iphonesimulator/testframework.framework/testframework
btw normal entries within products folder red? due fact build ios simulator since don't have paid developer account allows me build ios device? prevent me build framework can exported other project since can't find framework bundle right clicking on framework product , selecting show in finder (and can't drag-and-drop project)?
i hope i've been clear enough , you'll point me in right direction understand suggested way of starting new project :)
it sounds me you're headed down exact path take.
regarding warning you're seeing... believe checking "allow app extension api only" shared framework supress , cause build failures when attempt use api not allowed in extensions.
Comments
Post a Comment