] TODO Item
Item 1
Item 2
linkText
TODO Item language
Swift Playground
RSS for tagLearn and explore coding in Swift through interactive learning experiences on the Swift Playground app for iPadOS and macOS.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
第一次接触swift编程,swift playground里面编程入门挺简单的,因为英语也不好,不知道怎么入手了
Hi there, I'm currently learning how to write some code using Swift Playgrounds on my Mac, and I'm wondering if there's a way to install the code I create onto my iPhone, like a regular app.
I've searched online quite a bit but haven't found any clear or definitive answers.
Many resources mention a "Run on iPhone" option in Swift Playgrounds, but I don't see that button in my version. I even installed Xcode and connected my iPhone to my Mac, following the instructions I found, but the "Run on iPhone" option still doesn't appear in Playgrounds.
I've updated my Mac, iPhone, and Playgrounds to the latest version. Thank you for your help!
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
How can I enable "Extended Runtime Sessions" for a companion watch app? Here https://developer.apple.com/documentation/watchkit/using-extended-runtime-sessions
in targets under 'Signing & Capabilities' I checked "Audio" and Session Type 'Mindfulness',
I created an ExtendedRuntimeManager.swift file. When running a simulation the error message says
"Extended Runtime Session ungültig: Reason=-1, Error=This application does not have appropriate permissions to schedule a session."
How does the app get the 'appropriate permissions'?
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
WatchKit
watchOS
Background Tasks
Hello the community, how are you?
Since few days, this messages displays as an error into my code: "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions"
Since all these days, I'm not able to solve this problem. My app is almost done and the code is good. But I don't find where the problem is from.
Here's the block where the message appears:
var body: some View { //The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
VStack {
TextField("Search invoices...", text: $searchText)
.padding(10)
.background(Color.gray.opacity(0.1))
.cornerRadius(10)
.padding(.horizontal)
HStack {
ForEach(BillFilter.allCases) { filter in
Button(action: {
selectedFilter = filter
}) {
Text(filter.rawValue)
.padding()
.background(selectedFilter == filter ? Color.accentColor : Color.gray.opacity(0.2))
.foregroundColor(selectedFilter == filter ? .white : .black)
.cornerRadius(8)
}
}
All the best,
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Certain documentation seems to suggest I can submit a swift playground to the App Store. I am a paid $99 a year developer. In the submission process they ask for my team ID. I am not part of a team. I am an individual. However, my individual account has a team ID associated with it, but they don’t allow me to enter that number in the space provided. There is an * note saying some teams are not permitted to upload to the Apple store connect.
How do I, a paid up developer, submit a swift playgrounds app to the App Store?.
While demonstrating Swift Playground to my students, I noticed that, unlike Xcode, it doesn’t seem possible to predefine or insert custom code snippets. In Xcode, we can easily create and reuse our own code snippets to improve teaching and development efficiency, but I couldn’t find a similar feature in Swift Playground.
Is there currently a way to predefine or insert custom code snippets in Swift Playground? Are there any recommended workarounds, or plans to support this feature in the future? Any suggestions or insights would be greatly appreciated.
I clicked the “Get” button in the Swift tutorial, and it started displaying a circular progress bar. However, when the progress bar was full, it did not show that I could use this tutorial, but still display “Get”.
Device: iPad (7th)
System: iPadOS 18.3.2
App Version: 4.6.4
In swift playgrounds on my Mac I keep getting this message, “Keep Going with Apps” would like to access data from other apps. I click allow but it the message keeps popping back up.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
I’m using Swift Playgrounds on macOS 26 to learn app development, starting with the “Get Started with Apps” template. Every time I run the template, macOS shows a popup asking:
“Get Started with Apps” wants to access data from other apps. Allow / Don’t Allow
I’ve already tried:
Granting Playgrounds Full Disk Access in System Settings → Privacy & Security
Checking Automation / App Permissions
Restarting Playgrounds and macOS
…but the popup still appears every run. I’m aware this is related to App Sandbox and privacy restrictions, but I’m looking for a way to:
Suppress this popup entirely while running playgrounds code, or
Run the template in a way that avoids triggering this permission request.
macOS version: 26.1
Playgrounds app version: 4.6.4
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Recently, I have experienced this issue and the alert keep popping on my playground non-stop although I pressed "
allow". I have attached the issue screenshot in this post. Can anyone help me with that.
Hello,
I’m encountering an issue where an alert dialog keeps appearing repeatedly in my swift playground project. I pressed "Allow" button but it keeps appearing again.
Does anyone can help me about it?
Hello,
Is it possible to integrate a database into Swift Playground on iPad? Otherwise, what can be done?
Thank you.
我在使用Swift Playground时一直弹出这个框,好烦!!!!!
可以告诉我怎么设置才能让这个弹出框不出现吗?
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
I used Swift Playground to develop application in Mac OS. Also using ZStack I used limited area in full page (using .frame(width: $, height: $)). However using command + R or clicking start button to see preview .app, while non resizing application my ZStack show as cutted. Please tell me how to set preview .app frame size as width, height... The buttom code is ContentView.swift code.
@main
struct ContentView: App {
init() {
MyFont.registerFonts()
}
// @StateObject private var audioPlayer = AudioPlayer()
var body: some Scene {
WindowGroup {
NavigationStack {
StartMenuView()
.frame(minWidth: 594, maxWidth: 594,
minHeight: 1142, maxHeight: 1142)
.preferredColorScheme(.dark) // Dark Mod
.statusBar(hidden: true) // Hidden Status Bar
.edgesIgnoringSafeArea(.all) // Ignoring Safe Area
}
}
.windowResizability(.contentSize)
}
}
Thank you for reading.


Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift
App Review
Swift Playground
I’m looking to publish an app I’ve written on my iPad (Air, to be exact), but I can’t make a screenshot at the required size (which is Pro). And yes, I don’t have a Mac (yeah, I know).
Is there an easy or simple way to get a screenshot of an app if I don’t have the right hardware? Is this something I could scale/resize from a smaller device? Or, could I just include a portion of the actual screenshot in a picture (with the correct dimension) that has other text/information?
any help would be greatly appreciated
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Experimenting with #Playground macro with Xcode 26 beta 3, out of the box I see a conflict between duplicates in the XcodeDefault Toolchain. Essentially a clean install of macOS Tahoe 26 25A5306g
FB18930059
Was trying to follow the first Foundation Model WWDC video example but distilling it down to the most basic use of the Playground macro produces the same error.
import Playgrounds
#Playground {
}
Any solutions / workarounds? Wasn't sure whether to attempt to delete one of these–but they are internal libraries.
objc[3241]: Class PGLConcurrentMapNode is implemented in both /Applications/Xcode-beta 3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks/PlaygroundLogger.framework/Versions/A/PlaygroundLogger (0x10db98c10) and /Applications/Xcode-beta 3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libLiveExecutionResultsLogger.dylib (0x10db18050). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
error: Couldn't look up symbols:
protocol descriptor for Playgrounds.__PlaygroundsContentRecordContainer```
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Moving the cursor left and right becomes extremely sluggish, though up-down movement and mouse clicks are normal. The Apple Store Genius checked the hardware and even reinstalled the OS, but the issue remains.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Developer Tools
Swift
Swift Playground
Several lessons in Keep Going with Apps cannot be completed even when the code is correct. This blocks progression and greys out the Next button permanently.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Hello! I'm trying to upload images to Swift Playground on XCode, and it's not working. When I created my playground, there is no Resources folder or an assets file. If I simply drag an image file to the sidebar, the image is not showing up when used in the app. This may be a simple fix, but as a beginner, I am struggling to find the solution. Any help would be much appreciated! Thank you!
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift Student Challenge
Swift Playground