I'm currently have an app with 6 balls. I use. the following method to move a Ball. Once it's touched I set its .isMoving property to true, and save the node that was touched into a global variable.
Of course the moment I get a touchesEnded or touchesCanceled, the first thing I do is set the moving property to false, clear the global variable and call a function that animates the ball back to its starting my point.
While this all works, I'm too new to Swift to know if this method has any flaws, or is not the proper/efficient way to do this.
If it makes any difference am catching all touches, and movements in the GameScene.
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?){
		guard let touch = touches.first else { return }
		let location = touch.location(in: self)
		let touchedNodes = self.nodes(at: location)
		for node in	touchedNodes{
				if let theNode = node as? SKSpriteNode {
						if theNode.name == "ball" {
								theNode.zPosition += 1
								node.isMoving = true
								}
						}
				}
		}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?){
		guard touches.first != nil else { return }
		 if let touch = touches.first, let node = myGlobalVars.currentBall, node.isMoving == true{
					let touchLocation = touch.location(in: self)
					node.position = touchLocation
					//redraw node to emulate motion
				}
		}
Post
Replies
Boosts
Views
Activity
I am trying to place a border on top of a white block.
When I set the border's Y positioning only based on the height of the block, I get what I expected: The border is half into the block. Screenshot, top half
The next logical step:
I adjust the border's Y position to include half of its own height. What I expect is the bar resting on top of the block. But for some reason, the border is way above the block. Screenshot, bottom half
Am I somehow confusing pixels for points?
When I do take the border's height into account, I use this line:
self.position = CGPoint(x: myGV.safeSceneRect.width/2, y: myGV.gemBaseSize.height + (self.size.height/2)) Below in order:
My code for the border,
Print out of sizes and positions
a link to the two screen shots
import Foundation
import SpriteKit
class MyBorder : SKSpriteNode{
		var nodeType = NodeType.border
		init(){
				 //create SKSpriteNode, size it based on screen size
				super.init(texture: SKTexture(imageNamed: "border"), color: .clear, size: CGSize(width: myGV.safeSceneRect.width, height: myGV.safeSceneRect.height * 0.07))
				self.anchorPoint = CGPoint(x: 0.5, y: 0.5)
				self.isHidden = true
				self.isUserInteractionEnabled = false
				self.zPosition = theZ.border
				self.alpha = 0.5
				// position border on top of block
				self.position = CGPoint(x: myGV.safeSceneRect.width/2, y: myGV.blockBaseSize.height)
				print("Screen Size \(myGV.safeSceneRect)")
				print(“Block Size \(myGV.blockBaseSize)")
				print("Border Size \(self.size)")
				print("Border Pos \(self.position)")
				myGV.gameScene!.addChild(self)
				self.isHidden = false
		}
		required init?(coder aDecoder: NSCoder) {
				fatalError("init(coder:) has not been implemented")
		}
}
Here is the output for both runs, same order as the image
> Screen Size (0.0, 44.0, 375.0, 734.0)
Block Size (300.0, 146.8)
Border Size (375.0, 51.380001068115234)
Border Pos (187.5, 146.8000030517578)
Screen Size (0.0, 44.0, 375.0, 734.0)
Block Size (300.0, 146.8)
Block Size (375.0, 51.380001068115234)
Border Pos (187.5, 172.49000549316406) www .warptv.com/links/screens.png
I wanted to have more than just
#if DEBUG
	 ...
#endif
So in the project editor I added a user-defined setting
Wasn't sure exactly how to label and value, so I've tried
So I've tried it as (under user-defined)
MYSCENE MYSCENE
MYSCENE 1
MYSCENE DEBUG
And yet I can't get #if MYSCENE to work.
Any thoughts?
Rather than do this:
let skTexture = SKTexture(imageNamed: "slot")
let mySlot = SKSpriteNode(texture: skTexture, color: .clear, size: slotSize)
I would like to grab the texture in the call to create the SKSprite. I know I'm supposed to use closures, yet I am unable to figure out the proper syntax.
Am looking for something like:
let mSlot = SKSpriteNode( {texture: SKTexture(imageNamed: "slot") -> (SKTexture)} color: SKColor.clear, size: mySlotSize)
Have tried as many variants as I can think of but never get to the point where I can compile.
If the closure is something that I must predefine, then there's no point in trying this.
My entire project is here www. warptv.com/DropSlot.zip
It's very sloppy and kludgy because I made it while I started to learn Swift.
In the code I make a pegHolder positioned at 10, 10
The pegHolder contains 6 slots,
and each slot holds a different color ball
The pegHolder is a child of GameScene
The slots are children of the pegHolder
and each ball is a child of itsslot
Then I create a barrier on the left side of the screen that runs up and down on an X axis of 5 (although in the end I want it at -1.
For some reason at setup, the red ball is thrown on the other side of the barrier. I can grab it and pull it back, but it shouldn't start being thrown off the screen.
Oddly enough I never register a collision, so it must be something else throwing the ball over. When I tried it with the barrier at the bottom of the screen, the same thing happened.
Any thoughts would be appreciated.
Two days ago I was able to receive touchesBegan (moved, canceled) and now I've lost them. So I shortened the code below, created an SKSpriteNode called redSprite within GameScene...and still I don't receive touches.
While I know my redSprite doesn't fulfill all the if's in the touch functions, I'm placing a breakpoint at the start of the touch functions, and it still won't stop at the breakpoint.
However...if I set GameScene's isUserInteractionEnabled to true, then I do get the touches and the debugger breaks.
import UIKit
import SpriteKit
var redSprite : SKSpriteNode?
class GameScene: SKScene, SKPhysicsContactDelegate {
		override func sceneDidLoad(){
				super.sceneDidLoad()
				#if DEBUG
						print ("GC sceneDidLoad")
				#endif
		}
		
		override func didMove(to view: SKView){
				super.didMove(to: view)
				#if DEBUG
						print ("GC didMove START")
				#endif
				self.isHidden = true
				self.backgroundColor = mySafeColor
				myGlobalVars.backGround = SKSpriteNode(imageNamed: "background")
				myGlobalVars.backGround!.zPosition = theZ.backGround
				myGlobalVars.safeSceneRect = view.frame
				myGlobalVars.gameScene = self
				self.isHidden = false
				self.isUserInteractionEnabled = false
				self.addChild(myGlobalVars.backGround!)
				physicsWorld.contactDelegate = self
				
				
				redSprite = SKSpriteNode(color: .red, size: CGSize(width: 100, height: 100))
				redSprite?.anchorPoint = CGPoint(x: 0.5, y:0.5)
				redSprite?.isHidden = false
				redSprite?.isUserInteractionEnabled = true
				redSprite?.color = .orange
				 redSprite!.name = "test"
				 redSprite?.zPosition = 10
				redSprite?.position = CGPoint(x: (myGlobalVars.safeSceneRect.width/2)-(50), y: myGlobalVars.safeSceneRect.height/2 - 50)
				
				redSprite?.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: 100, height: 100), center: CGPoint(x: 0.5, y: 0.5))
				 redSprite?.physicsBody!.affectedByGravity = false
				 redSprite?.physicsBody!.restitution = 0.2
				 redSprite?.physicsBody?.categoryBitMask		= bodyMasks.blankMask.rawValue
				 redSprite?.physicsBody?.contactTestBitMask = bodyMasks.blankMask.rawValue
				 redSprite?.physicsBody?.collisionBitMask	 = bodyMasks.blankMask.rawValue
				
				 self.addChild(redSprite!)
				
				gameTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(runTimedCode), userInfo: nil, repeats: true)
				gameTimer?.tolerance = 0.2
				RunLoop.current.add(gameTimer!, forMode: .common)
				#if DEBUG
						print ("GC didMove END")
				#endif
		}
		override func touchesBegan(_ touches: Set<UITouch>,
															 with event: UIEvent?){
				guard let touch = touches.first else { return }
				let location = touch.location(in: self)
				let touchedNodes = self.nodes(at: location)
				for node in	touchedNodes{
						if let theNode = node as? MyGem {
								if theNode.nodeType == NodeType.gem, theNode.isMoving == false {
										theNode.isMoving = true
										theNode.zPosition += 1
										myGlobalVars.currentGem = theNode
								}
						}
				}
		}
		override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?){
				guard touches.first != nil else { return }
				if let touch = touches.first, let node = myGlobalVars.currentGem, node.isMoving == true {
						let touchLocation = touch.location(in: self)
						node.position = touchLocation
						node.isMoving = true
						node.inSlot = false
						//addTrailToTwinkle(theNode: node)
				}
		}
		
		override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
				 guard touches.first != nil else { return }
				if let _ = touches.first, let node = myGlobalVars.currentGem, node.isMoving == true {
						returnHome(moveThis : node, origNP: node.origPoint)
				}
		}
		
		override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
						guard touches.first != nil else { return }
						if let _ = touches.first, let node = myGlobalVars.currentGem, node.isMoving == true {
						returnHome(moveThis : node, origNP: node.origPoint)
						}
				}
		
		@objc func runTimedCode() {
			timeLeft -= 1
		}
}
Below is my abbreviated code, the full code does work.
It starts at GameViewController, create GameScene, and GameScene creates an SKSpriteNode.
What's confusing me is the debug output which just tracks where I am in my app (shown in the abbreviated code).
The debug output is at the very bottom of this post.
I wonder about the order of execution, the last debug msg is the end of GameViewController...I would have thought I'd be done with that already.
i.e. How do I know that everything I'm setting in GVC is setup before it's needed in GC?
On a side note, I've tried Googling "SKScene lifecycle" and can't seem to find the proper documentation.
GameViewController
class GameViewController: UIViewController {
		override func viewDidLoad() {
				super.viewDidLoad()
				#if DEBUG
						print ("GVC viewDidLoad")
				#endif
				
				... create myView (as an SKView)
				... add it as a subview of GameViewController
				... use myView to get constraints
... and set other properties
				myView.isHidden						 = false
				myView.ignoresSiblingOrder		= true
				myView.showsFPS							 = true
				myView.showsNodeCount				 = true
				myView.showsPhysics					 = true
		}
		override func viewWillLayoutSubviews() {
				super.viewWillLayoutSubviews()
				#if DEBUG
						print ("GVC viewWillLayoutSubviews")
				#endif
		}
		 func viewDidAppear() {
				super.viewDidAppear(true)
				#if DEBUG
						print ("GVC viewDidAppear")
				#endif
		}
		override func viewDidLayoutSubviews() {
				super.viewDidLayoutSubviews()
				#if DEBUG
						print ("GVC viewDidLayoutSubviews START")
				#endif
				... get the view.frame
				... record some properties in my global variables				
				
... launch GameScene here
				if myGlobalVars.gameScene == nil {
						let scene = GameScene(size: myView.frame.size )
						scene.anchorPoint = CGPoint(x: 0.0, y: 0.0)
						scene.backgroundColor	 = .clear
						scene.scaleMode				 = .aspectFit
						myGlobalVars.gameScene = scene
						myView.presentScene(scene)
				}
				#if DEBUG
						print ("GVC viewDidLayoutSubviews END")
				#endif				
		}
		
		override var shouldAutorotate: Bool {
				return false
		}
		override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
				if UIDevice.current.userInterfaceIdiom == .phone {
						return .portraitUpsideDown
				} else {
						return .all
				}
		}
		override var prefersStatusBarHidden: Bool {
				return false
		}
}
GameScene
class GameScene: SKScene, SKPhysicsContactDelegate {
		override func sceneDidLoad(){
				super.sceneDidLoad()
				#if DEBUG
						print ("GC sceneDidLoad")
				#endif
		}
		
		override func didMove(to view: SKView){
				super.didMove(to: view)
				#if DEBUG
						print ("GC didMove START")
				#endif
				... load background image
				physicsWorld.contactDelegate = self
				
				... create just one SKSpriteNode
				createGems(myGemRef: &myGems)
				#if DEBUG
						print ("GC didMove END")
				#endif
		}
}
GVC viewDidLoad
GVC viewWillLayoutSubviews
GVC viewDidLayoutSubviews START
GC sceneDidLoad
GC didMove START
SKNode create SKSPriteNode start
SKNode create SKSPriteNode end
GC didMove END
GVC viewDidLayoutSubviews END
I am trying to create four walls, that would surround the screen.
From GameScene I call
let leftWall = MyEdge(side: Walls.left)
The code below works. But then I cannot add it as a child to GameScene, also I would like to give it an SKPhysicsBody.
My problem is figuring out the super.init. I've tried
super.init(texture: nil, color: .clear, size: CGPath(w: 0, h: 0))
super.init()
But I always get
Type of expression is ambiguous without more context
class MyEdge {
		let yourline = SKShapeNode()
		let pathToDraw = CGMutablePath()
		var color : SKColor
		var startAt : CGPoint
		var endAt : CGPoint
		var colMask : UInt32
		var conMask : UInt32
		var catMask : UInt32
		var name : String
		init(side: Walls){
				let whichWall = side
				switch whichWall
				{
						case .left:
myGlobalVars.backGround!.size.height+1)
								startAt = CGPoint(x: 5, y: 5)
								endAt = CGPoint(x: 5, y: myGlobalVars.safeSceneRect.size.height-5)
								color = .white
								colMask = bodyMasks.gemMask.rawValue
								conMask = bodyMasks.blankMask.rawValue
								catMask = bodyMasks.edgeMask.rawValue
								name = "left"
				}
				pathToDraw.move(to: startAt)
				pathToDraw.addLine(to: endAt)
				yourline.lineWidth = 2
				yourline.path = pathToDraw
				yourline.strokeColor = color
		}
}
Am currently using Xcode Version 12.1 (12A7403)
About a week ago the App Store tried to update Xcode but went nowhere for hours. The update is dated 10/25
So from a linkI was able to downloaded Xcode 12.1.1 dated 10/30
from https://developer.apple.com/download/more/
According to the Apple website, the download is Xcode 12.1.1 dated 10/30
Now sure which to do, or if there's a way I can backup my current Xcode and it's settings just in case something goes wrong.
Has anyone experienced this as well?
In GameViewController I do set the safeAreaLayouts. My only problem is that the top and bottom safe areas (iPhone X) are white.
Now I can change them via Main.storyboard. However, am working (or learning) my way to create apps without any storyboards.
Besides, perhaps I may to vary the background colors of the safeAreas.
So was looking for a way to do it with coding. Since I am hear, is there a way to also change the color of the text in the status bar as well?
Am pasting the complete code for GVC, just in case that has something to do with my question.
import UIKit
import SpriteKit
class GameViewController: UIViewController {
		
		public let myView : SKView = {
				let myView = SKView()
				myView.translatesAutoresizingMaskIntoConstraints = false
				return myView
		}()
		private func addConstraints(){
				 var constraints = [NSLayoutConstraint]()
				//add
				 constraints.append(myView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor))
				 constraints.append(myView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor))
				 constraints.append(myView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor))
				 constraints.append(myView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor))
				//activate
				 NSLayoutConstraint.activate(constraints)
		 }
		override func viewDidLoad() {
				super.viewDidLoad()
				#if DEBUG
						print ("GVC viewDidLoad")
				#endif
				
//				if let view = self.view as! SKView?
						
						view.addSubview(myView)
						addConstraints()
						var scene : GameScene!
//				var scene = GameScene(size: myView.frame.size)
//				let scene = GameScene(size: myView.frame.size)
						DispatchQueue.main.async { [self] in scene = GameScene(size: myView.frame.size )
								
								scene.anchorPoint = CGPoint(x: 0.0, y: 0.0)
								scene.backgroundColor	 = .clear
								scene.scaleMode				 = .aspectFit
								myView.isHidden					 = false
								myView.ignoresSiblingOrder		= true
								myView.showsFPS							 = true
								myView.showsNodeCount				 = true
								myView.showsPhysics					 = true
								myView.presentScene(scene)
						}
				
		}
		override func viewWillLayoutSubviews() {
				super.viewWillLayoutSubviews()
		}
		override func viewDidLayoutSubviews() {
				super.viewDidLayoutSubviews()
				#if DEBUG
						print ("GVC viewDidLayoutSubviews")
				#endif
				getScreenDimensions (screen: &screenDims)
				if myGlobalVars.safeSceneRect == .zero {
						myGlobalVars.sceneRect = view.frame
						myGlobalVars.sceneRect = myView.frame
				}
				
				if #available(iOS 11.0, *) {
						myGlobalVars.topSafeArea		= view.safeAreaInsets.top
						myGlobalVars.bottomSafeArea = view.safeAreaInsets.bottom
				} else {
						myGlobalVars.topSafeArea		= topLayoutGuide.length
						myGlobalVars.bottomSafeArea = bottomLayoutGuide.length
				}
		}
		
		override var shouldAutorotate: Bool {
				return false
		}
		override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
				if UIDevice.current.userInterfaceIdiom == .phone {
						return .portraitUpsideDown
				} else {
						return .all
				}
		}
		override var prefersStatusBarHidden: Bool {
				return false
		}
}
I am currently using this code in my GameViewController file to retrieve the boundaries of the safeArea
&#9; override func viewWillLayoutSubviews() {
&#9;&#9;&#9;&#9;super.viewWillLayoutSubviews()
&#9;&#9;&#9;&#9;let safeAreaInsets = self.view.safeAreaInsets
&#9;&#9;}
My concern is that if I were using a UIView (called myView below), I could automatically apply it with this code block and never think of it again.
var constraints = [NSLayoutConstraint]()
constraints.append(myView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor))
constraints.append(myView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor))
constraints.append(myView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor))
constraints.append(myView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor))
}
Is there an equivalent call when I'm doing that for a UIViewController?
Also, from all my reading online many posts have said to use trailing and leading rather than top and bottom. However self.view.safeAreaInsets appears to only have top and bottom.
From within my GameViewController's viewDidLoad() function I do two things:
1- I create a sub UIVIew, myView, which is added to the main view,
2- I call my function, addConstraints, which is in the GameViewController's code.
When I create GameScene, self.myView.frame.width & self.myView.frame.height contain the correct values, and abide by the safeAreaLayout guides.
I want to make my code clearer, so I've moved the addConstraints function to a separate file. But when I run my app that way self.myView.frame.width & self.myView.frame.height are zero.
So am curious if I am somehow translating the function incorrectly, or maybe this is something I can't move outside of the main code?
The first block is the original code, the 2nd is the function//located with GameViewControl		
private func addConstraints(){
				var constraints = [NSLayoutConstraint]()
				
constraints.append(myView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor))
constraints.append(myView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor))
constraints.append(myView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor))
constraints.append(myView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor))
NSLayoutConstraint.activate(constraints)
}
translated into a function//called from GameViewControl
		createConstraints(view: myView)
....
//located outside of GameViewControl
func createConstraints(view: UIView) {
var constraints = [NSLayoutConstraint]()
constraints.append(view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor))
constraints.append(view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor))
constraints.append(view.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor))
constraints.append(view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor))
NSLayoutConstraint.activate(constraints)
}
And here is the full file of GameViewControlimport UIKit
import SpriteKit
class GameViewController: UIViewController {
		
		private let myView : UIView = {
				let myView = UIView()
				setViewAttributes(view: myView)
				return myView
		}()
		private func addConstraints(){
				 var constraints = [NSLayoutConstraint]()
				//add
constraints.append(myView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor))
constraints.append(myView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor))
constraints.append(myView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor))
constraints.append(myView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor))
//activate
NSLayoutConstraint.activate(constraints)
}
override func viewDidLoad() {
super.viewDidLoad()
#if DEBUG
print ("viewDidLoad")
#endif
if let view = self.view as! SKView? {
getScreenDimensions (screen: &screenDims)
view.addSubview(myView)
addConstraints()
var scene : GameScene!
DispatchQueue.main.async { scene = GameScene(size: CGSize(width: self.myView.frame.width, height: self.myView.frame.width))
scene.anchorPoint = CGPoint(x: 0.0, y: 0.0)
scene.backgroundColor = .clear
scene.scaleMode = .aspectFit
view.isHidden = false
view.presentScene(scene)
}
view.ignoresSiblingOrder = true
view.showsFPS = true
view.showsNodeCount = true
view.showsPhysics = true
}
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
#if DEBUG
print ("GVC viewDidLayoutSubviews")
#endif
myGlobalVars.sceneRect = view.frame
if #available(iOS 11.0, *) {
myGlobalVars.topSafeArea = view.safeAreaInsets.top
myGlobalVars.bottomSafeArea = view.safeAreaInsets.bottom
} else {
myGlobalVars.topSafeArea = topLayoutGuide.length
myGlobalVars.bottomSafeArea = bottomLayoutGuide.length
}
}
override var shouldAutorotate: Bool {
#if DEBUG
print ("shouldAutorotate")
#endif
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
#if DEBUG
print ("supportedInterfaceOrientations")
#endif
if UIDevice.current.userInterfaceIdiom == .phone {
return .allButUpsideDown
} else {
return .all
}
}
override var prefersStatusBarHidden: Bool {
#if DEBUG
print ("prefersStatusBarHidden")
#endif
return false
}
}
The call to function setViewAttributes does pass the view to a function, and I have verified that that function is working.func setViewAttributes(view: UIView)
{
view.alpha = 0.0
view.frame.size.height = UIScreen.main.nativeBounds.height
view.frame.size.width = UIScreen.main.nativeBounds.width
view.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = .clear
}
I just finished a very rough draft of my first app whilst learning Swift. So I decided to remake the app so that my code would be cleaner/more compliant, etc.
I don't use storyboards, I launch from GameViewControler, both apps are set for a minimum iOS of 13.5, and both are run on the iPhoneX simulator...as well as my iPhoneX itself.
But for some reason in each different app, I am getting different screen sizes! Am going to assume I did something different when I "created" the new project, but am unable to distinguish what that is.
Here is my entire GameViewController.swift file and have included a photo of the different screen sizes. I break right after I get both the bounds and native bounds.
The two different sizes are:
In the 1st project I get
wPixels 1125
hPixels 2436
wPoints 375
hPoints 812
and the 2nd
wPixels 960
hPixels 1440
wPoints 320
hPoints 480
import UIKit
import SpriteKit
class GameViewController: UIViewController {
		override func viewDidLoad() {
				super.viewDidLoad()
				if let view = self.view as! SKView? {
						var wPix = UIScreen.main.nativeBounds.width
						var hPix = UIScreen.main.nativeBounds.height
						var wPoi	= UIScreen.main.bounds.width
						var hPoi	= UIScreen.main.bounds.height
						var scene : GameScene!
						DispatchQueue.main.async { [self] in
										 scene = GameScene(size: CGSize(width: wPoi, height: hPoi))
						scene.anchorPoint = CGPoint(x: 0.0, y: 0.0)
						scene.backgroundColor = .red
						scene.scaleMode = .aspectFit
						view.isHidden = false
						view.presentScene(scene)
						}
						view.ignoresSiblingOrder = true
						view.showsFPS = true
						view.showsNodeCount = true
						view.showsPhysics = true
				}
		}
		override var shouldAutorotate: Bool {
				return false
		}
		override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
				if UIDevice.current.userInterfaceIdiom == .phone {
						return .allButUpsideDown
				} else {
						return .all
				}
		}
		override var prefersStatusBarHidden: Bool {
				return false
		}
}
Update Xcode via the app store is like losing a day. I was hoping I could find the update (dmg) somewhere on Apple to download ver 12.2. Yet the only download I found was for 12.3 beta.
So was hoping the updates are located somewhere.
Thank you
May sound silly, but just wanted to make sure that if I import /declare a module in Swift, say:
#import GameplayKit
And use none of its definitions, will the Xcode compiler not include it in the build?