Swift Student Challenge

RSS for tag

Ask questions and connect with other challenge applicants.

Swift Student Challenge Documentation

Posts under Swift Student Challenge tag

138 Posts
Sort by:
Post not yet marked as solved
3 Replies
351 Views
Hello world! I'm planning to participate in this year's WWDC22. And I have a question: for participating at the Challenge I need to provide Educational Supervisor's Contact Information, can I enter the information of my teacher, who is also my class coordinator?
Posted Last updated
.
Post marked as solved
2 Replies
338 Views
I'm constructing a Swift Playground with UIKit that contains an SKScene. After creating the code I'm planning to use within an Xcode project, I tried to adapt it into my Playground. I encountered an issue while running the Playground - when a new SKSpriteNode is added to the Scene, the new and existing nodes jitter, freeze, and lag for a split-second, the FPS counter drops to around 49fps, then returns to smooth 60fps. No errors or warnings are spat, and the console is completely empty. The scene in the project didn't have this issue, and I can't recreate it on another project - even when I directly copy-paste the code from the Playground to the project. I've seen other posts with this question - and made a few myself elsewhere - and there's been no responses. I desperately need help for this as nothing I've tried is working and the deadline is in a few days! Thanks! The code that is in effect for this SKScene is below. class SimulatorController: UIViewController { override func loadView() { let view = SKView() let scene = GameScene(size: view.bounds.size) view.showsFPS = true view.showsNodeCount = true view.ignoresSiblingOrder = true scene.scaleMode = .resizeFill view.presentScene(scene) self.view = view } } class GameScene: SKScene { override func didMove(to view: SKView) { run(SKAction.repeatForever(SKAction.sequence([ SKAction.run(addNeutron), SKAction.wait(forDuration: 1) ]) )) } func random() -> CGFloat { return CGFloat(Float(arc4random()) / 0xFFFFFFFF) } func random(min: CGFloat, max: CGFloat) -> CGFloat { return random() * (max - min) + min } func addNeutron() { let neutron = SKSpriteNode(imageNamed: "neutron.heic") neutron.size = CGSize(width: 20, height: 20) neutron.physicsBody = SKPhysicsBody(rectangleOf: neutron.size) neutron.physicsBody?.isDynamic = true let actualX = random(min: 0, max: size.width) let actualY = random(min: 0, max: size.height) neutron.position = CGPoint(x: actualX, y: actualY) addChild(neutron) let actualDuration = random(min: CGFloat(2.0), max: CGFloat(4.0)) let actualX2 = random(min: 0, max: size.width) let actualY2 = random(min: 0, max: size.height) let actionMove = SKAction.move(to: CGPoint(x: actualX2, y: actualY2), duration: TimeInterval(actualDuration)) let actionMoveDone = SKAction.removeFromParent() neutron.run(SKAction.sequence([actionMove, actionMoveDone])) } }
Posted Last updated
.
Post marked as solved
1 Replies
274 Views
For the submission you have to create a .swiftpm file. I have created a playground app on my Mac and created my app in there, however, on all the previous submission from previous years I see that when it is opened on iPad, there are these explanations and pages on the left side. Like a story. Am I able to do this on a Mac as well? Or is that not possible. I would appreciate it if someone knows the answer 😁
Posted Last updated
.
Post marked as solved
1 Replies
163 Views
Hi all, According to the guidelines: All content should be in English. I wish to ask if this indicates that there can be absolutely no foreign language. For example, would a project that is in English but aims to educate others about languages be acceptable? Thanks - James
Posted Last updated
.
Post marked as solved
1 Replies
217 Views
I need some help adding an .scn file to my submission for this year. I've tried creating an art.scnassets file from xcode within the project, adding the .scn file and trying to use it with SCNScene(named: "scene.scn"), but I get a blank SCNView and printing value of the SCNScene, I get nil. Please help in this context ASAP.
Posted Last updated
.
Post marked as solved
2 Replies
302 Views
My playground app runs perfectly fine when I compile it on Xcode on my Mac to run it on my iPad, but for some reason it won't run at all when I try running it directly on Swift Playgrounds (the file opens and it doesn't give me any errors, but it won't compile). How might I be able to fix this? My app is a .swiftpm file and I'm using Swift Playgrounds 4.0.2 on iPadOS 15.4.1. Any help would be greatly appreciated!
Posted
by CodeSwift.
Last updated
.
Post not yet marked as solved
0 Replies
120 Views
Sorry for weird question but In the swift student challenge, it said that You may include third-party open source licensed code and/or public domain images and sounds, with credit and an explanation of why it was used. where should i put my explanation? Thanks in advance!
Posted
by naufalfaz.
Last updated
.
Post not yet marked as solved
1 Replies
177 Views
Believe this was asked already but not answered. Is there a way to force the iPad orientation to landscape? Playgrounds don't have Info.plist. If there isn't, would it be bad design to display a "This experience is better in landscape" fullscreen message in portrait mode? (& is there a way to detect orientation?) Thank you.
Posted
by mshchur.
Last updated
.
Post marked as solved
1 Replies
197 Views
Hi, I am Sanjiv, a Highschool student who is trying to participate in wwdc student scholarship , and I have a doubt in swift I have two bool variables, one global and one local. Once the value of the global variable changes I want the value of the local variable also to change. I want this for navigation. I have a gameScene and once the level is completed it needs to go to the next navigation view. I have tried multiple methods but none worked. Any help will be appreciated.
Posted Last updated
.
Post not yet marked as solved
2 Replies
212 Views
Hey. I would like to enter this year's Swift student competition with my app. I'm 16 years old and I've been working on an app with XCode for 7 months. Accordingly, my app is now of course very large (500 mb) and of course also has the file extension .xcodeproj. So is my project already too big to take part in the competition? In addition, the requirements of the competition stated that the project should have the file extension .swiftpm... I would be very sad if my work at my young age could not be appreciated. Best wishes
Posted Last updated
.
Post marked as solved
1 Replies
177 Views
I made my AR app project on Xcode swift playground app and it's successfully work on iPad by debugging but it's not work when i open .swiftom file on iPad Pro. So my question is my project can judge on Xcode by debugging on iPad Pro or you will open my zip file directly on iPad Pro I'm confuse. What should I choose in submission run on Xcode or iPad pro?
Posted Last updated
.
Post not yet marked as solved
1 Replies
198 Views
Hi, I just wanted to display a SpriteKit Scene in a SCNPlane. So I set the the SCNMaterial contents to my SKScene, but instead of getting the scene I'm getting a grey plane. This is my code by the way: var mainScene: SKScene {     let scene = Game()     scene.size = CGSize(width: 1024, height: 1024)     scene.scaleMode = .resizeFill     scene.backgroundColor = .purple     scene.view?.backgroundColor = .purple     scene.view?.allowsTransparency = false     return scene } func initMainScene() -> SceneView {     mainScene.view?.isPaused = false     let scene = SCNScene()     let mainSceneMaterial = SCNMaterial()     mainSceneMaterial.normal.contents = mainScene     mainSceneMaterial.isDoubleSided = true     let planeGeometry = SCNPlane(width: 1, height: 1)     planeGeometry.materials = [mainSceneMaterial]     let plane: SCNNode = SCNNode(geometry: planeGeometry)     let camera: SCNNode = SCNNode()     camera.name = "Camera"     camera.camera = SCNCamera()     camera.position = SCNVector3(x: 0.0, y: 0.0, z: 4.0)     let light: SCNNode = SCNNode()     light.light =  SCNLight()     light.light!.type = .omni     light.position = SCNVector3(x: 1.5, y: 1.5, z: 1.5)     scene.rootNode.addChildNode(camera)     scene.rootNode.addChildNode(light)     scene.rootNode.addChildNode(plane)     return SceneView(         scene: scene,         pointOfView: scene.rootNode.childNode(withName: "Camera", recursively: false),         options: []     ) } Here is the screenshot: Also, my SpriteKit scene has touchesBegan and touchesMoved functions implemented, will those events still work if I embed the scene in the SCNMaterial? Thanks very much 🙏
Posted
by ItsTheGuy.
Last updated
.
Post not yet marked as solved
0 Replies
98 Views
I'm working on a Create ML project and the main activity requires the user to go out in the nature or on the nearest park outside and complete a task with the iPad camera. Are explicit outdoor Playgrounds allowed or should I provide sample pictures of the woods / park? I'm thinking about adding a short note on app launch that "the Playground it best experienced outdoors surrounded by nature".
Posted
by lascic.
Last updated
.
Post not yet marked as solved
0 Replies
200 Views
After training and exporting my model from playgrounds using createML, I wasn't able to instantiate the mlmodel. In the error logs, a warning: "Found 1 resource(s) that may be unavailable in Swift Playgrounds" and the filepath to my mlmodel. When going into the mlmodel, this message shows up: "Model class has not been generated yet.". I have tried building the project and running it, but the message doesn't change. Any tips for integrating a custom mlmodel trained with createml into a swift playgrounds app? thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
299 Views
I try to transfer this Xcode sample project to the Playground app project. However, when I move all swift files and the CoreML file called 'ExerciseClassifier.mlmodel' on the folder to the Playground app project, it shows the error, "Cannot find type 'ExerciseClassifier' in scope". What could I do to remove the error and make a proper working project on Playground?
Posted
by yerin16.
Last updated
.