Last active
May 28, 2016 08:49
-
-
Save nunogoncalves/8131dae2aec22f19c9f6b3a4c6e8e95e to your computer and use it in GitHub Desktop.
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 Deserializable { | |
associatedtype T: Deserializer | |
var deserializer: T { get } | |
func getDataFrom(dictionary: NSDictionary) -> T.MappedObject | |
} | |
extension Deserializable { | |
func getDataFrom(dictionary: NSDictionary) -> T.MappedObject { | |
return deserializer.buildFrom(dictionary) | |
} | |
} | |
protocol Deserializer { | |
associatedtype MappedObject | |
func buildFrom(dictionary: NSDictionary) -> MappedObject | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment