sprite.texture
is of type SKTexture?
, so you can't compare it against a string, but should rather compare against an actual SKTexture object.
Nevertheless, you should try to redesign your code, as suggested by others in the comments on your question. Checking against a texture itself is not good design. For one thing, if you decide to use a different texture for your sprites in 2 months, then you will need to remember to revisit this code.
I would suggest subclassing from SKSpriteNode and checking if a sprite's type is the same as your subclass. Other alterantives are to compare the sprite.name
or the sprite's userData
.