i Have a BaseRequestObject of type NSObject,Mappable which is inherit by a object called User. I need to save this User object inside realmDB.
class BaseRequestBody: NSObject,Mappable {
override init() {
}
required init?(map: Map) {
}
func mapping(map: Map) {
}
}
UserObject which inhertits BaseRequestBody:-
class User: BaseRequestBody {
var id : String?
var name : String?
override init() {
super.init()
}
required init?(map: Map) {
super.init(map: map)
}
override func mapping(map: Map) {
id <- map["id"]
name <- map["name"]
}
}
How to use this User object to store both in realmDatabase and use as a normal object.I am using this same object to parse alamofire data to userObject.