Addev
Addev

Reputation: 32243

No visible @interface when trying to call a Swift method in objective c

I'm trying to call a Swift method in objective c:

func checkItem(atIndex:Int) -> Bool {
    print("Hard work")
    return false;
}

But I get the error: No visible @interface for 'RateAppViewPagerHelper' declares the selector 'checkItem:'

The objective c code call is:

[finder checkItem:_index];

What do I'm doing wrong?

Thanks

Upvotes: 3

Views: 1040

Answers (1)

Dima
Dima

Reputation: 23634

The method signature will be checkItemAtIndex: instead of checkItem because of the external label on the parameter in the swift method.

Upvotes: 5

Related Questions