Reece Kenney
Reece Kenney

Reputation: 2974

Xcode Swift initial view incorrectly sized

When my app starts, the view looks like this:

enter image description here

Then when I change views using this code:

let skView = self.view! as SKView
var scene: TitleScene!
scene = TitleScene(size: skView.bounds.size)
skView.presentScene(scene, transition: transition)

And then change back to the initial screen again using the above technique, the screen looks like this:

enter image description here

Why is it zoomed out? How can I make the sizing remain consistent across all views?

Upvotes: 0

Views: 50

Answers (1)

user5276032
user5276032

Reputation:

Put this line in the viewDidLoad method:

self.size = view.bounds.size

Upvotes: 2

Related Questions