Xcode 8 / Swift 3: “Expression of type UIViewController? is unused” warning

I’ve got the following function which compiled cleanly previously but generates a warning with Xcode 8.

func exitViewController()
{
    navigationController?.popViewController(animated: true)
}

“Expression of type “UIViewController?” is unused”.

Why is it saying this and is there a way to remove it?

The code executes as expected.

7 Answers
7

Leave a Comment