Adding a widget to your Home and Lock screens
Up until now, you’ve been testing your widget using the JRNLWidgetExtension
scheme. You’ll now use the JRNL
scheme and see how to add widgets to the Home and Lock Screens.
Follow these steps:
- Select the JRNL scheme and iPhone SE (3rd generation) from the Scheme menu:
Figure 25.16: Scheme menu with JRNL and iPhone SE selected
- Build and run your app, and add a few journal entries through the app. Then, stop your app.
- In Simulator, choose Home from the Device menu. You should see the JRNL widget on the screen:
Figure 25.17: Simulator showing the JRNL widget on the Home screen
- If you don’t see the JRNL widget, touch and hold the Home screen background until all the apps on the screen display a – badge.
- Tap the + button at the top right of the screen to open the widget gallery.
- Search for the JRNL widget, tap it, then tap Add Widget...