对象映射变得简单
填充 NSObject 的值就像做饼一样简单。
class Person {
var name: String = ""
var age: Int = 0
}
let subject = Person.new()
subject.fill(["name":"Batman", "age":55])有了 Mapper,您还可以使用字典初始化对象。
let subject = Person.initWithDictionary(["name":"Batman", "age":55])Mapper 还可以将您投入的任何对象的字典表示形式返回。
let objectDictionary: NSDictionary = subject.dictionaryRepresentation()git checkout -b my-new-feature)git commit -am '添加某些功能')git push origin my-new-feature)