In Swift, optional chaining is the process in which we can query or call the methods, properties, or subscripts of an optional that might be a nil.
Generally, in Swift, optional chaining will return values in two ways, like if it contains a value, then it will return a value otherwise null value.