swift - Know if an array contains a type of element -
i'm working swift 3 , xcode.
i have class :
class h: skspritenode {...}
and array :
var array = [h]()
i want check nodes(at:)
function if @ given point, there element of type h. tried :
if nodes(at: mypoint).contains(h)
but doesn't work, , understand that. there way able know if arrays nodes(at)
function returns contains element class h ?
and other question, how can check in nodes returned function, if array contains node specific name ?
try use .filter({$0 h}).count > 0
Comments
Post a Comment