When I am about to fire my segue for the 2nd view I also send some values like this:
if let aTime = ads[indexPath.row]["unix_t"].int {
toView.time = aTime
}
if let aTitle = ads[indexPath.row]["title"].string {
toView.title = aTitle
}
In the second VC I have declared the varibles like:
var time: Int?
var title: String?
and this is how I unwrap the values:
if time != nil {
timeLabel.text = String(time!)
}
if title != nil {
titleLabel.text = title!
}
This all works I never get any error caused by unwrapped varibles or nil values. But is there any easier way to do it?
Right now it feels like I am checking too much