// // ExtensionJSON.swift // GMERemittance // // Created by gme_2 on 22/08/2018. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation import SwiftyJSON import ObjectMapper extension JSON { func map() -> [T]? { let json = self.array let mapped: [T]? = json?.compactMap({$0.map()}) return mapped } func map() -> T? { let obj: T? = Mapper().map(JSONObject: self.object) return obj } }