Skip to content

Instantly share code, notes, and snippets.

@rayfix
Created April 7, 2015 18:53
Show Gist options
  • Save rayfix/87e8a1e2aa015647cbb2 to your computer and use it in GitHub Desktop.
Save rayfix/87e8a1e2aa015647cbb2 to your computer and use it in GitHub Desktop.
didSet on array crashes my playground
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
struct Thing {
var arr: [Int] = [] {
didSet {
println("didSet{} called")
}
}
}
var t = Thing()
t.arr = [3,2]
t.arr.append(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment