This code worked just fine in Swift 2.3 and I don\'t understand why I have to unwrap TestClass to check if number is bigger than 4. This is whole point of chain
TestClass
First of all, where are you initialising your test var? Of course it'll be nil if you don't give it a value!
test
And regarding optional chaining, what's the issue writing :
if let optionalInt = test?.optionalInt, optionalInt > 4 { }
As always, safety > brevity.