Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override Objective C class method in Swift

I'm beginner in Swift and I'm trying to use JSONModel in a Swift project. I would like to override the method keyMapper from JSONModel but I don't find how to override an Objective-C class method in the model class.

The signature of the method is:

+(JSONKeyMapper*)keyMapper;

How can I do that?

like image 434
Nonouf Avatar asked Nov 12 '14 21:11

Nonouf


1 Answers

You do it just like you override an instance method, except with the class keyword:

override class func keyMapper() -> JSONKeyMapper! {
    //code here
}
like image 140
NobodyNada Avatar answered Sep 24 '22 02:09

NobodyNada