popviewcontroller code example Example: pop the view controller xcode navigationController?.popViewController(animated: true)