I am developing a Swift iOS app with watch and widget extension.
So far I had a Shared
folder where files were checked for all targets that needed them. This works, but I noticed that these files then get compiled for each target.
I would prefer to have the shared core of the app to be built once, and then used as dependency for each of the targets, saving up the compilation time.
What is the good practice for sharing code and assets between app targets?
So far I looked into static library
and framework
. I ruled out the static library, as I would also like to share assets in addition to code, so that means that I should just create a new framework, and move files in there?
I tried this way, added a framework as dependency to all targets, but it doesn't seem that the framework gets rebuild when a code inside it changes, am I doing it right? Thanks!