Skip to content

Instantly share code, notes, and snippets.

View rohitdhiman's full-sized avatar

Rohit Dhiman rohitdhiman

View GitHub Profile

#Collections in Swift

Arrays and dictionaries are the most common data stores in many applications. Swift has brought us a new generation of these collections, so let's take a look at how they compare to the collections found in Objective-C.

##Greatest Differences

###Typing One of the most obvious differences between collections in Objective-C and Swift is that Swift collections are explicitly typed. Typed collections are useful for many reasons, primarily because the system requires you to be precise with the content type you are working with. Any type mismatches will throw errors, which will help you avoid common mistakes.

###Mutability