Post

Replies

Boosts

Views

Activity

SwiftUI's SpriteView won't rotate on an iPhone
Please refer to this SO question - https://stackoverflow.com/questions/63193102/how-to-rotate-a-spriteview with more info / images. But basically the following code will not rotate on a real device (iPhone 11, iOS 14b3): import SwiftUI import SpriteKit @main struct TestApp: App { 		var body: some Scene { 				WindowGroup { 						ContentView() 				} 		} } struct ContentView: View { 		var body: some View { 				GeometryReader { geometry in 						// SpriteView test (does NOT rotate) 						SpriteView(scene: createSKScene(with: geometry.size)) 								.frame(width: geometry.size.width / 2, height: geometry.size.height / 2) 				} 		} 		func createSKScene(with size: CGSize) -> SKScene { 				let scene = SKScene() 				scene.backgroundColor = UIColor.red 				return scene 		} } It rotates just fine on simulators though. Ah, it also rotates on a real iPad Pro 11" (I just checked). So maybe the issue has to do with iPhones? Xcode: 12.0 beta 3 iOS: 14 beta 3 Should I fill a but to it or am I missing something?
1
0
533
Jul ’20