Added solution for Swift.