How to use LicensePlist is displayed in iOS settings

Tram Ho

1. Introduction

If you install and use libraries through CocoaPods or Cathage, you may notice that most libraries have MIT license.

You can basically use that library for free, as long as you mention it somewhere in your application. There are many ways you can add a license to your application, in this article I will show you how to use Mono96’s LicensePlist to create a list of pods that you have used in your application.

2. Add Pods to Project.

Create a new application to add pods

Next, create the pod for the project by running the command ‘ pod init with Terminal in the project directory.

Add the libraries to PodFile as shown below:

Now proceed to install the Pods by running the pod install command.

3. Execute LicensePlist

Once you have installed Homebrew, use Homebrew to install the LicensePlist

$ brew install mono0926/license-plist/license-plist

The above command will install the library for us. It will take some time and when completed will be as follows:

Navigate the Terminal to the directory where you have the project and run the following command to create the licenses:

license-plist

It will create files for us. A new window will appear with the newly created files:

4. Setting Bundle.

The next thing to do is to create the settingbundle file in your project.

Now, you can drag the files just created above into your project as shown:

Build and run the app to see what happens. After the app has run, go to the settings of the machine and scroll down to the app display.

Open it and look ..

You will not see the pods installed because you are using the default settingbundle. So go and Root.plist to customize again.

This file will tell us what will be displayed. Please delete all entries in that Group. Create a new group to use the Pods. This group needs 2 entries, Type and title with “Child Pane”.

Next you add 1 line called Filename

Now you want to associate Filename with the License, on top of that is an example name to display. The title will be what is displayed in the settings menu.

Install and run the application to see results:

Click acknowledgements to display the list of Pods

Click to see details

Good luck. ?

Reference: https://alexduffell.wordpress.com/2017/11/09/how-to-use-licenseplist-to-organise-your-settings-bundle-in-ios/

Share the news now

Source : Viblo