swift - Cannot invoke 'filter' with an argument list of type '((_) -> _)' -


sounds ridiculous, i'm unable fix piece of code:

self.runningscripts.filter({ $0 != scriptrunner }) 

no matter how write closure error:

cannot invoke 'filter' argument list of type '((_) -> _)'

runningscripts defined this:

var runningscripts = [scriptrunner]() 

and scriptrunner swift class (does not inherit nsobject)

i'm using same in many other places without problems. suggestions?

you can error if didn't make scriptrunner conform equatable:

class scriptrunner : equatable {     // rest of implementation here }  func ==(lhs: scriptrunner, rhs: scriptrunner) -> bool {     return ... // change whatever test satisfies lhs , rhs equal } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -