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
protocol ViewModelInputs { | |
var buttonTapped: AnyObserver<Void> { get } | |
} | |
protocol ViewModelOutputs { | |
var showLoginErrorMessage: Driver<String> { get } | |
} | |
protocol ViewModelIO { | |
var inputs: ViewModelInputs { get } |
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
// I just implemented that with Swift. So I would like to share my implementation. | |
// First initialise an array of NSBlockOperations: | |
var blockOperations: [NSBlockOperation] = [] | |
// In the did change object method: | |
func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) { | |
if type == NSFetchedResultsChangeType.Insert { | |
println("Insert Object: \(newIndexPath)") |