How can I access the image filename from an SKSpriteNode
? I have been trying to Google this, but no answer seems to be available. Here is the impotent part of my code:
current_ingredient?.name = String(describing: current_ingredient?.texture)
print("Filename: \(current_ingredient?.name)")
The print command returns this:
Filename: Optional("Optional(<SKTexture> \'ingredient14\' (110 x 148))")
So, the question is, how do I get only "ingredient14"?