当试图从 a 中删除后缀时filename
,我只剩下后缀,这完全不是我想要的。
我在这里做错了什么(多少事情):
let myTextureAtlas = SKTextureAtlas(named: "demoArt")
let filename = (myTextureAtlas.textureNames.first?.characters.split{$0 == "."}.map(String.init)[1].replacingOccurrences(of: "\'", with: ""))! as String
print(filename)
这png
是整个事情中最沉闷的部分。