Post

Replies

Boosts

Views

Activity

Reply to watchOS 7 Extreme Battery Life Degradation
All through the watchOS 7 betas, I didn’t experience any watch battery issues on either of the 2 Apple Watch Series 5’s I have. But after I updated both to release watchOS 7, both are experiencing at least a 2x rate of battery drain. Am barely able to get from 8am to 10 pm without a recharge. What in the world happened between the last watchOS beta and GM to cause this?
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’20
Reply to Using MagnificationGesture in SceneView
So, let's say you want to swap between cameras, provided you have more than one, in a scene. I banged my head on this for a bit of time, primarily because I'm either dim-witted (a real strong possibility) or just too set in my 57-year old ways, trying to change the pointOfView property in SceneView. Eventually, it hit me that all I'm trying to do is change the "withName" String in .childNode(withName: String, recursively: Bool). And boy!, that's easy. The above code I posted is junk and, frankly, embarrassing. Here's the better code. I hope it helps. import SwiftUI import SceneKit extension SCNScene: ObservableObject { } struct SwiftUISceneKitUsingStateObjectVarsContentView: View { 		@State private var povSwitch				= true 	@State private var pointOfView			= "distantCamera" 		@StateObject var aircraftScene			= SCNScene(named: "art.scnassets/ship.scn")! 		var body: some View { 				ZStack { 						Color.black.edgesIgnoringSafeArea(.all) 						SceneView ( 								scene: aircraftScene, 								pointOfView: aircraftScene.rootNode.childNode(withName: pointOfView, recursively: true) 						) 						.background(Color.black) 						VStack() { 								Text("Hello, SceneKit!").multilineTextAlignment(.leading).padding() 										.foregroundColor(Color.gray) 										.font(.largeTitle) 								Text("Change the camera.") 										.foregroundColor(Color.gray) 										.font(.title) 								Spacer(minLength: 300) 								Button( action: { 										withAnimation{ 												self.povSwitch.toggle() 										} 										 if self.povSwitch == true { 												self.pointOfView = "distantCamera" 										} else { 												self.pointOfView = "aircraftCamera" 										} 								}) { 										Image(systemName: sunlightSwitch ? "video.fill" : "video") 												.imageScale(.large) 												.accessibility(label: Text("Camera Switch")) 												.padding() 								} 						} 				} 				.statusBar(hidden: true) 		} }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’20
Reply to SceneView new api in Big Sur: how to use it
I posted this on another post dealing with MagnificationGesture, but frankly, it's more appropriate here. Here's how to swap between two cameras in a scene, "distantCamera" and "aircraftCamera". import SwiftUI import SceneKit extension SCNScene: ObservableObject { } struct SwiftUISceneKitUsingStateObjectVarsContentView: View { 		@State private var povSwitch				= true 	@State private var pointOfView			= "distantCamera" 		@StateObject var aircraftScene			= SCNScene(named: "art.scnassets/ship.scn")! 		var body: some View { 				ZStack { 						Color.black.edgesIgnoringSafeArea(.all) 						SceneView ( 								scene: aircraftScene, 								pointOfView: aircraftScene.rootNode.childNode(withName: pointOfView, recursively: true) 						) 						.background(Color.black) 						VStack() { 								Text("Hello, SceneKit!").multilineTextAlignment(.leading).padding() 										.foregroundColor(Color.gray) 										.font(.largeTitle) 								Text("Change the camera.") 										.foregroundColor(Color.gray) 										.font(.title) 								Spacer(minLength: 300) 								Button( action: { 										withAnimation{ 												self.povSwitch.toggle() 										} 										 if self.povSwitch == true { 												self.pointOfView = "distantCamera" 										} else { 												self.pointOfView = "aircraftCamera" 										} 								}) { 										Image(systemName: povSwitch ? "video.fill" : "video") 												.imageScale(.large) 												.accessibility(label: Text("Camera Switch")) 												.padding() 								} 						} 				} 				.statusBar(hidden: true) 		} }
Topic: Graphics & Games SubTopic: SceneKit Tags:
Aug ’20