Skip to content

Instantly share code, notes, and snippets.

@rbarbera
Created July 3, 2014 06:48
Show Gist options
  • Save rbarbera/241f2b5b3d4663f262e2 to your computer and use it in GitHub Desktop.
Save rbarbera/241f2b5b3d4663f262e2 to your computer and use it in GitHub Desktop.
This will print "Ops!"
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var monitor1 = Monitor.sharedMonitor()
_sharedMonitor = Monitor()
var monitor2 = Monitor.sharedMonitor()
if monitor1 === monitor2 {
println("Singleton are working")
} else {
println("Ops!")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment