Created
August 17, 2014 00:21
-
-
Save tLewisII/66c6d5c182932acc7206 to your computer and use it in GitHub Desktop.
Syntax differences
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
// this... | |
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { | |
let group = data?[self.tableView.indexPathForSelectedRow().row] | |
if let destination = segue.destinationViewController as? ViewController { | |
destination.title = group?.valueForProperty(ALAssetsGroupPropertyName) as? NSString | |
destination.data = PhotoManager.lazySendableForGroup(manager) <^> group | |
} else { | |
println("Cast failed, proposed class of segue view controller is wrong") | |
} | |
} | |
// or this? | |
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { | |
let blockManager = self.manager | |
(data?[self.tableView.indexPathForSelectedRow().row] >>= { | |
(group:ALAssetsGroup) -> ()? in | |
(segue.destinationViewController as? ViewController >>= { | |
(destination:ViewController) -> ()? in | |
destination.title = group.valueForProperty(ALAssetsGroupPropertyName) as? NSString | |
destination.data = blockManager.lazySendableForGroup(group) | |
return () | |
}) ?? println("ViewController cast failed") | |
}) ?? println("Data array was None") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment