我有一个 UIImageView 供用户查看(看起来几乎像启动屏幕),以便我可以预加载我的纹理图集。
但似乎在完成块中,即使我说'removefromsuperview'它也没有这样做。
我知道纹理已经完成加载,因为如果我点击屏幕 UIImageView 消失并且我的游戏开始了,但由于某些奇怪的原因它不会自行消失。
这是我的 GameViewController 中的 viewDidLoad:
//Configure the View
let skView = view as! SKView
skView.multipleTouchEnabled = false
self.view.exclusiveTouch = false
//Create and Configure the scene
scene = GameScene(size: skView.bounds.size)
scene.scaleMode = .AspectFill
//Load "SPLASH SCREEN"
let image: UIImage = UIImage(named: "ViewControllerImage")!
GameViewController.splashView = UIImageView(image: image)
GameViewController.splashView!.frame = CGRectMake(0,0,self.view.bounds.width,self.view.bounds.height)
self.view.addSubview(GameViewController.splashView!)
SKTextureAtlas.preloadTextureAtlases([GameViewController.diploTextureAtlas,GameViewController.bieberTextureAtlas,GameViewController.skrillexTextureAtlas,GameViewController.sunTextureAtlas], withCompletionHandler: { () -> Void in
print("Completo")
GameViewController.splashView?.removeFromSuperview()
skView.presentScene(self.scene)
})