Updated for Swift6.
