The following code cannot be changed a lot because the code is part of a nib. I just need 1 line of code that when ever cancelled is pressed the current page will be transformed back to the view controller. To go from page a to page b essentially. Right now in the code if a user hits cancel then the view controller immediately goes to the correct view controller. If the user takes a picture and then hits the cancel button. The photo is displayed and full the user can not go back to the correct view Controller.
import Foundation
import UIKit
protocol OverlayViewControllerDelegate {
func didCancel(overlayView: OverlayView)
func didShoot(overlayView: OverlayView)
}
class OverlayView: UIView {
@IBOutlet weak var cameraLabel: UILabel!
var delegate: OverlayViewControllerDelegate! = nil
@IBAction func cancel(_ sender: AnyObject) {
delegate.didCancel(overlayView: self)
}
@IBAction func click(_ sender: AnyObject) {
//cameraLabel.text = "Even Cooler Camera"
delegate.didShoot(overlayView: self)
}
}