I'm doing, what I think, is a very simple timer bar, with nothing else on the screen. Yet this can't maintain 60fps on an iPad Pro... am I doing something obviously heavy and wrong?
let previewTime: TimeInterval = 3.0
func timerBar(){
let tbW: CGFloat = frame.size.width / 2
let tbH: CGFloat = 64
let tbSize = CGSize(width: tbW, height: tbH)
let timerBox = SKSpriteNode(color: SKColor.black, size: tbSize)
timerBox.anchorPoint = CGPoint(x: 0.0, y: 0.0)
timerBox.position = CGPoint(x: frame.size.width / 2 - (tbW / 2), y: 500)
timerBox.zPosition = 8
addChild(timerBox)
let timerBoxBar = SKSpriteNode(color: .white, size: tbSize)
timerBoxBar.anchorPoint = CGPoint(x: 0.0, y: 0.0)
timerBoxBar.position.x = 0.0
timerBoxBar.position.y = 0.0
timerBoxBar.xScale = 0.0
timerBox.addChild(timerBoxBar)
let animPreviewTime = SKAction.scaleX(to: 1, duration: GameScene.previewTime)
timerBoxBar.run(animPreviewTime){self.randomisePositions()}
}
This makes a timer bar with a black background and a white timer bar, that animates across the screen for 3 seconds, until the timer bar is full.
It stutters, visibly, and instruments show it using up spikey blue moments of rendering, sufficient to consistently make it stutter.
Update
Here's the spikes during the rendering of this, as you can see, either side of the time bar animation, absolute NOTHING is happening:
Xcode Version 8.2 beta (8C23)
iOS 10.2 Beta 2
Downloading iOS 10.2 beta 3 now...