Expression of type 'UIViewController?' is unused warning when pop view controller in swift 3.0
@IBAction func goBackToIntroView(_ sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
// popViewController(animated:) returnsUIViewController?
// , and the compiler is giving that warning since you aren't capturing the value. The solution is to assign it to an underscore:
// Answer
_ = navigationController?.popViewController(animated: true)
Also in Swift:
- how to set the center in view in swift
- swiftui background color
- swift uitableview insert cell
- IOS create UIAlertViewController programmatically
- how to set return type swift
- switch statements swift
- time formats swift
- swift show title on navigation bar programmatically
- .next() enum swift
- swiftui font color
- swift dispatch after
- remove child from firebase swift
- limit log file size swift
- swift sort array
- swift close app
- change selection color uitableviewcell swift
- get item filter count swift
- one line if statement swift
- predicate realm bool swift
- xcode how to get aspect ratio of device
- verilog monitor
- how to screen record swift stackoverflow
- UIFont.init bold
- Split a String into an array in Swift