Search results for

A Summary of the WWDC25 Group Lab

10,109 results found

Post

Replies

Boosts

Views

Activity

Notification Service Extension and the main thread
Question, if I am writing async code in the notification service extension, I understand it terminates after 30 seconds. If I want to wait until these async methods finish before calling the content handler, I believe an option I have is to use dispatch groups. However I am open to other solutions if there are better options. My question is, if I use dispatch groups, is there any issue in using the main queue here? Or does the main thread not make sense to use in the context of the NSE? dispatch_group_notify(group, dispatch_get_main_queue(), ^{ if (self.contentHandler) { self.contentHandler(self.bestAttemptContent); } }); Or is it recommended to instead use a different queue in the NSE? dispatch_queue_t nseQueue = dispatch_queue_create(com.blah.blah.nse.queue, DISPATCH_QUEUE_SERIAL); dispatch_group_notify(group, dispatch_get_global_queue(QOS_CLASS_(SOMETHING), 0), ^{ ... }); OR am I over thinking this? :) Thanks ahead of time, relatively new to iOS so just looking to learn/
3
0
250
Jun ’25
Reply to Crash in libswiftCore with swift::RefCounts
(For posterity and web searches) One can create a serial queue by using the default initializer for DispatchQueue: private let serialQueue = DispatchQueue(label: some.custom.label) I'm then initializing the Connection Group like: connectionGroup = NWConnectionGroup(with: multicastGroup!, using: params) and finally starting it with: connectionGroup.start(queue: serialQueue) It's that last line that's super important because the default global() queue will give you a concurrent queue rather than a serial one.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’25
Reply to Crash in libswiftCore with swift::RefCounts
Ah yes, great point! I think that's exactly what it was. I had fixed the issue initially by processing in a serial queue, but your comment made me go back and realize the connection group was getting started like this: connectionGroup.start(queue: .global()) Which is, of course, a concurrent queue. With the serial queue in place I was able to flood the device with thousands of UDP messages without issue. Thanks so much!
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’25
Reply to Crash in libswiftCore with swift::RefCounts
I’m glad to hear you’re making progress. [quote='847078022, FT-cfoy, /thread/791083?answerId=847078022#847078022, /profile/FT-cfoy'] The completion handler is spinning up a new thread [/quote] I noticed that the crashing code is being called out of Network framework. One thing to watch out for there is the type of queue that you pass into Network framework when you create your NWConnection [1]. Network framework will accept either a serial queue or a concurrent queue. Internally it does its own serialisation, so it doesn’t care. However, for your own sanity it’s important to use a serial queue. If you use a concurrent queue, it becomes very hard to reason about your code. Similarly, if you have multiple connections running simultaneously, it often makes sense to use the same serial queue for all of them. Oh, and be wary of concurrent queues in general. See Avoid Dispatch Global Concurrent Queues. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.c
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’25
Reply to How to satisfy a custom Authorization Right?
I’m not sure I can properly help you with this, because I’m not confident I understand QA1277, which is problematic because I originally wrote it! Honestly, I’m not sure I fully understood it back then either )-: Regarding your issue, my understanding is that these credentials are generated on successful authentication. However, I’ve never looked into the exact point that generates them, that is, are they generated by the act of successfully gaining a right, or by successfully running a rule, or by the builtin:authenticate method. You can almost certainly work this out by looking at the code for the authorisation engine in Darwin. A good place to start would be here [1]. WARNING You have to be careful when digging into Darwin. It’s full of implementation details, and encoding such implementation details in your product is not the path to long-term binary compatibility. However, in this case I think it’s reasonable. Authorisation plug-in development is already a field full of compatibility pitfalls. If you’re
Topic: Privacy & Security SubTopic: General Tags:
Jul ’25
How to satisfy a custom Authorization Right?
I’m implementing a custom Authorization right with the following rule: <key>authenticate-user</key> <true/> <key>allow-root</key> <true/> <key>class</key> <string>user</string> <key>group</key> <string>admin</string> The currently logged-in user is a standard user, and I’ve created a hidden admin account, e.g. _hiddenadmin, which has UID≠0 but belongs to the admin group. From my Authorization Plug-in, I would like to programmatically satisfy this right using _hiddenadmin’s credentials, even though _hiddenadmin is not the logged-in user. My question: Is there a way to programmatically satisfy an authenticate-user right from an Authorization Plug-in using credentials of another (non-session) user?
5
0
146
Jul ’25
Notarization and Stapling Failing for Signed PKG & DMG with Error 65 Despite Successful Notary Submission
Dear Apple Developer Technical Support, I am encountering an issue with notarizing and stapling both PKG and DMG installers for our Electron-based macOS application COSGrid. Despite receiving successful notarization submission responses via notarytool, the stapling process fails with Error 65. Environment: App Name: COSGrid Bundle Identifier: com.cosgrid.pkg.COSGrid Developer ID Team ID: YB8S2XZ98K macOS Version: macOS [15.1] Xcode Version: [16.0 (16A242d)] Workflow Summary: For PKG: Build via yarn build (Vite + Electron Builder) Package with pkgbuild Sign using productsign Submit for notarization: xcrun notarytool submit COSGridMZA-2.1.10-arm64.pkg --apple-id ... --team-id YB8S2XZ98K --password ... --wait Conducting pre-submission checks for COSGridMZA-2.1.10-arm64.pkg and initiating connection to the Apple notary service... Submission ID received id: a8ff8e09-1ab4-49ed-9f6b-4afb9f09e53a Upload progress: 100.00% (235 MB of 235 MB) Successfully uploaded file id: a8ff8e09-1ab4-49ed-9f6b-4afb9f09e53a p
1
0
100
Jul ’25
WidgetKit keep crashing and widgets not displaying
So I have a MacOS application that was working just fine before Xcode 16. The Widgets are not working anymore. The main application and the widgets share a file in a common App Group. The widget app now get a permission error when accessing the file. Also, the Widget Kit simulator keeps crashing. I also try to start a new project in Xcode, add a target with a Widget extension with an App Intent and run it, and it also crashes. Sometimes, it doesn't crash but just display the error: Failed to load widget. The operation couldn't be completed. (WidgetKit_Simulator.WidgetDocument.Error error 2.). Edited to attach WidgetKit error log widgetKitError.txt
8
0
1.6k
Feb ’25
There is a mapping issue between the physical buttons of the Matter switch and the buttons on the Apple Home App.
My device is a Matter switch with 12 buttons, but its physical buttons do not correspond to the button icons displayed in the Apple Home App. The mapping between them is chaotic, for example, physical button 1 is mapped to button icon 3, and physical button 2 is mapped to button icon 7, without any pattern. And every time the factory settings are restored and the network is reconfigured, the mapping will be different from the last time, and restoring the factory settings will change it again. I have checked my program and I am certain that the events triggered by physical buttons correspond correctly to the Matter Generic Switch Endpoint in the ZCL file. I don't understand why there was such a mistake. I am using GSDK 4.4.1, Silicon Labs Matter 2.2.1-1.2. I asked the manufacturer of the chip (the staff of Silicon Labs), and they said that the corresponding order displayed on the app is determined by the APP side, and has nothing to do with Matter devices, is this a problem caused by Apple's
2
0
474
Jan ’25
A Summary of the WWDC25 Group Lab - Developer Tools
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for Developer Tools. Will my project codebase be used for training when I use Xcode's intelligent assistant powered by cloud-based models? When using ChatGPT without logging in, your data will not be used to improve any models. If you log in to a ChatGPT account, this is based on your ChatGPT account settings, which allows you to opt-out (it defaults to on). When using Xcode with accounts for other model providers, you should check with the policies of your provider. And finally, at no point will any portion of your codebase be used to train or improve any Apple models. We'd l
1
0
630
Jul ’25
Reply to Notification Service Extension and the main thread
Thank you for that very insightful response! I appreciate it, and learned a lot. Responding to your question below. Hopefully this will give a bit more context to what I am doing and why. What are you actually waiting on? In general, I've become very nervous anytime I see code that uses dispatch groups because they seem to be used as a slightly awkward band-aid trying to make something work that doesn't really want to work. Case in point here, the main reason an NSE would be waiting is network activity, in which case the simpler solution would be to simply set the right timeout on that network activity. For example, let's say 3 async things are happening: Call a reporting API Call a service metric API Download an attachment I don't want to call contentHandler until I have given them all adequate time to complete. My understanding is once contentHandler is called, the system will kill the NSE process. Alternatively I could not call the contentHandler, and let the full ~25-30 seconds run and let the sy
Jul ’25
Unable to apply tinted glass effect to toolbar buttons in iOS 26
I'm trying to apply a tinted glass effect to toolbar buttons in iOS 26, similar to what was shown in the WWDC25 videos, but none of the approaches I've tried produce the translucent tinted glass effect. My code structure: .toolbar { ToolbarItem(placement: .navigationBarTrailing) { TrailingToolbarContent( selectedTab: $selectedTab, showingAddBeneficiary: $showingAddBeneficiary ) } } private struct TrailingToolbarContent: View { @Binding var selectedTab: Int @Binding var showingAddBeneficiary: Bool @EnvironmentObject private var settingsViewModel: SettingsViewModel var body: some View { switch selectedTab { case 1: if #available(iOS 26.0, *) { Button(action: { showingAddBeneficiary = true }) { Image(systemName: plus) } // What I've tried: // .tint(Color(accentPrimary)) // Only changes icon color // .glassEffect(.regular.tint(Color(accentPrimary))) // No effect // .buttonStyle(.glass).tint(Color(accentPrimary)) // No tint, but orange background // .buttonStyle(.borderedProminent).tint(Color(accentPrimar
Topic: UI Frameworks SubTopic: SwiftUI
1
0
169
Jul ’25
Map Switcher MapKit iOS 14 and up
Hello everyone, I have just started coding using swift and I´m currently building an app that ist using MapKit. It is required to run on iOS 14 and newer and I want to add a Map switcher to switch between the Map Views Standard, Satellite, Hybrid and eventually also OSM. However this apparently is not as straight forward as it seems and I just don't get it to work. I had multiple attempts such as these two, each interface with a separate MapSwitcherView that open on the press of a button: var body: some View { ZStack(alignment: .bottomTrailing) { Group { if selectedMapStyle == .openStreetMap { openStreetMapView() } else { MapContainer(region: $locationManager.region, tracking: $tracking, style: selectedMapStyle) } } .id(selectedMapStyle) .onChange(of: selectedMapStyle) { newStyle in print(Style changed to: (newStyle)) } and Group { switch selectedMapStyle { case .standard: Map(coordinateRegion: $locationManager.region, interactionModes: .all, showsUserLocation: true, userTrackingMode: $track
4
0
115
Jun ’25
RealityKit Trace Metric Max/Range for VisionOS app
Hi Nathaniel, I spoke with you yesterday in the WWDC lab. Thanks for chatting with me! Is it possible to get a link to a doc that has some key metrics I'd find in a RealityKit trace so I know if that metric is exceeding limits and probably causing a problem? Right now, I just see numbers and have no idea if a metric is high or low :). This is specifically for a VisionOS app. Thanks, Bob
3
0
102
Jun ’25