What is the purpose of a line of code that says: '_ = viewController.view'?

What is the purpose of the following line of code? It doesn't seem to do anything. If it were in Playground or in a print statement it would at least show something.

_ = masterVC.view

It's in Apple's sample code at Sharing CloudKit Data with Other iCloud Users.

Here's the complete significant code that contains that line of code:

if let masterVC = masterNC?.viewControllers.first as? ZoneViewController {
      _ = masterVC.view
      start ? masterVC.spinner.startAnimating() : masterVC.spinner.stopAnimating()
}

I guess it could be intended to focus on the view or a similar side effect, but I'm not sure. They should have commented this line of code !

The purpose of that line is to load masterVC.view (which means loadView is called on masterVC). In the process of loading masterVC.view, the masterVC.spinner variable also gets set, which is why it's important to load masterVC's view before accessing the spinner in this example.

Another way of doing this would be to replace _ = masterVC.view with masterVC.loadViewIfNeeded().

What is the purpose of a line of code that says: '_ = viewController.view'?
 
 
Q