Adding the Highlight View

Next you are going to add a circle beneath the currently selected image (Figure 18.5). This will give users context as to what is currently selected.

Figure 18.5  Completed highlight view

Completed highlight view

Open ImageSelector.swift and add a property for the highlight view.

Listing 18.11  Adding the highlight view (ImageSelector.swift)

private let highlightView: UIView = {
    let view = UIView()
    view.backgroundColor = view.tintColor
    view.translatesAutoresizingMaskIntoConstraints = false
    return view
}()

You worked with the global tint color in Chapter 16. This tint color is passed down the view hierarchy from ...

Get iOS Programming: The Big Nerd Ranch Guide, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.