Created
June 8, 2015 22:18
-
-
Save oliverbarreto/1bd5cd57a4555bd1fd82 to your computer and use it in GitHub Desktop.
Adding Swift Closures as values to Swift dictionary
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 CommandResolver { | |
typealias MyBlock = () -> Void | |
private var commandDict:[String : MyBlock]= [String:MyBlock]() | |
init() { | |
self.setUpCommandDict(); | |
} | |
func setUpCommandDict() { | |
self.commandDict["OpenAssessment_1"] = { | |
println("I am inside closure"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment