Swift Playground

RSS for tag

Learn and explore coding in Swift through interactive learning experiences on the Swift Playground app for iPadOS and macOS.

Posts under Swift Playground tag

57 Posts

Post

Replies

Boosts

Views

Activity

What Xcode version will be used for SSC evaluation?
Hello! Because the compilers used by different versions of Xcode 26 may be different, and I find that my app may not be able to ensure that all versions of Xcode 26 are successfully compiled. For example, my app can run on Xcode26.3 but will report an error at 26.4 (I have fixed it now). So I want to confirm which version of Xcode the jury uses to run my app, whether it is a known version or the latest version in the future. Thanks!
0
0
7
5h
“Keep Going with Apps” Tutorial section will not complete.
Hello All, I am currently working through ”Keep going with Apps” in Swift Playground. The section in the tutorial “Add a DancingCreature view” will not complete. I have tried to type it is as written in the tutorial and even used the copy and paste button provided. I have restarted the app and my IPad with no success. I have attached a screen shot of the tutorial prompt. Here is the code block: import SwiftUI import Guide struct DancingCreatures: View { //#-learning-code-snippet(varDeclaration) @EnvironmentObject var data : CreatureZoo var body: some View { SPCAssessableGroup(view: self) { VStack { ZStack { /*#-code-walkthrough(dance.forEach)*/ ForEach(data.creatures) { creature in /*#-code-walkthrough(dance.forEach)*/ /*#-code-walkthrough(dance.textView)*/ Text(creature.emoji) .resizableFont() .offset(creature.offset) .rotationEffect(creature.rotation) /*#-code-walkthrough(dance.textView)*/ } } ZStack { /*#-code-walkthrough(dance.forEach)*/ ForEach(data.creatures) { creature in /*#-code-walkthrough(dance.forEach)*/ /*#-code-walkthrough(dance.textView)*/ Text(creature.emoji) .resizableFont() .offset(creature.offset) .rotationEffect(creature.rotation) /*#-code-walkthrough(dance.textView)*/ //#-learning-code-snippet(exp1) //#-learning-code-snippet(animationSolution) //#-learning-code-snippet(exp3) } } /*#-code-walkthrough(dance.onTap)*/ .onTapGesture { data.randomizeOffsets() } /*#-code-walkthrough(dance.onTap)*/ /*#-code-walkthrough(dance.onTap)*/ .onTapGesture { data.randomizeOffsets() } /*#-code-walkthrough(dance.onTap)*/ } } } } struct DancingCreatures_Previews: PreviewProvider { static var previews: some View { DancingCreatures().environmentObject(CreatureZoo()) } } Device information: IPad Pro (11 inch, 2nd gen) iPad OS Version: 26.0.1 Playground Version: 4.6.4 Anyone else come across this? Thank you in advance.
6
5
518
1d
Foundation Models support in Swift Playgrounds | SSC26
Hello. I'm building my Swift Student Challenge Project. But I noticed that the FoundationModels Framework isn't supported in Swift Playgrounds. My app uses ARKit, so it definitely should be tested on real device. So, is it possible to somehow implement a foundation models to my Swift Playgrounds app? Or is it possible to ask judges to test the app on real device launching it from xcode. Your answer is really important for because the functionality of my app directly depends on Foundation Models availability. Thank you!
0
0
47
2d
Foundation Models support in Swift Playgrounds | SSC26
Hello. I'm building my Swift Student Challenge Project. But I noticed that the FoundationModels Framework isn't supported in Swift Playgrounds. My app uses ARKit, so it definitely should be tested on real device. So, is it possible to somehow implement a foundation models to my Swift Playgrounds app? Or is it possible to ask judges to test the app on real device launching it from xcode. Your answer is really important for because the functionality of my app directly depends on Foundation Models availability. Thank you!
0
0
37
2d
Does an app relying on CoreLocation (GPS) fit the Swift Student Challenge judging criteria?
Hi everyone, I’m currently developing my submission for the Swift Student Challenge. My app idea heavily relies on CLLocationManager to track the user's movement (recording coordinates, altitude, and calculating distances) to provide a localized, real-world experience. I have a few questions regarding how this will be evaluated during the judging process: Testing Environment: Since the rules mention that Xcode app playgrounds are run in the Simulator, but submissions optimized for iPad are run on real devices, will the judges physically test an app that requires real-world walking/movement? Location Permissions: Will the judges accept the iOS location permission prompts to experience the app, or should I build a "Simulation Mode" with mock GPS data to ensure they can evaluate the core logic without leaving their desk? Judging Criteria: Does a location-dependent app fit well within the "Technical Accomplishment" and "Creativity" criteria, or is it too risky if the judges cannot test the physical movement aspect easily?
0
0
22
2d
Can I Upload a Single Screenshot Showing iPhone, iPad, and Mac Designs Together?
Hi everyone, I have a question about showcasing my Swift Student Challenge submission. My app includes layouts optimized for iPhone, iPad, and Mac, and I’d like to highlight that it works well across all three device sizes. Would it be acceptable to upload one combined screenshot that shows the same screen displayed on iPhone, iPad, and Mac side-by-side, to demonstrate the responsive design? Thanks in advance for any advice!
1
0
206
3d
Questions about content usage & submission file
Hi everyone, I have two questions that I hope someone from the community (or Apple team) could help clarify: Use of real Apple Executives in a creative scene In a short introductory scene of my app playground, I included the names and emojis representing Apple executives in a respectful and creative way. There are: No official logos No copyrighted assets No branding elements It is purely fictional and made for storytelling purposes. Would this be acceptable under the submission guidelines, or should all characters be entirely unrelated to real individuals? Submission file concern After submitting my application, I realized I may have accidentally uploaded the wrong ZIP file (I mean I'm not sure tbh). Is there any way to review the exact file that was submitted? Would it be possible to withdraw and resubmit again? If so, would that count as multiple submissions (since only one submission is allowed)? I’d really appreciate any clarification from those who may have experienced something similar or from the Apple team. Many thanks!
0
0
30
3d
Reoccurring data access prompt issue with Swift Playgrounds 4.6.4 on macOS 26.1
Hello, I am having a recurring issue using Swift Playgrounds version 4.6.4 on macOS 26.1. Upon opening a file and every other time I start typing in the code section I get a prompt, the image below, two or three times. It doesn't matter if I accept or decline all or some of the prompts, as soon as I start typing on another line I get prompted another two or three times for permission. It appears to me that prompt generates every time the preview pane tries to update. Declining the prompt breaks the preview but accepting the prompt only gets you through a single line of code before it appears again. I believe this issue started after I updated to macOS26.1 as I had not encountered it before. I've also opened other files with Swift Playgrounds and encounter the same problem. It could also be unrelated to the update and could be an issue with some permission setting somewhere, however, I have been unable to find what or where it could be. Is anyone else experiencing this? Thank you for your time :)
27
18
2.4k
1w
protocol witness error in Playgrounds
I'm importing SwiftUI, Foundation and Charts into an iOS app I'm writing in Swift in Xcode Playgrounds and am getting this error: error: Couldn't look up symbols: protocol witness table for Foundation.Date : Charts.Plottable in Charts the code looks like this in just two example files: file 1, the view import Foundation import SwiftUI import Charts import PlaygroundSupport struct FirstChart_WithDates: View { private let data = ChartDateAndDoubleModel.mockData(months: 3) var body: some View { Chart(data) { item in BarMark( x: .value("Label", item.date, unit: .month), y: .value("Value", item.value) ) } .padding() .aspectRatio(1, contentMode: .fit) .dynamicTypeSize(.accessibility1) ChartDateAndDoubleModelView(data: data) } } struct ChartDateAndDoubleModelView: View { var data: [ChartDateAndDoubleModel] var body: some View { VStack { HeaderRowView(texts: ["date", "value"]) ForEach(data) { datum in HStack { Text(datum.date.formatted(date: .abbreviated, time: .omitted)) .frame(maxWidth: .infinity) // TODO: Format for 2 decimal places. Text(datum.value, format: .number.precision(.fractionLength(2))) .frame(maxWidth: .infinity) } } } .padding(.bottom, 8) .overlay(.quaternary, in: .rect(cornerRadius: 8).stroke()) .padding() } } struct HeaderRowView: View { var texts: [String] var body: some View { HStack(spacing: 2.0) { ForEach(texts, id: \.self) { text in Text(text) .padding(4) .frame(maxWidth: .infinity) .background(.quaternary) } } .font(.headline) .mask(UnevenRoundedRectangle(topLeadingRadius: 8, topTrailingRadius: 8)) } } and file 2, the model: import Foundation import SwiftUI import Charts // ChartDateAndDoubleModel.swift // // // Created by Michael Isbell on 2/10/26. // public struct ChartDateAndDoubleModel: Identifiable { public let id = UUID() public let date: Date public let value: Double } public extension ChartDateAndDoubleModel { static func mockData(months: Int = 5) -> [ChartDateAndDoubleModel] { var data: [ChartDateAndDoubleModel] = [] let calendar = Calendar(identifier: .gregorian) let currentDate = Date() for month in 0..<months { //add month to current date and append to data data.append( ChartDateAndDoubleModel( date: calendar.date(byAdding: .month, value: month, to: currentDate)!, value: Double.random(in: 0...1000) ) ) } return data } }
1
0
44
1w
Some question about Swift Student Challenge 26
My playground may require that the device has downloaded some resources in advance, such as Apple's advanced voice, translation language... But this is not necessary. It is just an incidental function. If it is not downloaded, the app will prompt that this function is not available and most of the other functions can continue to be used. But I want to know whether the judge's device will download these things in advance, and if not, will the judges think that there is a problem with my app that can't be used normally, which will cause my work to be rejected directly? Because my app uses the API of iOS 26, it needs to run in Xcode, and the competition allows the Apple intelligent function, but it is stipulated that if it runs with Xcode, the app will be tested on the simulator. However, my app involves image playground and cannot run on the simulator. Does anyone have a good solution? Thank you!
1
1
218
1w
Can I submit the app I submitted to the app store to SSC at the same time?
Hi, I recently built an app and I’m planning to publish it on the App Store. Since the Swift Student Challenge (SSC) is coming up, I’m also considering submitting the same project by converting it into a Swift Playground (with some content trimmed to meet the rules). I believe both I and the project are eligible. My question: if I publish the app on the App Store first and then submit it to SSC, could that violate the rules or lead to rejection? I also have a concern: because I’m a minor, Apple requires the App Store developer name to be my mother’s. However, the app was entirely developed by me. my mother and anyone else did not participate(My mother can't even use a computer.). I’m worried this might create confusion and make judges think I copied someone else’s work, which I did not. Would you recommend publishing on the App Store now, waiting until after SSC, or taking a different approach? Thank you.
1
0
392
1w
Can a Swift Student Challenge submission include .metal shader files ?
Hello developers, i have a project for SSC that includes metal shader code. The project runs fine when I build and run it in Xcode, but it does not run in the Swift Playground app. The reason is that Swift Playgrounds doesn’t compile/build source files with the .metal extension the same way Xcode does (so the shader never gets built/loaded in Playgrounds). The requirements say: “Your app playground must be built with and run on Swift Playgrounds 4.6 or Xcode 26, or later.” Since it says “or” (not “and”), does that mean it’s acceptable if the project only builds/runs in Xcode?
2
0
256
2w
Whether SSC can be connected to the iPad real machine with Xcode to run the evaluation
👋Hi This problem is related to SSC. I remember that the form submitted last year needed to be filled in with Xcode or Playground test, and it seems that it was also mentioned: • If you use Xcode, the judges may use Simulator to run. • If you use Playground, it's a real machine. But my work this time will encounter two limitations: It will use the framework/API only available in iPadOS 26 (so if it is a Playground environment, it may not run, playground can't use iPadOS 26 SDK) It will also use some content that must be real to run (such as ARKit), which means that Xcode Simulator is not good. So I would like to ask: Does this year's review allow you to compile and connect the iPad to the real machine? Or did I misremember last year's regulations? If the judge's environment is fixed (for example, only Playground or only Simulator), how should I adjust the submission method or implement the scheme? Looking forward to your reply, thank you.
2
3
446
3w
Swift Student Challenge – Using iOS 26 APIs + Camera Input in Xcode App Playgrounds (Simulator Limitation)
Hi, I’m working on my Swift Student Challenge submission using iOS 26 APIs (FoundationModels) along with AVFoundation + Vision to capture user input and generate feedback. Since Swift Playgrounds doesn’t support FoundationModels framework, I’m using an Xcode App Playground, but I heared that submissions are reviewed in the Simulator, which doesn’t support live camera feed. I’m unsure how to handle this. Looking for guidance on the recommended approach. Thanks!
1
0
291
3w
SwiftUI iOS 26 .safeAreaBar issue with large navigation title
I have some really straight forward code in a sample project. For some reason when the app launches the title is blurred obscured by scrolledgeeffect blur. If I scroll down the title goes small as it should do and all looks fine. If I scroll back to the top, just before it reaches the top the title goes large and it looks correct, but once it actually reaches/snaps to the top, is then incorrectly blurs again. Is there anything obvious I'm doing wrong? Is this a bug? struct ContentView: View { var body: some View { NavigationStack { ScrollView { VStack { Rectangle().fill(Color.red.opacity(0.2)).frame(height: 200) Rectangle().frame(height: 200) Rectangle().frame(height: 200) Rectangle().frame(height: 200) Rectangle().frame(height: 200) } } .safeAreaBar(edge: .top) { Text("Test") } .navigationTitle(Title") } } }
4
1
503
Jan ’26
Swift Student Challenge Questions
Hey there! I have a few questions about the Swift Student Challenge: Is it acceptable to include placeholders for features that aren’t supported by Swift Playgrounds, or features I planned but didn’t have time to fully implement (as long as the core experience works)? My app relies a lot on user inputs. Is it okay to include a button that loads sample data for reviewers, or is there a preferred approach for this? Besides the known constraints (< 25 MB, experienceable within ~3 minutes), are there any other limits, e.g. lines of code or overall app complexity Can AI-generated assets (e.g. images) be used if they’re clearly labeled as such inside the app? Do we need to explicitly document where AI was used (assets, code, etc.) as part of the submission? My app uses the Foundation Model: On what device is the submission evaluated and should the usage of the Foundation Model be explicitly marked for reviewers? Thanks a lot, and sorry for the many questions!
2
0
306
Jan ’26
Is it safe to manually edit Package.swift (iOS Version & Orientation) for SSC 2026?
Hi everyone, I am working on my submission for the Swift Student Challenge 2026 using a Swift App Playground (.swiftpm). The default project was set to iOS 16, but I manually edited the Package.swift file to change the minimum version to iOS 18.0 so I can use the latest APIs. I also modified the supportedInterfaceOrientations to lock the app to Portrait mode only. I know the file contains a warning saying "Do not edit it by hand," so I am worried about two things: Disqualification: Will manually changing the iOS version from the default 16.0 to 18.0 cause any issues with the submission validator or the judging environment? Orientation: Is it acceptable to strictly force .portrait mode for the challenge, or are we required to support landscape/responsive layouts for the judges' iPads? I want to make sure these manual changes won't technically invalidate my playground. Thanks for your help!
1
0
214
Jan ’26