diff --git a/WolfNet.podspec b/WolfNet.podspec index 765200f..0e67687 100644 --- a/WolfNet.podspec +++ b/WolfNet.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "WolfNet" - s.version = "1.0.7" + s.version = "1.0.8" s.summary = "泛型的网络请求与解析" s.homepage = "https://github.com/xiaozao2008/WolfNet" s.license = "MIT" diff --git a/WolfNet/Wolf/WolfBaseModel.swift b/WolfNet/Wolf/WolfBaseModel.swift index 45ae4ce..dffee4b 100644 --- a/WolfNet/Wolf/WolfBaseModel.swift +++ b/WolfNet/Wolf/WolfBaseModel.swift @@ -9,9 +9,9 @@ import ObjectMapper import Foundation -public class WolfEmpty: Mappable { +public class WolfEmpty: Mappable { - required public init?(map: Map) { + public required init?(map: Map) { } public func mapping(map: Map) { diff --git a/WolfNet/Wolf/WolfNetwork.swift b/WolfNet/Wolf/WolfNetwork.swift index 51d4043..b373d32 100644 --- a/WolfNet/Wolf/WolfNetwork.swift +++ b/WolfNet/Wolf/WolfNetwork.swift @@ -75,21 +75,21 @@ public class WolfNetwork { struct Model { - static func objectFromJSON(_ Json: Data, _ msg: ((String?, Int?) -> Void)) -> WolfBaseModel? { + static func objectFromJSON(_ Json: Data, _ msg: ((String?, Int?) -> Void)?) -> WolfBaseModel? { let mapperModel = Mapper>() if let json = String.init(data: Json, encoding: .utf8) { let object = mapperModel.map(JSONString: json) - msg(object?.msg, object?.code) + msg?(object?.msg, object?.code) return object } return nil } - static func listFromJSON(_ Json: Data, _ msg: ((String?, Int?) -> Void)) -> WolfListModel? { + static func listFromJSON(_ Json: Data, _ msg: ((String?, Int?) -> Void)?) -> WolfListModel? { let mapperModel = Mapper>() if let json = String.init(data: Json, encoding: .utf8) { let object = mapperModel.map(JSONString: json) - msg(object?.msg, object?.code) + msg?(object?.msg, object?.code) return object } return nil