Xcode project templates Vol. 4: How to deal with third-party library licenses
Mobile
3
 min read
February 9, 2022

Xcode project templates Vol. 4: How to deal with third-party library licenses

Andrej Jasso
Andrej Jasso
iOS Developer
LinkedIn Logo

Does it still take you a lot of time to create a new project? I've prepared another section dedicated to Xcode project templates that will save you time and a few hairs 😅. Read the how-to guide and maybe you'll change the way you create your projects. Today I'll show you how to integrate a screen with all third-party libraries into your project using the LicensePlist library.

Before we jump into the last part of the Xcode project templates series, don't forget to read the previous articles. In those, you'll find step-by-step tutorials
on how to start and where to find templates, how to automate project configuration, or how to configure swiftlink and swiftgen.

LicensePlist is a tool that generates a plist of all third party books including SPM, Carthage and Cocoapod libraries.

At the end of this article, after creating the project and successfully running
it on the simulator, we should see a license button in the application settings where we will see all used third-party libraries without any setup. Once you have successfully created a template, all future integrations are alredy done.

But let's give you little context first. Why mention libraries in the application
at all? The reason is simple. If you've ever browsed the github of a library, you've probably noticed the LICENSE file.

Here are the terms of use of the library and even though the library is open source it is still quite possible that it requires a declaration of use in apps that are publicly available. Not every library requires it, but there is a good chance that you will sooner or later come across a library that will. It's actually a way not to cause legal problems.

Now let's go to integration. The first thing to do is add your LicensePlist
to the poddependencies in our sub template.

The template for the team also makes sense because we make it easier
to add more name search libraries, etc ...

As a next step, we will create a new sub-template where the only file will
be settings.bundle and for the target we will determine, similarly to the previous article, the target where there will be 2 build scripts. These must refer
to the Licene-plist script and the types will copy and paste to the settings.bundle file and then sequentially edit and delete the output.

You can create Settings.bundle simply via xcode and select the settings template.

You will create something like this where the content will be taken care
of by a script that will copy all the information it retrieves from the libraries
in the project. Copy the file created in this way and put it in the folder
of our sub-template.

We will then add this template to our main project template.

Now just generate a project and see how the settings bundle fills your library information.

And at the same time, when installing the application on the simulator you can see that the licenses are here.

That's all for today's tutorial. At the same time, it should be added that you will find all the materials on the appropriate branch of our template repository.

Do you want to be part of an innovative team? Join us in iOS 🍎
Potrebujete pomôct s vaším digitálnym produktom? Kontaktujte nás!
hello@goodrequest.com
Do you need help with your digital product? Contact us!
hello@goodrequest.com

Like what you see?
Join our newsletter.

Great! Welcome to newsletter.
Oops! Something went wrong while submitting your email.
High quality content once a month. No spam, we promise.
Your personal data is processed in accordance with our Memorandum on Personal Data Protection.

Páči sa vám náš content?
Odoberajte newsletter.

Great! Welcome to newsletter.
Oops! Something went wrong while submitting your email.
Vaše osobné údaje sú spracované v súlade s našim Memorandom na ochranu osobných údajov.