For some context, I am using SpriteKit. I created an extension for SKTexture:
public extension SKTexture {
var sizeInPoint: CGSize {
return CGSize(size().width/2, size().height/2)
}
}
Now I would like to prevent accidental usage of size(), because texture.size() is in pixel, which is never what I want in my game.
How do I deprecate a system API? Or is it even possible?
Note:
I know when I subclass the SKTexture, I can mark size() as deprecated IN MY SUBCLASS. However, this is not ideal because the superclass SKTexture still has size() API.
For example, we can still get SKTexture from SKTextureAtlas:
let size = textureAtlas.textureNamed("dummy.png").size() // avoid this!