Swift tips, tricks and tools for iOS developers.

NSArray

With just a few lines of code, you can read/write collections to/from files. The code below shows examples for writing and reading both NSArray and NSDictionary objects, the same logic would apply to an NSSet (or other collection type).

When running Xcode 4.4 (the latest download from the Mac App Store) I noticed the option for Apple LLVM Compiler 4.0:

One reason this is significant is that you can now define literals for a number of additional objects, similar to how you define string literals with the @ prefix. In this post I’ll show you how to use NSArrays literals. Let’s look at a few examples: