Post

Replies

Boosts

Views

Activity

Reply to SWIFT Playgrounds crashes on Mac and iPad
Same. Using Mac book pro, Sonoma 14.1.1. Swift Playgrounds vesting 4.4.1 Stability of this app decreased significantly after 4.4 release. It crashes on iPad too. Please fix this asap. my middle school students, who eagerly work on their projects are having the app crashed 2 or more times each class. Just test with adding some bad syntax where it needs to throw an error. Though it is random , it is easy to reproduce. Just work like a developer and I am sure it will crash easily. especially use color literal or image literal, or try to add elements in an array by dragging the 2 dots in the array. By the way, color and image pickers are missing the icons. This is mainly in Playground Book.
Jan ’24
Reply to Unable to use SpriteKit with Swift Playground Books
Here is complete code that works on an Xcode Playground but not on an iPad. Is Apple moving away from using UIKit on Swift Playgrounds? Many other Apple Playground Books Stopped working too. However, Playground Books like Shapes still work. Based on this, it does seem to be a bug. When run on iPad let node = SKShapeNode(circleOfRadius: 100.0) throws an error. import PlaygroundSupport import SpriteKit class GameScene: SKScene { private var label : SKLabelNode! private var spinnyNode : SKShapeNode! override func didMove(to view: SKView) { scene?.backgroundColor = .blue let node = SKShapeNode(circleOfRadius: 100.0) node.position = CGPoint(x: 100, y: 200) scene?.addChild(node) } @objc static override var supportsSecureCoding: Bool { // SKNode conforms to NSSecureCoding, so any subclass going // through the decoding process must support secure coding get { return true } } func touchDown(atPoint pos : CGPoint) { } func touchMoved(toPoint pos : CGPoint) { } func touchUp(atPoint pos : CGPoint) { } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { for t in touches { touchDown(atPoint: t.location(in: self)) } } override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) { for t in touches { touchMoved(toPoint: t.location(in: self)) } } override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { for t in touches { touchUp(atPoint: t.location(in: self)) } } override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { for t in touches { touchUp(atPoint: t.location(in: self)) } } override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered } } // Load the SKScene from 'GameScene.sks' let sceneView = SKView(frame: CGRect(x:0 , y:0, width: 640, height: 480)) let scene = GameScene(size: CGSize(width: 600, height: 600)) // Set the scale mode to scale to fit the window scene.scaleMode = .aspectFill // Present the scene sceneView.presentScene(scene) PlaygroundSupport.PlaygroundPage.current.liveView = sceneView
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Nov ’23