From 680f5cdfe87b94aefce8f94adcbf73adf54c1f37 Mon Sep 17 00:00:00 2001 From: Tristan Himmelman Date: Tue, 13 Sep 2016 22:09:54 -0400 Subject: [PATCH] Updates to readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e4c0f407..e5f012e8 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,10 @@ ObjectMapper is a framework written in Swift that makes it easy for you to conve - Struct support # The Basics -To support mapping, a class or struct just needs to implement the ```Mappable``` protocol. +To support mapping, a class or struct just needs to implement the ```Mappable``` protocol which includes the following functions: ```swift -public protocol Mappable { - init?(_ map: Map) - mutating func mapping(map: Map) -} +init?(_ map: Map) +mutating func mapping(map: Map) ``` ObjectMapper uses the ```<-``` operator to define how each member variable maps to and from JSON. @@ -91,7 +89,7 @@ Convert a model object to a JSON string: let JSONString = user.toJSONString(prettyPrint: true) ``` -Alternatively, the `Mapper.swift` class can also be used to accomplish the above (it also provides extra functionality for more other situations): +Alternatively, the `Mapper.swift` class can also be used to accomplish the above (it also provides extra functionality for other situations): ``` // Convert JSON String to Model let user = Mapper().map(JSONString: JSONString)