What is Optional chaining in Swift?

Optional chaining is a process of querying and calling properties, methods and subscripts on optional value that might currently be nil. If the optional contains a value, the call succeeds, else call returns nil. Multiple queries can be chained together and entire chain fails gracefully if any link is nil.

Leave a Reply

%d bloggers like this: