Override Objective-C class method in Swift

I am starting in Swift and I am trying to use JSONModel in a Swift project. I would like to override the keyMapper method from JSONModel, but I have not found how to override the Objective-C class method in the model class.

Method Signature:

+(JSONKeyMapper*)keyMapper; 

How can i do this?

+7
ios objective-c swift jsonmodel
source share
1 answer

You do this the same way you override the instance method, with the exception of the class keyword:

 override class func keyMapper() -> JSONKeyMapper! { //code here } 
+14
source share

All Articles