12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- //
- // PaginationModel.swift
- // Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
- import Foundation
- import ObjectMapper
- class PaginationModel : NSObject, NSCoding, Mappable{
- var count : Int?
- var currentPage : Int?
- var links : [AnyObject]?
- var perPage : Int?
- var total : Int?
- var totalPages : Int?
- class func newInstance(map: Map) -> Mappable?{
- return PaginationModel()
- }
- required init?(map: Map){}
- private override init(){}
- func mapping(map: Map)
- {
- count <- map["count"]
- currentPage <- map["current_page"]
- links <- map["links"]
- perPage <- map["per_page"]
- total <- map["total"]
- totalPages <- map["total_pages"]
-
- }
- /**
- * NSCoding required initializer.
- * Fills the data from the passed decoder
- */
- @objc required init(coder aDecoder: NSCoder)
- {
- count = aDecoder.decodeObject(forKey: "count") as? Int
- currentPage = aDecoder.decodeObject(forKey: "current_page") as? Int
- links = aDecoder.decodeObject(forKey: "links") as? [AnyObject]
- perPage = aDecoder.decodeObject(forKey: "per_page") as? Int
- total = aDecoder.decodeObject(forKey: "total") as? Int
- totalPages = aDecoder.decodeObject(forKey: "total_pages") as? Int
- }
- /**
- * NSCoding required method.
- * Encodes mode properties into the decoder
- */
- @objc func encode(with aCoder: NSCoder)
- {
- if count != nil{
- aCoder.encode(count, forKey: "count")
- }
- if currentPage != nil{
- aCoder.encode(currentPage, forKey: "current_page")
- }
- if links != nil{
- aCoder.encode(links, forKey: "links")
- }
- if perPage != nil{
- aCoder.encode(perPage, forKey: "per_page")
- }
- if total != nil{
- aCoder.encode(total, forKey: "total")
- }
- if totalPages != nil{
- aCoder.encode(totalPages, forKey: "total_pages")
- }
- }
- }
|