mardi 26 mai 2020

Test String extension in Objective c

I have this in my project -

extension String {

    func doSomething() -> String {
        return "doSomething"
    }
}

I'm trying to write an Objective C test for it. (This is an SDK that can be used by Objective C projects) but when calling -

NSString* actualResult = [string doSomething];

I'm getting this error -

No visible @interface for 'NSString' declares the selector 'doSomething'

How can it be done?

Aucun commentaire:

Enregistrer un commentaire