Adding a Today Extension to your app
In the code bundle for this chapter, you'll find a project called The Daily Quote. It's a straightforward app that displays a different inspirational quote to the user every day. The quotes are hardcoded in the Quotes.swift
file and the current quote is stored in the UserDefaults
store. The UI contains just two labels to show the current quote and the person that's quoted.
Even though the project is quite simple, each file contains something interesting. If you select one of the labels in the Storyboard
and examine its attributes, you'll find that the font for the quote itself is Title 1
and the font for the quoted person is Caption 1
. This is different from the default system font that you usually use. When you configure labels with these predefined styles, the text in the label will dynamically adjust based on the user's preferences. Adopting dynamic type such as this is requires only minimal effort and is great from an accessibility standpoint.
Note
If...