CS193p assignment in Swift for iOS8