Skip to content

Instantly share code, notes, and snippets.

@twilly86
Created November 24, 2014 18:55
Show Gist options
  • Save twilly86/61e99b4f2dd8ecf90fb7 to your computer and use it in GitHub Desktop.
Save twilly86/61e99b4f2dd8ecf90fb7 to your computer and use it in GitHub Desktop.
Swift RAC Reactive Cocoa Array Example
class RootViewController: UIViewController {
var numberArray : [Int] = []
// this is intentionally blank
override func viewDidLoad() {
var signal = RACObserve2(self.numberArray, "property")
signal.subscribeNext { (object) -> Void in
if let tuple = object as? RACTuple {
//var wholeArray = tuple.first as? NSArray
//var changeDictionary = tuple.second as? NSDictionary
NSLog("here")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment