var allLeaderboards = await GKLeaderboard.LoadLeaderboards(); Log(allLeaderboards.Count); // returns 0 What am I missing?? What doesn’t work: await GKGameActivityDefinition.LoadGameActivityDefinitions() → count = 0 await GKLeaderboard.LoadLeaderboards() (no args) → 0 leaderboards await GKLeaderboard.LoadLeaderboards(MY ID) → returns 0 GkGameActivity.SetScoreOnLeaderboard(Leaderboard, score, context); returns an error since my Leaderboard is null. Activities and leaderboards are defined in GameCenterResources.gamekit in Xcode. Achievements that I add locally in the .gamekit file do not appear at runtime either; only ASC live ones show. ** What works:** xcode- debug- Gamekit- Manage Game progress- I can submit new scores with the plus button and see the notification on my device. await GKLocalPlayer.Authenticate() succeeds. await GKAchievement.LoadAchievements() returns the list of achievements configured in App Store Connect- but not any new local achievements created in Xcode in GameCenterResources.gamekit En
Search results for
Swift 6
49,192 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
hi Claude, thank you for the reply. are you using Swift UI? I am not so I'm wondering if this is the difference. It looks like you are doing this in the UI Preview...
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Thank you for supporting me. My environment Device: iPhone 15 Pro OS: iOS 26.0 Public Beta (23A5336a) In iOS 26, three types of tabs were added to Safari. Depending on the option, the behavior of the fixed header and footer can be unstable. *Tab settings can be changed in the iOS Settings app under Apps -> Safari > Tabs. The following behavior differs depending on the tab. Compact When scrolling down, the header and footer shift up by a few pixels. A margin is created between the footer and the URL input field. Bottom Behaves the same as Compact. Top The header is completely hidden below the URL input field at the top of the screen, leaving a margin below the footer. Below is the sample code to check the operation. 固定ヘッダー/フッター + モーダル デモページ モーダルを開く スクロール用の適当なコンテンツ1 ヘッダーとフッターは常に表示されます。モーダルボタンを押すと、画面いっぱいのダイアログが開きます。 カード1適当なテキスト。適当なテキスト。適当なテキスト。 カード2適当なテキスト。適当なテキスト。適当なテキスト。 カード3適当なテキスト。適当なテキスト。適当なテキスト。 カード4適当なテキスト。適当なテキスト。適当なテキスト。 カード5適当なテキスト。適当なテキスト。適当なテキスト。 カード6適当なテキスト。適当なテキスト。適当なテ
[quote='856395022, erdeszbalazs, /thread/798938?answerId=856395022#856395022, /profile/erdeszbalazs'] How can one XPCSession transfer let's say two distinct types of Codable messages? [/quote] Again, I don’t have a lot of concrete experience with the low-level Swift API, but my natural inclination here is to use an enum as your Codable message, with a case for each message type and an associated value with the payload for that message type. So, something like this: enum WaffleRequest: Codable { case cook(Cook) case varnish(Varnish) struct Cook: Codable { var minutes: Int } struct Varnish: Codable { var finish: Finish } enum Finish: Codable { case matt case gloss } } Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
App & System Services
SubTopic:
General
Tags:
Testing Environment: iOS Version: 26.0 Beta 7 Xcode Version: 17.0 Beta 6 Device: iPhone 16 Pro Description: We are implementing the new BGContinuedProcessingTask API and are using the wildcard identifier notation as described in the official documentation. Our Info.plist is correctly configured with a permitted identifier pattern, such as com.our-bundle.export.*. We then register a single launch handler for this exact wildcard pattern. We are performing this registration within a UIViewController, which is a supported pattern as BGContinuedProcessingTask is explicitly exempt from the register before applicationDidFinishLaunching requirement, according to the BGTaskScheduler.h header file. The register method correctly returns true, indicating the registration was successful. However, when we then try to submit a task with a unique identifier that matches this pattern (e.g., com.our-bundle.export.UUID), the BGTaskScheduler.shared.submit() call throws an NSInternalInconsistencyException and terminates
I had exactly the same issue with iOS 26 Beta 5 but it seems to be resolved in Beta 6.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
Hello @giovanniR2U , thank you for your question! Swift uses automatic reference counting (ARC), which means memory is automatically cleaned up for any object that is no longer referenced. Often, this is as simple as removing a root entity from the scene (thereby removing each of its descendants) or dismissing the ImmersiveScene entirely. Going through each entity in the scene and calling removeFromParent() for every entity and setting texture references to nil should not be necessary. The important thing is to verify there are no more references in memory, so make sure you don't have any variables lying around that might still be pointing to the objects you want to unload. When you load your textures sequentially, are you keeping a reference to these textures in the system that loads them? This would prevent ARC from unloading those textures. You mention your app goes from 30 MB to 3.3 GB after loading just the textures, and then only goes to 2.6 GB after dismissing the experience. This to me sugges
Topic:
Spatial Computing
SubTopic:
General
Tags:
My Xcode crashed over and over again while I searing spefic file like TingMusic. I have tried uninstall and install Xcode from 16.0 to 16.4, clear derived data folder, reboot my Mac, but none of these working. 😭 Translated Report (Full Report Below) Process: Xcode [1811] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 16.4 (23792) Build Info: IDEApplication-23792000000000000~2 (16F6) App Item ID: 497799835 App External ID: 874973124 Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2025-09-02 10:51:26.8582 +0800 OS Version: macOS 15.6 (24G84) Report Version: 12 Anonymous UUID: 9835064A-AD7C-EE47-64DE-49587A7EC956 Time Awake Since Boot: 320 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [1811]
Good morning, I have been playing with he new Networking framework released in beta, and i think its amazing how powerful and simple it is. However i have been tackling some issues with it, it seems that the NetworkListener does not allow us to configure a specific endpoint for any of the protocols, UDP, TCP (QUIC, TLS) Is this intended or just not missing features as of the Beta ? I figured out how to use bonjour to get a port (as i am brand new to using Networking on macOS and Swift) I get that the use of this is mainly as a client to connect to servers, but it would make more sense to have a high level abstraction of what already exist, wouldn't it be more intuitive to configure a NetworkEndpoint that contains either a Bonjour Service or an endpoint with configured port that we can then configure on the Listener, instead of doing .service(...) ?
Thanks for your detailed responses. I took what you said in the first response and built a simple generic queue which integrates with BGContinuedProcessingTask. I'm attaching the code in case it helps others and because it illustrates some of my lingering questions/suggestions/difficulties. I'm building it with: Swift version 6 Nonisolated(nonsending) by default Approachable concurrency/default MainActor disabled (new projects seem to have this enabled by default) (this list not in order of importance) Queues themselves get leaked. The registerWithScheduler method illustrates what I mean by this - the closure must retain self (the queue). It's not a dealbreaker because I imagine queues will not hold on to that many resources, just descriptions of jobs to run, but it's not ideal. Ideally, the BGTask title/subtitle APIs would accept a LocalizedStringResource so localised strings can be submitted cross-process. It may be interesting to elevate the priority of the queue-draining Task if running
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
I have implemented fetching Apple Music preview songs using a Swift framework integrated into a Unity app. My requirement is to fetch full tracks from a user’s Apple Music library and play them inside Unity. To do this, I understand that I need to handle authentication, generate a Developer Token, and then obtain a Music User Token to access the user’s Apple Music content. Currently, I have an Individual Apple Developer account (not Organization). Based on my research, it seems that: With an Individual account, I can implement this functionality and even upload builds to TestFlight for internal testing. However, when releasing the app publicly on the App Store, full-track playback may be restricted for Individual accounts and allowed only for Organization accounts. 👉 Can you confirm if this understanding is correct? 👉 Specifically, is it possible for an Individual account to fetch and play full-length tracks from a subscribed Apple Music user’s library (at least for internal/TestFlight testing)?
Topic:
Media Technologies
SubTopic:
General
I have been using tvOS 18 and Xcode 26 all summer without issue but since updating the tv to the latest tvOS 26 beta I am now unable to attach to debug builds. When using the Run button in Xcode the build completes, the tv screen goes black and then I see a warning in Xcode: Launching App Name is taking longer than expected. Do you want to continue to wait? LLDB is likely reading from device memory to resolve symbols. If I continue to wait after around 5 mins, in the Xcode console, I see: warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance. But the process on the tv hangs indefinately. Hitting stop in Xcode disconnects the debugger but the app then finishes launching successfully on the TV. Trying to use Debug > Attach to process > [App Name] once it is running also just hangs the app and waits until stopped. When stopping the hung debugger I see an Xcode error with the
Yes! If you Quick Look that in the Finder, you’ll get a human readable version of it. My comments below are based on that. The presence of the Last Exception Backtrace section indicates that your app crashed due to an unhandled language exception. Looking at the associated backtrace I see this: Last Exception Backtrace: 0 CoreFoundation … __exceptionPreprocess + 164 1 libobjc.A.dylib … objc_exception_throw + 88 2 CoreFoundation … +[NSObject(NSObject) _copyDescription] + 0 3 CoreFoundation … ___forwarding___ + 1492 4 CoreFoundation … _CF_forwarding_prep_0 + 96 5 UnityFramework … 0x10b164000 + 26948776 6 UnityFramework … 0x10b164000 + 26953748 7 UnityFramework … 0x10b164000 + 26918904 8 UnityFramework … 0x10b164000 + 26917296 9 UnityFramework … 0x10b164000 + 26902496 10 UnityFramework … 0x10b164000 + 27452572 11 libdispatch.dylib … _dispatch_call_block_and_release + 32 Frame 11 is Dispatch calling a block on a queue. Frames 10 through 5 are your third-party runtime. Frames 4 through 0 are a telltale pa
Topic:
App & System Services
SubTopic:
Core OS
Tags:
Is there a way to access an Icon Composer .icon file in Swift or Objective-C? Any way to get this in an NSImage object that I can display in an image view? Thanks.
This came up on Swift Forums and I wanted to drop some links here, just for the record: How to prevent crash due to Swift Runtime initializing os_log on macOS? is the Swift Forums thread itself. A fork() in the road [1] is a research paper that offers valuable insight into the overall issue. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] https://www.microsoft.com/en-us/research/wp-content/uploads/2019/04/fork-hotos19.pdf
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: