In Swift 1.0 you would count an array like this:
let items = [1, 2, 3] println(countElements(items))
countElements() function has been renamed to
count() in Swift 1.1, so the new code is this:
let items = [1, 2, 3] println(count(items))
Note: This has changed in later versions of Swift –
count is now a property of strings and collections.
SPONSORED Spend less time managing in-app purchase infrastructure so you can focus on building your app. RevenueCat gives everything you need to easily implement, manage, and analyze in-app purchases and subscriptions without managing servers or writing backend code.
Link copied to your pasteboard.