// *** before: ***
let array = NSMutableArray()
array.addObject("one")
let text = "Hello".stringByAppendingString(", world")
let trimmed = text.stringByTrimmingCharactersInSet(
NSCharacterSet.whitespaceCharacterSet())
let color = UIColor.redColor()
// *** in version 3.0: ***
// the whole SDK was put through the API Design Guidelines: the words that
// the type already says are dropped, and the name reads as a phrase
var array = [String]()
array.append("one")
let text = "Hello".appending(", world")
let trimmed = text.trimmingCharacters(in: .whitespaces)
let color = UIColor.red
// a verb for what changes the value, a participle for what returns a new one
var numbers = [3, 1, 2]
numbers.sort() // changes numbers
let sorted = [3, 1, 2].sorted() // returns a new array
numbers.reverse()
let reversed = [3, 1, 2].reversed()