I have a singleton class and a function that use one of its shared properties. I am getting this error:
"Method can not be marked as @objc because the type of the parameter 2 can not be represented in Objective-C".
My singleton class:
public class MessageManager {
public static var shared = MessageManager()
private init () {}
public enum messageFlag: String { // this is the enum causing the error when used
case sensitive
}
}
The error is happening when i use the enum from singleton:
@objc func checkMessage (_sender: UIBarButtonItem? , messageId: String? = nil , flag: MessageManager.messageFlag ) {
}
I have seen other people's solutions like the use of NSObject in class but still not working. Any fix for this?