Search results for

Swift 6

49,195 results found

Post

Replies

Boosts

Views

Activity

Reply to SwiftData Inheritance Query Specialized Model
Hi Ziqiao, I've tried with iOS 26 Beta 7 and since Beta 8 (landed tonight) on device (because my Xcode is stuck on iOS Beta 6, don't know why) and the problem is solved. I can now query CollectionItem with predicate that contains inherited properties. Now I have only got problems with accesses to the children property in List. When i got the following hierarchy and the SwiftUI view List access to the Item.children property I got another kind of crash. Category: Work (parent: none) Category: Tech (parent: Work) Thread 1: Fatal error: Never access a full future backing data - PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(backing: SwiftData.PersistentIdentifier.PersistentIdentifierBacking.managedObjectID(0x9872c0007ba42159 ))) with Optional(7639D151-5D48-46AC-AB2A-7F0F50919AC5) But I guess it's a different kind of problem now.
2w
Xcode 26 and Plugin Support: Any Updates?
I’m new to iOS development. Previously, I’ve worked with Python and Django, mainly using JetBrains PyCharm PRO. In PyCharm, I really benefit from plugins like Rainbow Brackets , which help a lot with readability and code navigation. As someone who wears glasses, I find such visual aids very helpful for reducing eye strain. While exploring Xcode, I noticed that similar built-in features or up-to-date plugin support seem limited. Considering Apple’s strong focus on accessibility and user experience, I was a bit surprised by this. With Xcode 26 coming soon, I’m also wondering if there will be improvements in plugin support or built-in tools like Swift Linter and Swift Format. Are there any current tools or plugins you’d recommend to fill these gaps?
2
0
81
2w
How to install newer beta 26 SDKs into older Xcode 26 Betas?
Hello, It seems Xcode 26 beta is lagging the OS releases, which is fine. However, how does one install a Beta N + 1 or N + 2 SDK into the older Xcode beta? I'd like to use iOS 26 Beta 8 from the Xcode 26 Beta 6 install I have. I have tried Settings/Components and Devices & Simulators but nothing Beta 7 nor 8 shows up there. Thanks! -- Greg Bolsinga
2
0
139
2w
Reply to TextKit 2 calls NSTextLayoutFragment's draw method too often
The behavior should be that only the fragments that fall in the view port + estimated overdraw region are re-drawn, and that should be true for all system versions. Thanks for creating the demo project for me. I've tried your project with my Xcode 26 Beta 6 + iOS 26 Beta 7 + iPhone 16 Plus, and don't see that the system re-draws all the paragraph. Here is what I do: a. Use the following print instead to better observe the fragments that are re-drawn: print(draw called in (rangeInElement)) b. Add more paragraphs to textContents so the content is longer. With that, here is what I see: Launch the app. Xcode shows the following log, indicating that only the first fragment is drawn. draw called in 0...1531 (Happens one time) Scroll a bit. Xcode shows the following log, indicating that only the first and second fragments are drawn: draw called in 0...1531 draw called in 1532...3237 ... (Repeats many times.) Scroll down to the bottom, clear the log, and then scroll a bit. Xcode shows the following log, indi
Topic: UI Frameworks SubTopic: UIKit Tags:
2w
How do you observe the count of records in a Swift Data relationship?
What is the correct way to track the number of items in a relationship using SwiftData and SwiftUI? Imagine a macOS application with a sidebar that lists Folders and Tags. An Item can belong to a Folder and have many Tags. In the sidebar, I want to show the name of the Folder or Tag along with the number of Items in it. I feel like I'm missing something obvious within SwiftData to wire this up such that my SwiftUI views correctly updated whenever the underlying modelContext is updated. // The basic schema @Model final class Item { var name = Untitled Item var folder: Folder? = nil var tags: [Tag] = [] } @Model final class Folder { var name = Untitled Folder var items: [Item] = [] } @Model final class Tag { var name = Untitled Tag var items: [Item] = [] } // A SwiftUI view to show a Folder. struct FolderRowView: View { let folder: Folder // Should I use an @Query here?? // @Query var items: [Item] var body: some View { HStack { Text(folder.name) Spacer() Text(folder.items.count.formatted()) } } } The above cod
1
0
111
2w
Swift Package Fails iOS Validation
My app (called MuVis - Music Visualizer) passes the macOS App Store verification, but is failing the iOS verification. The errors indicate a problem with the Swift package github.com/Treata11/CBass. I have been in touch with the CBass package developer (Treata11) as well as the original BASS developers (un4seen.com). We think the problem is related to CBass swift-package config (which apparently works fine for mac, but doesn’t for iOS). The source code for the package is at the site package. All of us think that the package is configured correctly in accordance with the latest Apple package development documentation. Please tell us what is wrong with this package, and how to make it pass the iOS App Store verification. The Xcode error messages from validation testing include several items similar to: Upload Symbols Failed: inline-code The archive did not include a dSYM for the bass.framework with the UUIDs [18D5DBE2-3250-3EDE-B75C-D81B4E9F05AC, A88554A0-9087-3776-AC05-424B2D52F973, DEB682F5-
1
0
97
2w
Reply to XCode reverts CoreData's .xccurrentversion
I did some of investigation of this issue because I ran into the same problem when trying to convert an old project from groups to folders. I discovered what is happening is that Xcode 16 changes the model's current version to the last one alphabetically. I was able to reproduce it this way: Create a brand new, folder-based, Xcode project. Add an xcdatamodeld with one entity. Add a new model version and name it a. Make it current. Quit Xcode. Relaunch Xcode. Expected result: The a model version should still be current. Actual result: The original model version is current. I was able to reproduce with Xcode 16.2 and 16.4. It appears to be fixed in Xcode 26 beta 6. Based on these steps, one workaround appears to be to name the model versions alphabetically. Another workaround is to keep the xcdatamodeld file in a group, not a folder. And of course if you can switch to Xcode 26, then you don't need to workarounds above.
2w
tvOS 26 Bugs – Persistent UI animation issues: app launch stutter, text rendering jumps, shadow jumps, abrupt swipe transitions
Hello :-) I‘m not entirely sure, if I‘m on the correct Place here. But I would like to report some Bugs with tvOS 26 (Beta 6) to the Apple Engineers! Description I am reporting multiple persistent UI animation issues observed in tvOS 26 (Beta 3). These issues have been reproducible across multiple tvOS releases. They are subtle but noticeable, and they affect the overall polish and perceived quality of the system. I am happy to provide high-quality video captures for each of the issues described below. ⸻ Bug #1: App launch animation stutter/jump Summary: The zoom-in animation from a Springboard icon to full-screen app stutters or jumps at the moment the app becomes full screen. Steps to reproduce: 1. On Springboard, select any app icon. 2. Observe the zoom-in animation. Expected result: Smooth, continuous zoom without frame drops or jumps. Actual result: Animation visibly stutters/jumps at the full-screen transition. Possible cause: Timing issue in Core Animation interpolation or abrupt view hierarch
2
0
292
2w
Seeing some behaviour in Swift that I don't understand...
It's related to the passByValue nature of structs. In the sample code below, I'm displaying a list of structs (and I can add instances to my list using Int.random(1..<3) to pick one of two possible predefined versions of the struct). I also have a detail view that can modify the details of a single struct. However when I run this code, it will instead modify all the instances (ie either Sunday or Monday) in my list. To see this behaviour, run the following code and: tap New Trigger enough times that there are multiple of at least one of the sunday/monday triggers tap one of the matching trigger rows modify either the day, or the int expected: only one of the rows will reflect the edit actual: all the matching instances will be updated. This suggests to me that my Sunday and Monday static instances are being passed by reference when they get added to the array. But I had thought structs were strictly pass by value. What am I missing? thanks in advance for any wisdom, Mike struct ContentView: View { @State v
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1
0
181
2w
Reply to Seeing some behaviour in Swift that I don't understand...
This suggests to me that my Sunday and Monday static instances are being passed by reference No, that's not the problem. But this way of adding a new trigger is causing the problem. fetchTriggers.append(Int.random(in: 1..<3) == 1 ? .sunMorning : .monEvening) This adds a new item. By it adds the same Sunday or Monday, with its existing ID. So, you reuse the same struct. Change to this to solve: Button(New Trigger) { let newTrigger = Int.random(in: 1..<3) == 1 ? FetchTrigger(dayOfWeek: .sunday, hour: 3) : FetchTrigger(dayOfWeek: .monday, hour: 6) fetchTriggers.append(newTrigger) // fetchTriggers.append(Int.random(in: 1..<3) == 1 ? .sunMorning : .monEvening) } You can also create a new ID: struct FetchTrigger: Identifiable { static var monEvening: FetchTrigger = .init(dayOfWeek: .monday, hour: 6) static var sunMorning: FetchTrigger = .init(dayOfWeek: .sunday, hour: 3) var id = UUID() // all need to be var mutating func changedId() -> FetchTrigger { self.id = UUID() return self } and
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2w