Unlike the previous ones, I was surprised to see that "title" is now optional (the compiler now generates waning: String interpolation creates a debug description for the optional value, would you like to make it explicit?).
How did the expression if if title = 'does no unbox it? What to do with unpacking in if?
// Go thru all publication where the tag has been found for item in items { if let item = item as? [String: String?], let title = item["label"] { i += 1 if let rawSummary = item["libSousTheme"] { print("\(i)) Tag [\(foundTag)] z[\(foundZTag)] in « \(title) »") } else { print("\(i)) Tag [\(foundTag)] z[\(foundZTag)] in « \(title) » (no summary!)") } } }
let if-statement swift swift3
Stéphane de Luca Mar 01 '17 at 22:42 2017-03-01 22:42
source share