Search results for

“swiftui”

17,110 results found

Post

Replies

Boosts

Views

Activity

Which tools and concepts are essential to learn first in iOS development?
I’m beginning my journey in iOS app development with a strong Java background and an app idea in mind, and I want to learn the best practices, tools, and workflows to build it the right way from the start. I’d appreciate guidance on useful AI tools for coding and learning Swift or SwiftUI, how developers approach app design, and recommended sources for UI inspiration, graphics, and overall development tips.
2
0
71
Feb ’26
What is the state of EventKit going forward?
I'm building an app that heavily relies on EKEventStore for calendar and reminder integration. The API is simple - and limited. Change notifications amount to something changed, you'd better refetch everything you care about. There's no way to know whether the calendar was updated while your app was closed or backgrounded. EKEvents and EKReminders don't trigger SwiftUI view updates, so you end up shunting them into your own observable state and keeping the two in sync. My app is fairly complex rendering-wise, and I lament being locked into treating EKEventStore as a first-class citizen of my view and data layer. It makes everything clunkier, essentially shuts the door on modern features like undo/redo, and makes integrating with other calendar providers that much harder. I'm exploring a custom SwiftData DataStore ↔ EKEventStore sync engine, but this is no easy task. There are still many unknowns I'd need to spike out before I can even attempt a proper implementation. Still, I'm curious - is this some
1
0
105
Feb ’26
Key lessons after two months of building my first iOS app
After nearly ten years in Android development, I finally built a native iOS app, sharing the journey publicly while learning Swift and SwiftUI, using AI selectively, and finding the platform familiar yet different in tooling, concurrency, and culture. I reached production without initially buying a developer account and faced a stricter, iterative App Store review process than the Play Store, with several rejections that ultimately clarified Apple’s quality standards and expectations.
1
0
54
Feb ’26
Reply to Query with predicate in child view running too frequently.
When the query has a filter, SwiftData currently doesn't have a way to determine if the predicate changes every time AddTestStageView.init is called (because Predicate is not Equatable), and so assumes a re-fetch. To avoid the potential performance issue, you can probably consider re-designing your SwiftUI view hierarchy so the change of TextField doesn't trigger AddTestStageView.init, if that change is not relevant to the view. I’d also suggest that you file a feedback report – If you do so, please share your report ID here. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’26
Query with predicate in child view running too frequently.
I'm trying to determine if this is expected swiftui behavior or an issue with SwiftUI/Data which needs a feedback request... When a child view has a Query containing a filter predicate, the query is run with each and every edit of the parent view, even when the edit has no impact on the child view (e.g. bindings not changing). In the example below, ContentView has the TextField name, and while data is being entered in it, causes the Query in AddTestStageView to be run with each character typed, e.g. 30 characters result in 30 query executions. (Need -com.apple.CoreData.SQLDebug 1 launch argument to see SQL output). Removing the filter predicate from the query and filtering in ForEach prevents the issue. In my actual use case, the query has a relatively small result set (<100 rows), but I can see this as a performance issue with the larger result sets. xcode/ios: 26.2 Repro example code: import SwiftUI import SwiftData // Repro to Query filter issue in child view running multiple
1
0
101
Feb ’26
Creating powerful, efficient, and maintainable applications.
Recursive and Self-Referential Data Structures Combining recursive and self-referential data structures with frameworks like Accelerate, SwiftMacros, and utilizing SwiftUI hooks can offer significant benefits in terms of performance, maintainability, and expressiveness. Here is how Apple Intelligence breaks it down. Benefits: Natural Representation of Complex Data: Recursive structures, such as trees and graphs, are ideal for representing hierarchical or interconnected data, like file systems, social networks, and DOM trees. Simplified Algorithms: Many algorithms, such as traversals, sorting, and searching, are more straightforward and elegant when implemented using recursion. Dynamic Memory Management: Self-referential structures can dynamically grow and shrink, making them suitable for applications with unpredictable data sizes. Challenges: Performance Overhead: Recursive algorithms can lead to stack overflow if not properly optimized (e.g., using tail recursion). Self-referential structures can in
1
0
665
Feb ’26
Liquid Glass Button animating when behind a view when `.interactive()` modifier is applied
When using the .glassEffect modifier on a button in swiftui combined with the .interactive() modifier, the button continues to show the interactive animation even when it’s covered by another element. Example: ZStack { Button { print(Button overlayed by ZStack) // Does not trigger, but interactive animation still plays } label: { image } .glassEffect(.regular.interactive()) Rectangle().fill(.black.opacity(0.7)) } This occurs with overlays, ZStacks, and even if the overlay is a button. Example below: EDIT: It seems like rocketsim's gif recording doesnt show the bug for some reason... really strange... Edit 2: reuploaded gif, recorded as mp4 and converted to gif seems to have worked... Feedback ID: FB22054300 I've attached this sample app to my feedback ticket to help with debugging the issue. It doesn't look like I can share it in this post though.
2
0
250
Feb ’26
"NavigationLink in List incorrectly highlights when destination value exists in NavigationStack path"
In SwiftUI, when using NavigationStack with a path binding containing multiple instances of the same (or many with navigationPath()) model type (since model type are class type, this issue might occur on instances of class type too), any NavigationLink in a detail view that leads to a value already present anywhere in the navigation stack (which is in the path binding) will appear incorrectly highlighted upon the view's initial appearance. This bug seems manifests specifically when the links are contained within a List. The highlighting is inconsistent - only the earliest appended value in path has link in each section displays as pressed, while links to other value appear normal. Below is a simple code to reproduce the bug. import SwiftUI import SwiftData // Simple model @available(iOS 17, *) @Model class Item { var id = UUID() var name: String var relatedItems: [Item] init(name: String = , relatedItems: [Item] = []) { self.name = name self.relatedItems = relatedItems } } // MARK: - Bug Rep
0
0
67
Feb ’26
Reply to CoreText crash on iOS 26.0 Simulator (Xcode 26.2) when rendering string with zero-width non-joiner and combining marks
Hi, Thank you for your reply. It is important work within the exact same environment. I am currently using Xcode 26.2 with the iOS 26.0 simulator iPhone 17 or iPhone17 pro (should happen of any of them), and I was able to reproduce the issue on other MacBooks as well with same environment. During our investigation of crash reports, we found that this issue occurs in production on certain iOS versions. Reproducing it locally in the simulator has been the only reliable way to validate the behavior. I would greatly appreciate your assistance with this matter. The problem does not appear to be related to UIKit. I can reproduce it in SwiftUI using Text as well. Unfortunately, the stack trace is not very informative. The crash also occurs when simply passing this specific character to Safari within the simulator. In most cases, the crash can be reproduced by adding the character to a project and building it with the iOS 26.0 simulator using iPhone 17. When running the same project on iOS 26.0.1, the issue
Topic: UI Frameworks SubTopic: General
Feb ’26
Reply to CoreText crash on iOS 26.0 Simulator (Xcode 26.2) when rendering string with zero-width non-joiner and combining marks
Thank you for your post. I have been unable to reproduce the issue by simply copying and pasting your code. I am interested in understanding the issue further, as it appears to be related to UIKit. If you connected the label to a storyboard, could you please provide me with a focused sample that I can download and test? If you're not familiar with preparing a test project, take a look at Creating a test project. However if it crashes, this is a very specific and concerning crash. Looking at the code I tried as well to play on the characters a little, however I’m not connecting to a storyboard or SwiftUI. let problematicString = u{274D}u{200C}u{1CD7}u{20DB} let safeString = problematicString.replacingOccurrences(of: u{200C}, with: ) label.text = safeString Looking forward to your focused sample! Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: General
Feb ’26
SpriteKit framerate drop on iOS 26.4 (ongoing for months)
I have noticed that the performance drop on SpriteKit-based projects running on iOS 26 is still ongoing With iOS 26 back in Sep 2025 a framerate problem was introduced. My app was always running smoothly with 60fps even on very old devices suddenly started to stutter with 40fps - and lower on a rather normal iPhone 13. This problem continued with BETA 26.1 The problem was fixed in 26.2. But 26.3 brought the problem back and its still ongoing with 26.4 of yesterday This is easily reproducible with a very simple example // // BareboneSpriteKitApp.swift // BareboneSpriteKit // // Created by Bernd Beyreuther on 24.02.26. // import SwiftUI import SpriteKit @main struct BareboneSpriteKitApp: App { var body: some Scene { WindowGroup { BareboneSceneView() } } } final class BareboneScene: SKScene { override func didMove(to view: SKView) { size = view.bounds.size scaleMode = .resizeFill anchorPoint = CGPoint(x: 0.5, y: 0.5) backgroundColor = .darkGray let s = SKSpriteNode(color: .cyan, size: CGSize(width: 64,
1
0
487
Feb ’26
Xcode 26.3: Simulators incorrectly shown as "build only device" — Run (Cmd+R) fails while Build (Cmd+B) and command-line build/deploy succeed
Product Xcode Version 26.3 (26C5131e) Platform macOS / iOS Simulator / iOS Device Classification Bug / Incorrect UI Behaviour Reproducibility Always (persists across restarts, scheme recreation, DerivedData clearing) Date Encountered February 20, 2026 Hardware Mac mini (M2) running macOS Test Device iPhone SE (2nd generation), iOS 26.3 Summary In Xcode 26.3, attempting to run an iOS app on any simulator destination using Cmd+R fails with the error: A build only device cannot be used to run this target. Please select an available device or choose a simulated device as the destination. This occurs despite the selected destination being a valid iOS Simulator (not a build only device). The same project builds successfully using Cmd+B within Xcode and builds, installs, and runs correctly via the command line using xcodebuild, xcrun simctl, and xcrun devicectl. Steps to Reproduce Open a valid iOS project in Xcode 26.3. The project in question has target name h, product name DiabetesHbA1cPrediction, bundle identifie
0
0
375
Feb ’26
SwiftUI Link view corrupts destination URLs when using a leading-zero padded IPv4 address.
There appears to be a bug in Link with IPv4 addresses with padding in the second octet, on macOS and iOS both. struct LinkViewBug: View { let works = URL(string: http://172.16.1.1)! let alsoWorks = URL(string: http://172.16.001.001)! let doesntWork = URL(string: http://172.016.001.001)! let alsoDoesntWork = URL(string: http://172.016.1.1)! var body: some View { // destination -> http://172.16.1.1 Link(works.formatted(), destination: works) Link(alsoWorks.formatted(), destination: alsoWorks) // destination -> http://172.14.1.1 ? Link(doesntWork.formatted(), destination: doesntWork) Link(alsoDoesntWork.formatted(), destination: alsoDoesntWork) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
0
0
86
Feb ’26
In SwiftUI for macOS, is there an equivalent to NSControl.BorderShape?
In macOS 26, there is a new property on NSControl called .borderShape. The WWDC 2025-310 video says it can be used to Override preferred shape of control to suit your design. and that it's available on NSButton, NSPopUpButton and NSSegmentedControl. Is there an equivalent to that property for SwiftUI? For example, given the following SwiftUI code: Button(Eject) { } .borderShape(...) <-- ? How can I apply a .borderShape that would match those on controls created in AppKit? I'm aware that SwiftUI offers a plethora of ways to custom design a button such that it can have rounded corners, but I'm interested in this particular property so that SwiftUI buttons and AppKit buttons in the same app have the same look-and-feel.
1
0
118
Feb ’26
Reply to Do SwiftUI Segmented Controls on macOS 26 support the icon and title label style?
Hello @kennyc, Displaying the title and icon within a segmented control is currently not supported for SwiftUI's .segmentedPickerStyle. If you'd like us to consider adding the necessary functionality for this, please file an enhancement request using Feedback Assistant and reply with FB number here once complete. Consider also, the Human Interface Guidelines recommends using either text or an image in a single segmented control, not a mix. You can review the Segmented controls section of the guidelines for more best practices.  Travis Trotto - DTS Engineer
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’26
Which tools and concepts are essential to learn first in iOS development?
I’m beginning my journey in iOS app development with a strong Java background and an app idea in mind, and I want to learn the best practices, tools, and workflows to build it the right way from the start. I’d appreciate guidance on useful AI tools for coding and learning Swift or SwiftUI, how developers approach app design, and recommended sources for UI inspiration, graphics, and overall development tips.
Replies
2
Boosts
0
Views
71
Activity
Feb ’26
What is the state of EventKit going forward?
I'm building an app that heavily relies on EKEventStore for calendar and reminder integration. The API is simple - and limited. Change notifications amount to something changed, you'd better refetch everything you care about. There's no way to know whether the calendar was updated while your app was closed or backgrounded. EKEvents and EKReminders don't trigger SwiftUI view updates, so you end up shunting them into your own observable state and keeping the two in sync. My app is fairly complex rendering-wise, and I lament being locked into treating EKEventStore as a first-class citizen of my view and data layer. It makes everything clunkier, essentially shuts the door on modern features like undo/redo, and makes integrating with other calendar providers that much harder. I'm exploring a custom SwiftData DataStore ↔ EKEventStore sync engine, but this is no easy task. There are still many unknowns I'd need to spike out before I can even attempt a proper implementation. Still, I'm curious - is this some
Replies
1
Boosts
0
Views
105
Activity
Feb ’26
Key lessons after two months of building my first iOS app
After nearly ten years in Android development, I finally built a native iOS app, sharing the journey publicly while learning Swift and SwiftUI, using AI selectively, and finding the platform familiar yet different in tooling, concurrency, and culture. I reached production without initially buying a developer account and faced a stricter, iterative App Store review process than the Play Store, with several rejections that ultimately clarified Apple’s quality standards and expectations.
Replies
1
Boosts
0
Views
54
Activity
Feb ’26
Reply to Query with predicate in child view running too frequently.
When the query has a filter, SwiftData currently doesn't have a way to determine if the predicate changes every time AddTestStageView.init is called (because Predicate is not Equatable), and so assumes a re-fetch. To avoid the potential performance issue, you can probably consider re-designing your SwiftUI view hierarchy so the change of TextField doesn't trigger AddTestStageView.init, if that change is not relevant to the view. I’d also suggest that you file a feedback report – If you do so, please share your report ID here. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’26
Query with predicate in child view running too frequently.
I'm trying to determine if this is expected swiftui behavior or an issue with SwiftUI/Data which needs a feedback request... When a child view has a Query containing a filter predicate, the query is run with each and every edit of the parent view, even when the edit has no impact on the child view (e.g. bindings not changing). In the example below, ContentView has the TextField name, and while data is being entered in it, causes the Query in AddTestStageView to be run with each character typed, e.g. 30 characters result in 30 query executions. (Need -com.apple.CoreData.SQLDebug 1 launch argument to see SQL output). Removing the filter predicate from the query and filtering in ForEach prevents the issue. In my actual use case, the query has a relatively small result set (<100 rows), but I can see this as a performance issue with the larger result sets. xcode/ios: 26.2 Repro example code: import SwiftUI import SwiftData // Repro to Query filter issue in child view running multiple
Replies
1
Boosts
0
Views
101
Activity
Feb ’26
Creating powerful, efficient, and maintainable applications.
Recursive and Self-Referential Data Structures Combining recursive and self-referential data structures with frameworks like Accelerate, SwiftMacros, and utilizing SwiftUI hooks can offer significant benefits in terms of performance, maintainability, and expressiveness. Here is how Apple Intelligence breaks it down. Benefits: Natural Representation of Complex Data: Recursive structures, such as trees and graphs, are ideal for representing hierarchical or interconnected data, like file systems, social networks, and DOM trees. Simplified Algorithms: Many algorithms, such as traversals, sorting, and searching, are more straightforward and elegant when implemented using recursion. Dynamic Memory Management: Self-referential structures can dynamically grow and shrink, making them suitable for applications with unpredictable data sizes. Challenges: Performance Overhead: Recursive algorithms can lead to stack overflow if not properly optimized (e.g., using tail recursion). Self-referential structures can in
Replies
1
Boosts
0
Views
665
Activity
Feb ’26
Liquid Glass Button animating when behind a view when `.interactive()` modifier is applied
When using the .glassEffect modifier on a button in swiftui combined with the .interactive() modifier, the button continues to show the interactive animation even when it’s covered by another element. Example: ZStack { Button { print(Button overlayed by ZStack) // Does not trigger, but interactive animation still plays } label: { image } .glassEffect(.regular.interactive()) Rectangle().fill(.black.opacity(0.7)) } This occurs with overlays, ZStacks, and even if the overlay is a button. Example below: EDIT: It seems like rocketsim's gif recording doesnt show the bug for some reason... really strange... Edit 2: reuploaded gif, recorded as mp4 and converted to gif seems to have worked... Feedback ID: FB22054300 I've attached this sample app to my feedback ticket to help with debugging the issue. It doesn't look like I can share it in this post though.
Replies
2
Boosts
0
Views
250
Activity
Feb ’26
"NavigationLink in List incorrectly highlights when destination value exists in NavigationStack path"
In SwiftUI, when using NavigationStack with a path binding containing multiple instances of the same (or many with navigationPath()) model type (since model type are class type, this issue might occur on instances of class type too), any NavigationLink in a detail view that leads to a value already present anywhere in the navigation stack (which is in the path binding) will appear incorrectly highlighted upon the view's initial appearance. This bug seems manifests specifically when the links are contained within a List. The highlighting is inconsistent - only the earliest appended value in path has link in each section displays as pressed, while links to other value appear normal. Below is a simple code to reproduce the bug. import SwiftUI import SwiftData // Simple model @available(iOS 17, *) @Model class Item { var id = UUID() var name: String var relatedItems: [Item] init(name: String = , relatedItems: [Item] = []) { self.name = name self.relatedItems = relatedItems } } // MARK: - Bug Rep
Replies
0
Boosts
0
Views
67
Activity
Feb ’26
Reply to CoreText crash on iOS 26.0 Simulator (Xcode 26.2) when rendering string with zero-width non-joiner and combining marks
Hi, Thank you for your reply. It is important work within the exact same environment. I am currently using Xcode 26.2 with the iOS 26.0 simulator iPhone 17 or iPhone17 pro (should happen of any of them), and I was able to reproduce the issue on other MacBooks as well with same environment. During our investigation of crash reports, we found that this issue occurs in production on certain iOS versions. Reproducing it locally in the simulator has been the only reliable way to validate the behavior. I would greatly appreciate your assistance with this matter. The problem does not appear to be related to UIKit. I can reproduce it in SwiftUI using Text as well. Unfortunately, the stack trace is not very informative. The crash also occurs when simply passing this specific character to Safari within the simulator. In most cases, the crash can be reproduced by adding the character to a project and building it with the iOS 26.0 simulator using iPhone 17. When running the same project on iOS 26.0.1, the issue
Topic: UI Frameworks SubTopic: General
Replies
Boosts
Views
Activity
Feb ’26
Reply to CoreText crash on iOS 26.0 Simulator (Xcode 26.2) when rendering string with zero-width non-joiner and combining marks
Thank you for your post. I have been unable to reproduce the issue by simply copying and pasting your code. I am interested in understanding the issue further, as it appears to be related to UIKit. If you connected the label to a storyboard, could you please provide me with a focused sample that I can download and test? If you're not familiar with preparing a test project, take a look at Creating a test project. However if it crashes, this is a very specific and concerning crash. Looking at the code I tried as well to play on the characters a little, however I’m not connecting to a storyboard or SwiftUI. let problematicString = u{274D}u{200C}u{1CD7}u{20DB} let safeString = problematicString.replacingOccurrences(of: u{200C}, with: ) label.text = safeString Looking forward to your focused sample! Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: General
Replies
Boosts
Views
Activity
Feb ’26
SpriteKit framerate drop on iOS 26.4 (ongoing for months)
I have noticed that the performance drop on SpriteKit-based projects running on iOS 26 is still ongoing With iOS 26 back in Sep 2025 a framerate problem was introduced. My app was always running smoothly with 60fps even on very old devices suddenly started to stutter with 40fps - and lower on a rather normal iPhone 13. This problem continued with BETA 26.1 The problem was fixed in 26.2. But 26.3 brought the problem back and its still ongoing with 26.4 of yesterday This is easily reproducible with a very simple example // // BareboneSpriteKitApp.swift // BareboneSpriteKit // // Created by Bernd Beyreuther on 24.02.26. // import SwiftUI import SpriteKit @main struct BareboneSpriteKitApp: App { var body: some Scene { WindowGroup { BareboneSceneView() } } } final class BareboneScene: SKScene { override func didMove(to view: SKView) { size = view.bounds.size scaleMode = .resizeFill anchorPoint = CGPoint(x: 0.5, y: 0.5) backgroundColor = .darkGray let s = SKSpriteNode(color: .cyan, size: CGSize(width: 64,
Replies
1
Boosts
0
Views
487
Activity
Feb ’26
Xcode 26.3: Simulators incorrectly shown as "build only device" — Run (Cmd+R) fails while Build (Cmd+B) and command-line build/deploy succeed
Product Xcode Version 26.3 (26C5131e) Platform macOS / iOS Simulator / iOS Device Classification Bug / Incorrect UI Behaviour Reproducibility Always (persists across restarts, scheme recreation, DerivedData clearing) Date Encountered February 20, 2026 Hardware Mac mini (M2) running macOS Test Device iPhone SE (2nd generation), iOS 26.3 Summary In Xcode 26.3, attempting to run an iOS app on any simulator destination using Cmd+R fails with the error: A build only device cannot be used to run this target. Please select an available device or choose a simulated device as the destination. This occurs despite the selected destination being a valid iOS Simulator (not a build only device). The same project builds successfully using Cmd+B within Xcode and builds, installs, and runs correctly via the command line using xcodebuild, xcrun simctl, and xcrun devicectl. Steps to Reproduce Open a valid iOS project in Xcode 26.3. The project in question has target name h, product name DiabetesHbA1cPrediction, bundle identifie
Replies
0
Boosts
0
Views
375
Activity
Feb ’26
SwiftUI Link view corrupts destination URLs when using a leading-zero padded IPv4 address.
There appears to be a bug in Link with IPv4 addresses with padding in the second octet, on macOS and iOS both. struct LinkViewBug: View { let works = URL(string: http://172.16.1.1)! let alsoWorks = URL(string: http://172.16.001.001)! let doesntWork = URL(string: http://172.016.001.001)! let alsoDoesntWork = URL(string: http://172.016.1.1)! var body: some View { // destination -> http://172.16.1.1 Link(works.formatted(), destination: works) Link(alsoWorks.formatted(), destination: alsoWorks) // destination -> http://172.14.1.1 ? Link(doesntWork.formatted(), destination: doesntWork) Link(alsoDoesntWork.formatted(), destination: alsoDoesntWork) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
0
Boosts
0
Views
86
Activity
Feb ’26
In SwiftUI for macOS, is there an equivalent to NSControl.BorderShape?
In macOS 26, there is a new property on NSControl called .borderShape. The WWDC 2025-310 video says it can be used to Override preferred shape of control to suit your design. and that it's available on NSButton, NSPopUpButton and NSSegmentedControl. Is there an equivalent to that property for SwiftUI? For example, given the following SwiftUI code: Button(Eject) { } .borderShape(...) <-- ? How can I apply a .borderShape that would match those on controls created in AppKit? I'm aware that SwiftUI offers a plethora of ways to custom design a button such that it can have rounded corners, but I'm interested in this particular property so that SwiftUI buttons and AppKit buttons in the same app have the same look-and-feel.
Replies
1
Boosts
0
Views
118
Activity
Feb ’26
Reply to Do SwiftUI Segmented Controls on macOS 26 support the icon and title label style?
Hello @kennyc, Displaying the title and icon within a segmented control is currently not supported for SwiftUI's .segmentedPickerStyle. If you'd like us to consider adding the necessary functionality for this, please file an enhancement request using Feedback Assistant and reply with FB number here once complete. Consider also, the Human Interface Guidelines recommends using either text or an image in a single segmented control, not a mix. You can review the Segmented controls section of the guidelines for more best practices.  Travis Trotto - DTS Engineer
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’26