Optional chaining in Swift is a feature that allows you to access properties, methods, and subscripts on an optional value (a…