enum SearchBarAction {
case Cancel
case Bookmark
case Location
case Category
case Filter
}
@objc protocol SearchBarNavigatorDelegate: class {
optional func searchBarNavigator(clicked: SearchBarAction)
}
This gave me an error
Method cannot be a member of an @objc protocol because the type of the parameter cannot be represented in Objective-C
I need this method to be optional therefore i cannot remove @objc to solve this.
Is there any way to use optional protocol method while passing an enum as a parameter to the method?
It will work if you declare the enumeration as @objc
with raw type:
@objc enum SearchBarAction: Int {
case cancel
case bookmark
case location
case category
case filter
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With