So I'm defining an objc method:
@objc func networkCall(action: NetworkAction) { //Error: Method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C
switch action {
case .post:
print("Posting")
case .get:
print("Getting")
case .delete:
print("Deleting")
case .update:
print("Updating")
}
}
That I would like to call here:
postButton.addTarget(self, action: #selector(networkCall(action: .post)), for: .touchUpInside) //Error: Argument of '#selector' does not refer to an '@objc' method, property, or initializer
Is it possible to pass enums as a parameter to objc?