Martin Hicks

Freelance mobile (& web) developer from
sunny Manchester, based in London.

Journal

Adding licenses / acknowledgements to iOS Settings app

During a recent iOS development I needed to distribute a 3rd-party license agreement with my app.  Apps such as iBooks, Keynote, Facebook (and many many more) utilise the Settings app to not only display user-editable preferences, but also license agreements and acknowledgements.

Adding your app into Settings is a simple case of modifying your Settings.bundle (if your XCode project doesn’t include a Settings.bundle file, simply right-click your project -> New File -> select Resource (under iOS) -> then on the right, Select Settings.bundle template (when creating the file make sure you keep the default file name ‘Settings’).

Once you’ve created a Settings.bundle subsequent builds of your app will add an app specific menu (including app icon and title) to the Settings app. If you’ve created your Settings.bundle from the supplied template (as above) your initial app specific settings menu will contain some example elements (a title, toggle and slider).

Root.plist

To add our own information into our  Settings menu, we need to edit the Root.plist file contained inside Settings.bundle. Within XCode, expand the Settings.bundle item and you should see the following file structure:

A .bundle is a package, not a directory, in Finder you can view and work with the contents of your Settings.bundle by right-clicking Settings.bundle and selecting Show Package Contents.

Root.plist is the file we will edit to create our menu structure, while Root.strings contains any strings we wish to insert.

Initially our Root.plist will contain the default template items:

As you can see from the above screenshot, this template contains a Group of items (i.e. Grouped UITableView) containing a TextField, a Toggle Switch and a Slider. For the purpose of this guide, you can now remove each item.

Creating an Acknowledgements section

At this point we have a choice; do it all manually or set-up and use a convenience script. I prefer the latter, it means we can easily add to or remove particular licenses during the lifespan of our app.

The following solution is taken from an excellent answer on Stack Overflow – http://stackoverflow.com/a/6453507

Rather than repeat the contents of that post, I thought I would simply include a zip of my licenses folder and Settings.bundle. I had a couple of glitches to begin with, all of which we due to line-breaks mid-paragraph.

Download Acknowledgements example

Appcelerator

As it happens, this particular project was being developed using Appcelerator’s Titanium framework. Those of you who have used Titamium in the past will know that it includes it’s own build process, prior to triggering an XCode build. In order to make use of a Settings.bundle (using the latest version of Titanium SDK), you need to create the following folder structure Project Root -> modules -> iphone -> Settings.bundle. Like so:

Changes to your bundle will be picked up on each subsequent build in Titanium Studio.

 

Leave me a comment

your email address will not be published or shared with anyone (all fields are required).

2 Comments

  • Mikaeel Dada

    ello,

    My Name is Mik’aeel Dada,
    I would like you to create a multi-platform app social networking app.
    If its possible and you are in London can we meet up?
    But, prices can be done over the internet and in-person.

    If need be ring me; 07540408830 or email me at Mikaeel.d@gmail.com

    Yours Mikaeel Dada

  • Momeks

    Great article thanks

Bio

Name:

Martin Hicks

Age:

33

Education:

BSc Multimedia Computing (First-class Honours)

Skills:

HTML5, CSS3, PHP, ASP.NET (C#), Java, JavaScript, MySQL, PostgreSQL, MS SQL, iOS, Android, BlackBerry OS, PhoneGap, Appcelerator.

I have many years experience working in Web Development (both front-end and back-end) and Mobile App & Mobile Optimised Websites. I specialise in making solutions that are simple, intuitive, on budget and on time. I Get Things Done.

Listening to