Updating the Restaurant List screen to work with Dark Mode

When you build and run your app in the Simulator in Dark Mode, the cell background is white in the Restaurant List screen. Let's fix that by modifying restaurantCell. Take the following steps:

  1. Click Main.storyboard in the Project navigator. Choose restaurantCell in the document outline, and click the Attributes inspector. Note that the Background color is White, so restaurantCell will have a white background, regardless of mode, as can be seen in the following screenshot:

  1. You'll need to change the color to a dynamic color, which changes automatically depending on mode. Set Background to Default, as follows:

  1. Build and run the app. Now, the restaurantCell background switches color automatically when Dark Mode is on, as can be seen in the following screenshot:

  1. When you tap a restaurant in the list, note that the Restaurant Detail screen doesn't look right, as can be seen in the following screenshot:

The first cell's color is too light, the label under it is blank, the ratings view has a white background, the buttons for the Review Form and Photo Filter screens are white with no labels, and the cells containing the reviews, photos, and map also don't look right.

In the next section, you will update the table view so that the Restaurant Detail screen will work properly in Dark Mode.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.181.47