Adding a widget to your Lock screen
So far, you’ve been testing your widget using the LetsEatWidgetExtension scheme. You’ll now use the LetsEat scheme and see how to add widgets to the Lock screen. Follow these steps:
- Select the LetsEat scheme and iPhone SE (3rd generation) from the Scheme menu:
Figure 25.8: Scheme menu with LetsEat and iPhone SE selected
- Build and run your app. Choose Lock from the Device menu.
- Tap the Home button to wake the simulator. Tap and hold anywhere on the Lock screen to display the Customize button:
Figure 25.9: iOS simulator showing the Customize button
- Tap the Customize button. Your screen should appear like the following screenshot, showing areas where Lock screen widgets can be installed:
Figure 25.10: iOS simulator showing customizable areas
- Tap the area under the time display to display the widget picker. Click the LetsEat menu item: