Created
July 3, 2014 06:48
-
-
Save rbarbera/241f2b5b3d4663f262e2 to your computer and use it in GitHub Desktop.
This will print "Ops!"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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