My code was working perfectly with Swift2 and now for some label the variable is displayed but with Optional(....) just before...
Good code on Swift 2
var sstitre1:String!
print(sstitre1)
There is a perform segue which populate a value to sstitre1.
var sstitre1:String?
sstitre1 = json[21].string
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "hugo"
{
if let destinationVC = segue.destination as? MonumentViewController{
destinationVC.sstitre1 = "\(sstitre1)"
}
}
}
With Swift3, i ve get : Optional(.....)
I want to get rid of Optional.
So i have as recommend on several post from stackoverflow, made some code change.
var sstitre1:String!
If let espoir = sstitre1 {
print (espoir)
}
But unfortunately it still displays Optional....
Pretty weird ....