I want to pass data from one view controller to another. And I am using the following code in the prepareForSegue to do so...
let detailVC: DetailVC = segue.destinationViewController as! DetailVC
detailVC.alertDict = sender as! NSDictionary
In the first line as you can see there is a ! after the as. Thats because I have to use it to force downcast, and if I do not include the ! then I get an error: UIViewController is not convertable to DetailVC. But DetailVC is a inheritance of UIViewController class, so why can it not convert? Here is the code for the class..
class DetailVC: UIViewController, MFMailComposeViewControllerDelegate, MFMessageComposeViewControllerDelegate {/*code*/}