Are there any tutorials describing how to create a library or is it framework for the iPhone? I have a number of methods that are shared between applications. These will be better maintained as a library.
Select Framework in the Framework & Library section on the iOS tab, then click Next. Type DBHelper in the Product Name, unselect Include Unit Tests, make sure the language is Swift, then click Next. In the next window find the root folder of your project, select it, click New Folder, type Modules, click Create.
By using a library, you can control the flow of the application and call the library. In contrast, when you use a framework, the control is inverted, i.e., the framework controls the flow and calls your code.
UIKit provides a variety of features for building apps, including components you can use to construct the core infrastructure of your iOS, iPadOS, or tvOS apps.
Put your code in a static library (as Roger indicated via his link). However, consider using an Xcode cross-project reference to "import" that static library into all the other projects that need it. I've whipped up a tutorial explaining how to do this (and why I think it's better than creating a "fat" Universal Binary): http://www.clintharris.net/2009/iphone-app-shared-libraries/
There is a lot of information on the web that can help with this for example this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With