To respond to one of the main points I’ve seen, which is that this isn’t
necessary for arrays because the index you’re using is often tied to data
related to the array, such as in the example I gave originally, where in
`cellForRowAtIndexPath`, the index path is probably informed by the length
of
Recently I’ve been considering the lack of safety around array indexes.
Swift is designed with safety in mind, so this example would not compile:
var myString: String? = “hello”
myString.append(“ world!”)
The string is optional, not guaranteed to exist, so the last line requires
a “!” to
I’ve been a little dismayed to see that closures in Swift 3 no longer have
parameter names. As an example, in Swift 2, a function with a completion
block may look like this:
func sendMessage(completion: (success: Bool, recipientID: String?,
senderID: String?) -> Void) {
//Oh no it failed