Search results for

Swift 6

49,197 results found

Post

Replies

Boosts

Views

Activity

Reply to iOS folder bookmarks
I figured out some further details: When I get a file or folder URL from the picker, I need to call startAccessingSecurityScopedResource on it first prior to converting it to a bookmark. If I don't do that and try to convert that URL to a bookmark, I am seeing this error in the console: [ERROR] getattrlist(/7{34}3/D{7}s/2{8}2/N{2}1/0{8}7/1{6}3/2{69}0.png) = 1 However, the call to make a bookmark: url!.bookmarkData(options: [], includingResourceValuesForKeys: nil, relativeTo: nil) doesn't return an error. Basically, yes, that all makes sense in terms of what's happening in the lower-level system. The situation isn't something I can easily describe, but the practical description is that the way the iOS's different file access control systems overlap means that your code can end up working that really shouldn't work. A few quick suggestions here: If it's feasible, I'd recommend testing your code as a native macOS app (not the simulator or in compatibility mode). macOS is better at enforcing the right be
Topic: App & System Services SubTopic: Core OS Tags:
2w
Unity GameKit plugin beta GameKit Activity UnsupportedOperationForOSVersion
I’m running into unexpected problems with the Unity GameKit plugin setup with the new Activities. I didn’t see anyone else mentioning these issues, so my guess is that it’s a problem with my setup. The authentication (GKLocalPlayer.Authenticate()) works as expected, but any call to the new GameActivity functionality (e.g. GKGameActivityDefinition.LoadGameActivityDefinitions() or GKGameActivity.WantsToPlay) gives me an exception with a 'UnsupportedOperationForOSVersion' reason despite it running on an iOS 18.6.1 device. I’m using a completely empty Unity 2022.3.62f1 project that only contains the official authentication example, followed by an event handler for activities from another example and the Unity core and gamekit plugins. The setup: macOS 15.6 Xcode 26 beta 6 (also tried with 5) Physical iPhone device running iOS 18.6.1 Unity 2022.3.62f1, which satisfies the requirements Unity plugin, Xcode setup, and build steps: I Followed the official beta branch build steps for Unity plugins with python3
2
0
411
2w
Reply to Where's the replacement for Quartz Debug?
Hello, Quartz Debug is available as an additional tools package for Xcode. For example, Additional Tools for Xcode 26 beta 6 contains: This package includes audio, graphics, hardware I/O, and other auxiliary tools. These tools include AU Lab, OpenGL Driver Monitor, OpenGL Profiler, Pixie, Quartz Debug, CarPlay Simulator, HomeKit Accessory Simulator, IO Registry Explorer, Network Link Conditioner, PacketLogger, Printer Simulator, 64BitConversion, Clipboard Viewer, Crash Reporter Prefs, Dictionary Development Kit, Help Indexer, and Modem Scripts.
2w
Invalid large app icon with Xcode 26 beta 6
I’m having a bit of trouble uploading my new icon to the App Store Connect. I created it entirely with Icon Composer, but it keeps throwing an error saying it’s an “Invalid large app icon.” The error message says that the large app icon in the asset catalog can’t be transparent or have an alpha channel. I only have one AppIcon in the asset catalog, and I’ve checked the “single size” option, which is set to 1024x1024 for any, dark, or tinted size. In the past, when I used the previous icon with the iOS 18 SDK, I didn’t have any issues uploading it. However, when I created the new icon with Icon Composer and compiled it with Xcode Beta, it broke. I’m a bit confused because the error message suggests that removing transparency is the solution, but the whole point of Icon Composer is to make the icon transparent for the new liquid glass design. I don’t want to remove the cool look that my new transparent icon has. Could you please help me out? I’d really appreciate it. Thanks a bunch!
2
0
122
2w
Xcode 26 beta 5 xcodebuild crash
Good day! When your project have total 887 or more SPM local targets and then you try to build it, xcodebuild will be crash. Crash log: SWBBuildService-2025-08-11-151103.ips Thread 2 Crashed:: Dispatch queue: com.apple.root.default-qos.cooperative 0 libxpc.dylib 0x197c4826c _availability_version_check + 8 1 libswiftCore.dylib 0x1a9b44428 __isPlatformVersionAtLeast + 92 2 libswiftCore.dylib 0x1a9a6e054 _swift_allocObject_ + 1100 3 SWBMacro 0x104a9c408 specialized _ArrayBuffer._consumeAndCreateNew(bufferIsUnique:minimumCapacity:growForAppend:) + 116 4 SWBMacro 0x104a97b58 specialized Array.append(contentsOf:) + 116 5 SWBMacro 0x104a954e8 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 160 6 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352 7 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352 8 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext
4
0
168
2w
The App's expiry date earlier than the expiry date of Provisioning Profile
We have created provisioning profile from apple developer account for our iPadOS app, the expiry date shown in the profile is 20-Aug-2026. However, when when I build the app with this provisional profile the expiry date shown in the app is 6-May-2026. My Certification expires on 2027. I see a embeded.mobileprovision profile inside the app, and it has an expiry of 6-May-2026. I did a clean build, cleared unnecessary profiles from profile folder, created a new provisional profile and tried, but nothing seems help. We have a few apps, and no other app has this issue, only those two apps have this issue. As the expiry date the shorten, we also need to special handle these two apps, Will you please help me to resolve this issue? Thanks.
3
0
627
2w
Reply to Xcode won't execute code?
Thank you for your help! I put this code above the code already mentioned. inline-code struct ContentView: View { var body: some View { Button(Tap Me) { // Action to perform when the button is tapped print(Button was tapped!) startAccelerometer() } } func myFunction() { // Your Swift code to be executed print(myFunction was called!) } } `inline-code` I get an error message saying: Cannot find 'startAccelerometer' in scope
2w
Reply to Icon Composer: Any way to add icons to the app bundle for older macOS versions?
Well, I don't know what I'm doing wrong. I'm using Xcode 26 Beta 6 on a macOS 26 Beta 6 VM, with macOS 15.6.1 as the host. I can build the TahoeIconsTest project, pointed to by @superpixel, and it works just as expected, the LG icon is used on macOS 26 and the old icon is used on 15.6.1. I do note that the .icns and .icon files are not in the app bundle , but there is a .car file. The Info.plist only has CFBundleIconName set (to AppIcon). However, I'm just not able to replicate this outcome with my own app. I added the secret flag and all the other asset compiler options are the same as the test project. But my build has all three files, .icns, .icon, and .car in the bundle, and my Info.plist file has both CFBundleIcon* parameters set to AppIcon. The result is both OSs use the old icon. I just can't see what's different.
2w
Reply to iOS folder bookmarks
I figured out some further details: when I get a file or folder URL from the picker I need to call startAccessingSecurityScopedResource on it first prior to converting it to bookmark. If I don't do that and try to convert that URL to bookmark I am seeing this error in the console: [ERROR] getattrlist(/7{34}3/D{7}s/2{8}2/N{2}1/0{8}7/1{6}3/2{69}0.png) = 1 however the call to make bookmark: url!.bookmarkData(options: [], includingResourceValuesForKeys: nil, relativeTo: nil) doesn't return an error. For a folder URL it's even less visible: no error from the call (same as for file URL) but also nothing in the console as a hint. Later on (perhaps on a different lunch) when I read a bookmark (file or folder) I don't need to call startAccessingSecurityScopedResource on it (not sure if that's intentional behaviour or not).
Topic: App & System Services SubTopic: Core OS Tags:
2w
iOS 26, bottom UIToolbar not extending behind safe area to screen edge
An app with a UIToolbar pinned to the bottom of a view controllers view extends to the screen edge (behind the safe area) when run on iOS 18.X but not iOS 26. This UIToolbar is set as constrained to the safeAreaLayoutGuide with the following constraints. self.view.addConstraints([ bottomToolbar.leadingAnchor.constraint(equalTo: self.view.leadingAnchor), bottomToolbar.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), bottomToolbar.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor), bottomToolbar.heightAnchor.constraint(greaterThanOrEqualToConstant: 44.0) ]) This is especially noticeable when the UIToolbar background color differs from the view background color. This occurs on iOS 26 beta 6, app built with Xcode 26 beta 5. I've posted a Feedback FB19664903 including a minimal Xcode workspace that reproduces this issue. Anyone suggestions would be appreciated ... this definitely seems like a regression.
3
0
186
2w
Xcode 26: Sendable checking + NSManagedObjectContext.perform in Swift 6
I have some code which handles doing some computation on a background thread before updating Core Data NSManagedObjects by using the NSManagedObjectContext.perform functions. This code is covered in Sendable warnings in Xcode 26 (beta 6) because my NSManagedObject subclasses (autogenerated) are non-Sendable and NSManagedObjectContext.perform function takes a Sendable closure. But I can't really figure out what I should be doing. I realize this pattern is non-ideal for Swift concurrency, but it's what Core Data demands AFAIK. How do I deal with this? let moc = object.managedObjectContext! try await moc.perform { object.completed = true // Capture of 'object' with non-Sendable type 'MySpecialObject' in a '@Sendable' closure try moc.save() } Thanks in advance for your help!
1
0
102
2w
Reply to Icon Composer: Any way to add icons to the app bundle for older macOS versions?
Amazing! Thanks @superpixel! Adding the secret undocumented --enable-icon-stack-fallback-generation=disabled to the ASSETCATALOG_OTHER_FLAGS build setting does work on Xcode 26 beta 6. What I do is enable this, disable Include all app icon assets and copy a separately compiled AppIcon.incs (with the legacy icons) to the Resources folder while making sure the CFBundleIconFile is in the Info.plist pointing to this file - this results in the correct icon showing up on older macOS versions, while Tahoe uses the Icon Composer variant. This should work on macOS (not sure if works for App Store, but my app is not an App Store app, so it does not matter). An other way is to have Include all app icon assets which generates the proper variants in Assets.car, but it bloats the bundle size somewhat (especially as I have some assets that depend on build configuration and this option makes all those into the bundle) - this might be the proper way though. Hope Apple fixes this properly though or add least adds a pr
2w
Reply to Managing the order of Transparent Proxies from MDM Profile
[quote='854958022, KrishnaveniNalka, /thread/796810?answerId=854958022#854958022, /profile/KrishnaveniNalka'] If I install the Transparent Proxy or VPN payload MDM profile first [/quote] OK, but why are you doing things in that order? If I were investigating this issue, I’d do the following: Create a trivial container app A with a dummy transparent proxy PA. Set the handle-new-flow method to log the flow details and return false. Clone the app to form container app B with dummy transparent proxy PB. Install both on the Mac. Activate both of their system extensions, but don’t install any network configurations. Push an MDM proxy with a configuration for PA and PB, and the Order property set on both. Do some networking. Remove that configuration. Repeat step 6 with the Order property reversed. Do some more networking. The log entries from steps 7 and 10 will tell you whether the Order property is doing its job. This will either work on not. If it doesn’t work then you’ve clearly isolated the problem an
2w
Reply to SwiftData Fatal error: Editors must register their identifiers before invoking operations on this store
@DTS Engineer thank you for these suggestions. I've added the full crash report from Crashlytics to this post. After enabling the launch argument you suggested, I managed to reproduce the crash in the debugger once, so that's some progress. After enabling Swift 6 and complete concurrency checking, I got some build errors in the class owning the ModelActor. Wherever I accessed the ModelActor, I got this error: Sending 'self.localStorage.some' risks causing data races. As mentioned in my original post, the ModelActor conforms to a protocol because I am using another type of storage in iOS 16 which doesn't support SwiftData. This protocol didn't require that conforming types were Actors, leading me to suspect that the class owning the ModelActor didn't treat it as an actor, because it only know about the protocol. Adding the Actor requirement to the protocol, removed the build errors in the owning class. Now, I have to ship this change to confirm that it actually fixes it, since I cannot reliably reprod
2w