override static instancetype method in swift?

552 Views Asked by At

I want to use this objective-C library in my swift code:

https://github.com/Alex601t/Catamaran

According to instruction I need to subclass a defined class and override method which declared as:

+ (instancetype)OAuth

How to implement it? I try to write the following:

class func OAuth() -> Self { ... }

It is not compiled and shows error that I need to add override. If I fix it - it writes that OAuth() is replaced by init(). If I try to fix it then I get other errors.

Could you explain how to fix that correctly?

1

There are 1 best solutions below

0
Francesco Deliro On

You can try:

   override init() {
       // use here your custom constructor
       self.initWithBaseUrl ... // etc.
   }