I'm trying to add Assets.xcassets to a .swiftpm project, but I'm getting the warning:
⚠️ Ignoring duplicate build file in build source build phase
(Just to know, that is about developing in XCODE, in Swift Playgrounds does not appear it, even in this second being harder to setting up)
The problem is that there are no “Build Phases” in XCODE to remove duplicate files manually.
I've already tried adding the path of Assets.xcassets in the resources property of Package.swift, like:
.executableTarget(
name: "AppModule",
path: ".",
resources: [
.process("Assets.xcassets")
]
)
Even so, the warning persists. Does anyone know how to solve this? Is there any way to remove duplicate references or force a cleanup of the Swift Package Manager cache to fix it?
I appreciate any tips! 🙏🚀
Swift Playground
RSS for tagLearn and explore coding in Swift through interactive learning experiences on the Swift Playground app for iPadOS and macOS.
Post
Replies
Boosts
Views
Activity
With iOS 18.3.1 in Playground there is a different view in TabView: in Preview the systemImage are visible and the TabView is visible under, instead launching the app the systemImage it is no longer visible. How can I solve it? Thank you
I’ve encountered a bug in Swift Playgrounds within “Learn to Code 2”, specifically in the “Variables: Seeking Seven Gems” section. No matter what I do—or even if I do nothing at all—an error always occurs.
I’ve tested this on both an iPad (9th generation) and an iPad Pro 11-inch (4th generation), and the issue happens on both devices.
Has anyone else experienced this? Any ideas on how to fix or work around it?
Thanks!
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.


Hello folks,
I'd like to report a bug in Swift Playground to Apple official dev team, it's in "Learn to Code 2" - "Seeking Seven Gems".
The puzzle map can't be loaded, please check the following screenshot,
My system environment:
MacOS 15.3
Swift 6.0.3 (swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1))
Swift Playground 4.6.2
Xcode 16.2
Hardware: MacBook Pro/M2 Pro/32G
Hello! I have asked this question in previous years, but I want to make sure I can be safe as each challenge could be different.
Are applicants for the Swift Student Challenge allowed to use the features and technologies involved with Metal/MetalKit? Last year, the answer was yes. I have seen a few people here and there use it with Swift and won.
I would like to know if we can use it for the 2025 challenge for this year as well.
Thanks! :)
Fatal Error in Swift Playground
Description
I'm experiencing a catastrophic error when importing Package Dependency in any Swift Playgrounds that has icon or name that caused the whole Playground won't work anymore with error messages below.
I'm current running macOS Sequoia 15.3 (24D60) and Swift Playgrounds 4.6.1. They're all up-to-date.
Reproduction
Open Swift Playgrounds and and create a new project.
Import a package dependency
https://github.com/simibac/ConfettiSwiftUI.git
Rename the project and add an icon
Then you should able the reproduce the problem. I strongly believed that this is a serious bug.
You'll find that Assets in the left column are disappeared and appeared Assets.xcassets, you're unable to reveal the Dependency in the column like the reference picture above. The whole Playground is destroyed now and unable to work anymore.
I'm unable to rename my Swift Playground or add/change the app icon when I imported a package dependency after upgraded my Swift Playgrounds App to the newest version. Every time I tried to do that, the whole project will be destroyed and showed error message below.
I wonder if anyone have same experience with me or someone can tell me the solution, it terrifies me and I'm worried that I'll be unable to submit my project on time because of that.
I have created a model folder and some swift files that are contained inside the folder. I change the file names to reflect structure or content and when I close the project and reopen it the file names revert to "New File"
I am using Swift Playgrounds on Mac. Not Xcode Playgrounds
Hi, I encountered an issue after the latest update on Swift Playground.
I’m using the iPad Pro 3rd Gen, first time reporting a bug hopefully I’m on the right platform.
When I create a new Swift file or folder, it’ll auto revert the file/folder name to the default naming upon creation.
Tested this one on a few existing projects, it’s the same for all of them.
Initially when I created a new project to verify, those files/folders can be renamed without the issue of reverting.
But after testing it again, seems like the same issue is happening to it as well.
I‘ve tried restarting my iPad but the problem persists.
So I thought to report it and from my search seems like this is the platform for it? Thanks.
My M2 Pro Mac mini with OSX 14.7 just updated to Swift Playgrounds 4.6.1. Now the :Learn to Code & Build Apps screen is limited in size and can't be zoomed. There is no way to scroll horizontally and I can't view the whole screen.
Hey, meanwhile it's a great thing to program apps on the iPad and to be able to load them into the App Store Connect and the App Store.
What about localization in the meantime? When I open the folder en.lproj in sample apps from XCode, then there are two files stored in it:
Glossary.plist (XML) and
Localizable.strings (binary)
Is it correct that XCode creates binary files from the strings? Otherwise, Swift Playgrounds already offers localization in the localized learning content, but i guess the binary files can only be created in XCode?
I use Swift Playgrounds on iPad to run an intro to programming class with high school students. I've created some custom playground books based on Apple's guides to provide some simple sandboxes to learn basic coding.
Students simply click a button on my website, which downloads my playground books so students can easily create new sandboxes.
With Swift Playgrounds 4.6.1 on both Mac and iPad, clicking the link only opens Swift Playgrounds and does not download my playground books! There used to be an "Add a Subscription URL" button, but it is no longer present on the Learn to Code page or anywhere else in the app that I can find:
Is it intentional that this functionality is removed? Playground Books still appear to work, and documentation for subscription feeds is still available.
I start another session with my students next Monday, so I need to know as soon as possible whether I need to plan to work around this myself.
Thanks,
Mark Schmidt
Thanks for the upgrade, the new project selection screen is nice and I’m happy that the SDK has been updated. But I notices some issues
Since update to 4.6
In an app project, if one of the file contains an error and I select another file. The error is not reported and the upper icon shows a checked mark as if the project contains no compilation errors.
Also, if I’m on the file that contains the error the upper icon turn in red (that is ok) but if I press the icon then the error message, the editor does not jump to the error
It was working fine on the previous version
(I use it on a iPad pro (A12Z) with the latest iPad OS version)
Just downloaded the latest Swift Playground for Mac (4.6). The Welcome window does not let you scroll horizontally via mouse, trackpad, or other means, so you can only see the first two Learn to Code resources - similar for the App Gallery and Extend Your App sections.
How do you save data from a Swift Playgrounds App on the Mac? I get an error 'playgroundSharedDataDirectory is not supported in Swift Playgrounds'
I think it's doable, some of the Swift Playgrounds tutorials remember the pages I've completed.
This is with Playgrounds 4.5.1 on a Mac mini M2 Pro running OSX 14.7 (Sonoma)
Ideally, I'd like to save multiple 'documents' and allow the user to select which one they want to work with. The documents don't need to be visible to other Apps.
Thanks in advance
I updated my iPad to iOS 18, but when I went into Swift Playgrounds it only had the iOS 17 SDK.
Maybe it has to with the fact that I’m on an iPad 9th Gen and it doesn’t have the Apple intelligence features so it can’t run the AI features.
I’m just wondering if I will be getting the new SwiftUI features such as the new TabBar or MeshGradients.
I updated my iPad to iOS 18, but when I went into Swift Playgrounds it only had the iOS 17 SDK.
Maybe it has to with the fact that I’m on an iPad 9th Gen and it doesn’t have the Apple intelligence features so it can’t run the AI features.
I’m just wondering if I will be getting the new SwiftUI features such as the new [TabBar](https://developer.apple.com/videos/play/wwdc2024/10147/) or [MeshGradients.](https://developer.apple.com/videos/play/wwdc2024/10151/?time=381)
Hello! I have a quick question about locking orientation and disabling Multitasking/Slide Over in a .swiftpm for the Swift Student Challenge.
A .swiftpm file contains a Package.swift file. At the top of this file, there is a very scary warning that directs you to not edit it. However, being unable to edit this means that I cannot lock the orientation of an iPad and disable Multitasking/Slide Over.
I have read that it does not break your project if you ignore the warning and I tried it out for myself — editing the file does indeed lock orientation and disable Multitasking/Slide Over! Although, as you can imagine, this is quite nerve-wracking.
What are the actual technical implications of doing this? Are participants allowed to do this?
If this does not seem like a good idea, would judges follow through with a note that tells them to simply not use certain orientations and Multitasking/Slide Over? (Yeah, I know… not an ideal thing but if there’s anyone to understand it would be Apple employees).
I am faced with two uncertain options: ignore a warning and get what I need or follow the warning but then have a very poorly designed experience (some apps just aren’t meant for portrait and Multitasking/Slide Over, even if this is not a full app).
I definitely don’t want hundreds of hours of work to go down the drain or risk rejection because of some type of problem with this, that’s for sure. Perhaps a “hack” would work if I were creating an actual app, but the stakes become higher when it is for this challenge.
Thanks! :)
Hello! I would like to use Speech Framework on my App Playground for this year challenge. But I still can't understand if I am allowed to use it to respect the rule of "not rely on a network connection". That's why:
Speech framework can use on-device Speech recognition –
No internet connection needed ✅.
But it can ask to download an Apple's native language package to use it for this on-device recognition – To get this, you need to be connected to the Internet ❌.
When I try to add a Speech Recognition Capabilities on my App Playground, its' description says: "Required to perform speech recognition using Apple's servers." (screenshot is attached). Does it mean that I won't be able to use on-device recognition on my App Playground? – And therefore, only online-version of this framework is available and I can't use it to participate on the challenge successfully❓.
If it's possible, could you please make it clearer? This framework is crucial for my App Playground and I really need this to make it work.
Thanks for your help in advance! And a have a good day!