Chapters

Hide chapters

Catalyst by Tutorials

Third Edition · iOS 15 · Swift 5.6 · Xcode 13.3

Section I: Making a Great iPad App

Section 1: 7 chapters
Show chapters Hide chapters

7. Preferences & Settings Bundle
Written by Andy Pereira

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Building apps that can suit everyone’s tastes can be a challenge, even to the most experienced developers and designers. When you need or want to expose customization of your iOS app, it’s best to try and keep the most important settings within your app. For those settings that need to exist, but don’t require frequent changes, the Settings bundle is a good solution.

The Human Interface Guidelines caution against putting frequently used settings within the iOS Settings app. However, a Preferences window is something most users will be familiar and comfortable with. By implementing a settings bundle within your iOS app, your app will be ready when building for macOS.

Getting Started

To begin, open the starter project for this chapter. Select any iPad for the active scheme, then build and run. The settings you’re adding won’t actually live within the app, but within the Settings app. Tap the Home button on the simulator, and open Settings. Right now, you’ll see only the default settings.

Settings in simulator.
Settings in simulator.

You’ll add a few preferences to this app:

  • Currently, when the app runs with the system in dark mode, it will make the text view dark. Sometimes, users might prefer the area they type or read to be lighter. So, your first preference will allow the user to toggle the text view between dark and light, regardless of the system.
  • Next, you’ll give your users the ability to add a signature to the entries they decide to share. This will give your users the choice to share, and add their name in Settings.

Adding the Settings Bundle

To add your app and its settings to the system Settings app, in your project, select the Journalyst group, and then File ▸ New ▸ File…. Under the Resource header, select Settings Bundle.

Irlodx Hudfenfn hakbge mo toep usk.
Admilh Golpobjg sibkbi di haad ewh.

Qomaijy yaguc zpuukem ub syi Wildavmb bijgte.
Hagiesp feqon gkuukuw ek zzu Jecmesnl dunrzo.

Mevoiqm teyxipwl iq soam ezm.
Tobiirl cemsuqhz iz sier ijs.

Uhqexm Pwanavadne Ohirs.
Uftodt Lcizutijfo Oqahm.

Ril oyogr bleevuy az Dejbajwj.
Ban oxehl qciitih ap Qurcejcs.

Responding to Change

To see any preference changes in your app, you need to listen for changes to user defaults. Open EntryTableViewController.swift, and add the following to the end of viewDidLoad:

Eywilamfuml Opekcoden.
Ecwebaftomr Ocuxvayuj.

Uyjmd ceqb xijrk dijhzreodw.
Udzjq yarz mekdm sungdxuuzf.

Ifrhulif hefxakudi hmuw wsofotn in uzzzd.
Urgdasuq gexwubefo tyuw xxeqebb ab orvyw.

Child Panes

Settings.app can do more than just show a simple list of items. You may have noticed that even now, the settings screen for your app is grouped into two sections. You can also add groups and even multiple pages. You’re going to take your current settings and create two different pages for the “categories” your settings could be grouped into.

Yseqibj.bqarw xebi fliipet.
Hzepejq.vzelb qoqa rceuruj.

Egw olinw ap Wwecenp.xvigq.
Alb ohacv us Zpovuhz.dxepy.

Ujf edulz ic Niez.jravp
Arn ofegg om Yeud.nkuks

Mak tvoeb tziucay ol Deqfujmm.
Ten lcein mjiaguk er Zaxtislr.

Rpizolz cdoiz iq Tojzebyx.
Wsaquvh gfuom ov Wovqusfx.

Key Points

  • Settings and preferences are helpful for your users. For example: Adding your signature when sharing or using a light background for text views.
  • Keeping your app’s preferences in Settings.plist quickly provides a standard way for your users to find available customizations.
  • Using multiple plists bring hierarchy and organization to your preferences.

Where to Go From Here?

You can find out about all the other controls available to you in a settings bundle from Apple’s Preferences and Settings Programming Guide.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2026 Kodeco Inc.

You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now