Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

A Summary of the WWDC25 Group Lab - UI Frameworks
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 UI Frameworks. How would you recommend developers start adopting the new design? Start by focusing on the foundational structural elements of your application, working from the "top down" or "bottom up" based on your application's hierarchy. These structural changes, like edge-to-edge content and updated navigation and controls, often require corresponding code modifications. As a first step, recompile your application with the new SDK to see what updates are automatically applied, especially if you've been using standard controls. Then, carefully analyze where the new design elements can be applied to your UI, paying particular attention to custom controls or UI that could benefit from a refresh. Address the large structural items first then focus on smaller details is recommended. Will we need to migrate our UI code to Swift and SwiftUI to adopt the new design? No, you will not need to migrate your UI code to Swift and SwiftUI to adopt the new design. The UI frameworks fully support the new design, allowing you to migrate your app with as little effort as possible, especially if you've been using standard controls. The goal is to make it easy to adopt the new design, regardless of your current UI framework, to achieve a cohesive look across the operating system. What was the reason for choosing Liquid Glass over frosted glass, as used in visionOS? The choice of Liquid Glass was driven by the desire to bring content to life. The see-through nature of Liquid Glass enhances this effect. The appearance of Liquid Glass adapts based on its size; larger glass elements look more frosted, which aligns with the design of visionOS, where everything feels larger and benefits from the frosted look. What are best practices for apps that use customized navigation bars? The new design emphasizes behavior and transitions as much as static appearance. Consider whether you truly need a custom navigation bar, or if the system-provided controls can meet your needs. Explore new APIs for subtitles and custom views in navigation bars, designed to support common use cases. If you still require a custom solution, ensure you're respecting safe areas using APIs like SwiftUI's safeAreaInset. When working with Liquid Glass, group related buttons in shared containers to maintain design consistency. Finally, mark glass containers as interactive. For branding, instead of coloring the navigation bar directly, consider incorporating branding colors into the content area behind the Liquid Glass controls. This creates a dynamic effect where the color is visible through the glass and moves with the content as the user scrolls. I want to know why new UI Framework APIs aren’t backward compatible, specifically in SwiftUI? It leads to code with lots of if-else statements. Existing APIs have been updated to work with the new design where possible, ensuring that apps using those APIs will adopt the new design and function on both older and newer operating systems. However, new APIs often depend on deep integration across the framework and graphics stack, making backward compatibility impractical. When using these new APIs, it's important to consider how they fit within the context of the latest OS. The use of if-else statements allows you to maintain compatibility with older systems while taking full advantage of the new APIs and design features on newer systems. If you are using new APIs, it likely means you are implementing something very specific to the new design language. Using conditional code allows you to intentionally create different code paths for the new design versus older operating systems. Prefer to use if #available where appropriate to intentionally adopt new design elements. Are there any Liquid Glass materials in iOS or macOS that are only available as part of dedicated components? Or are all those materials available through new UIKit and AppKit views? Yes, some variations of the Liquid Glass material are exclusively available through dedicated components like sliders, segmented controls, and tab bars. However, the "regular" and "clear" glass materials should satisfy most application requirements. If you encounter situations where these options are insufficient, please file feedback. If I were to create an app today, how should I design it to make it future proof using Liquid Glass? The best approach to future-proof your app is to utilize standard system controls and design your UI to align with the standard system look and feel. Using the framework-provided declarative API generally leads to easier adoption of future design changes, as you're expressing intent rather than specifying pixel-perfect visuals. Pay close attention to the design sessions offered this year, which cover the design motivation behind the Liquid Glass material and best practices for its use. Is it possible to implement your own sidebar on macOS without NSSplitViewController, but still provide the Liquid Glass appearance? While technically possible to create a custom sidebar that approximates the Liquid Glass appearance without using NSSplitViewController, it is not recommended. The system implementation of the sidebar involves significant unseen complexity, including interlayering with scroll edge effects and fullscreen behaviors. NSSplitViewController provides the necessary level of abstraction for the framework to handle these details correctly. Regarding the SceneDelagate and scene based life-cycle, I would like to confirm that AppDelegate is not going away. Also if the above is a correct understanding, is there any advice as to what should, and should not, be moved to the SceneDelegate? UIApplicationDelegate is not going away and still serves a purpose for application-level interactions with the system and managing scenes at a higher level. Move code related to your app's scene or UI into the UISceneDelegate. Remember that adopting scenes doesn't necessarily mean supporting multiple scenes; an app can be scene-based but still support only one scene. Refer to the tech note Migrating to the UIKit scene-based life cycle and the Make your UIKit app more flexible WWDC25 session for more information.
Topic: UI Frameworks SubTopic: General
0
0
807
Jun ’25
Live Q&A Summary - SwiftUI foundations: Build great apps with SwiftUI
Here’s a recap of the Live Q&A for SwiftUI foundations: Build great apps with SwiftUI. If you participated and asked questions, thank you for coming and participating! If you weren’t able to join us live we hope this recap is useful Where can I watch the VOD? Is the sample code “Wishlist” that was shown available for download? You can view the replay of the entire event here https://www.youtube.com/watch?v=Z3vloOtZLkQ The sample code for the Wishlist app will be made available in the coming weeks on the Apple Developer website, we'll send an update via email when it is available. What are the best practices when it comes to building complex navigations in SwiftUI? The developer website has documentation on navigation style best practices. Explore navigation basics like NavigationStack and TabView to get a ground-up understanding. For documentation on navigation APIs see Navigation. How can I integrate UIKit with my SwiftUI app? What about adding SwiftUI into my UIKit app? See UIKit integration: Add UIKit views to your SwiftUI app, or use SwiftUI views in your UIKit app. Both UIKit and SwiftUI provide API to show a view hierarchy of the other. For UIKit to SwiftUI, you would use UIViewControllerRepresentable. For SwiftUI to UIKit, you would use UIHostingController. Landmarks: Interfacing with UIKit walks you through step by step how to implement UIKit in SwiftUI with UIViewControllerRepresentable, and this WWDC22 video demonstrates UIHostingController, for those that want to add SwiftUI to their UIKit. Does Wishlist feature a new iOS 26 font? How can I add custom fonts and text of my app? We’re glad to hear many of you liked wide text shown in Wishlist, however, It is the default system font with some light SwiftUI styling! Check it out for yourself in the sample code when made available, and you can learn more about customizing fonts and text by seeing Font and Applying custom fonts to text. Does Xcode have a dependency graph we can use to optimize our SwiftUI Views? Xcode comes with Instruments. Instruments is the best way to figure out what is causing excessive updates and other issues with performance. That link provides direct tutorials and resources for how to use and understand. Previews also have many useful tools for analyzing SwiftUI views, for more info see Previews in Xcode Check out this video from our latest WWDC Optimize SwiftUI performance with Instruments for information on how to use Instruments to profile and optimize your app with real-world applications If you still have questions, Check out the Instruments section of these forums and create a post so the community has the opportunity to help guide you. Are there UI debugging tools to help diagnose layout issues? Yes, Xcode also features a View Debugger located by selecting the View Debug Hierarchy, pictured below. Use the View Debugger to capture and inspect your view hierarchy, identifying which views affect window sizing. The SwiftUI Inspector also lets you examine view frames and layout behavior. See Diagnosing issues in the appearance of a running app to learn about debugging visual and layout issues. As an absolute beginner, what would be the first go-to step to go for training? Do I need prior knowledge of frameworks to get started with SwiftUI? A great place to learn how to develop for Apple platforms is with Pathways! Many developers start with Develop in Swift tutorials, which exposes you to several frameworks while teaching you the basics of SwiftUI. When you're ready to take your learning further, you can read the documentation for the specific frameworks that interest you at https://developer.apple.com/documentation/.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
72
4d
UITabBarController crashes when editing the items
I'm using one UITabBarController which leads to 6 NavigationController. Therefore the user will get 4 icons displayed and one icon with three points to see the rest of the Navigation Controller. If the user now tries to edit the list and moves one item from the hidden area towards the TabBar at the bottom, the App crashes with the error: Exception NSException * "Can't add self as subview" 0x0000600000d16040 I can see this effect at least on both my apps. If the same compilation is run on a older iOS version, there is no crash. Is there anything I have to take care of the configuration of the TabBar, when it comes to iOS26?
Topic: UI Frameworks SubTopic: UIKit
17
1
739
5h
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 time unexpectedly // Need "-com.apple.CoreData.SQLDebug 1" launch argument set to see SQL console output. @main struct ReproViewQueryMultipleRunningsApp: App { var body: some Scene { WindowGroup { ContentView() } .modelContainer(DataManager.shared.sharedModelContainer()) } } @Model final class TestStageClass { var id: UUID = UUID() var name: String = "" var isActive: Bool = true var displayOrder: Int = 0 init(name: String, isActive: Bool, displayOrder: Int) { self.name = name self.isActive = isActive self.displayOrder = displayOrder } } struct ContentView: View { @Environment(\.modelContext) var modelContext @State private var name: String = "" @State private var selectedTestStage: TestStageClass = DataManager.shared.getFirstTestStageClass() var body: some View { VStack (spacing: 20) { TextField("Name", text: $name) AddTestStageView(selectedTestStage: $selectedTestStage) } .frame(height: 200) } } #Preview("Sample Data") { ContentView() .modelContainer(DataManager.shared.sharedModelContainer()) } struct AddTestStageView: View { @Environment(\.modelContext) var modelContext @Binding var selectedTestStage: TestStageClass // MARK: - ISSUE LOCATION /// Using this Query with filter causes it to be run after each editing on parent view - such as each letter when editing a name. @Query(filter: #Predicate<TestStageClass> { $0.isActive }) private var testStageClasses: [TestStageClass] /// Using this query doesn't have the issue, then need filter in ForEach. // @Query() private var testStageClasses: [TestStageClass] var body: some View { Picker("stage", selection: $selectedTestStage) { // filter and sort here does not affect issue with above Query predicate filter. ForEach(testStageClasses.filter(\.isActive).sorted(by: { $0.displayOrder < $1.displayOrder } ), id: \.id) { stage in Text("\(stage.name)") .tag(stage) } } } } class DataManager { static let shared = DataManager() private var modelContainer: ModelContainer? = nil public func sharedModelContainer(inMemory: Bool = false) -> ModelContainer { let schema = Schema([TestStageClass.self]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: inMemory) do { self.modelContainer = try ModelContainer(for: schema, configurations: [modelConfiguration]) checkDataExists() return self.modelContainer! } catch { fatalError("Could not create sharedModelContainer. Schema:\(schema.entities.map(\.name)), \((modelConfiguration.isStoredInMemoryOnly) ? "in memory only" : "in disk"):\n\(error.localizedDescription)") } } private func checkDataExists() { let mainContext = self.modelContainer!.mainContext print("checkDataExists") do { let classData: [TestStageClass] = try mainContext.fetch(FetchDescriptor<TestStageClass>()) if classData.isEmpty { mainContext.insert(TestStageClass(name: "Beginning", isActive: true, displayOrder: 0)) mainContext.insert(TestStageClass(name: "Second Middle", isActive: false, displayOrder: 2)) mainContext.insert(TestStageClass(name: "Middle", isActive: true, displayOrder: 1)) mainContext.insert(TestStageClass(name: "End", isActive: true, displayOrder: 3)) } if mainContext.hasChanges { try? mainContext.save() print("Added Default Data for TestStageClass") } } catch { fatalError("Failed to get item count for TestStageClass: \(error.localizedDescription)") } } func getFirstTestStageClass() -> TestStageClass { let mainContext = self.modelContainer!.mainContext var tmp: TestStageClass? do { let classData: [TestStageClass] = try mainContext.fetch(FetchDescriptor<TestStageClass>()) tmp = classData.sorted(by: {$0.displayOrder < $1.displayOrder }).first } catch { fatalError("getFirstTestStageClass: \(error.localizedDescription)") } return tmp! } } Thanks, Steve
1
0
43
5h
navigationItem.titleView shifted left when leftBarButtonItem is nil in iOS 26
iOS 26 – navigationItem.titleView shifted left when leftBarButtonItem is nil Hi everyone, I’m encountering a layout issue on iOS 26 related to navigationItem.titleView positioning. What I’m Doing I’m hiding the default back button and removing the left bar button item: navigationItem.leftBarButtonItem = nil navigationItem.hidesBackButton = true navigationItem.setLeftBarButtonItems([], animated: true) Then I create a custom titleView with a specific width calculated as: Screen width minus the width of the two bar button items (left and right). let titleView = UIView(frame: CGRect(origin: .zero, size: sizeOfTitleView)) let titleLabel = UILabel(frame: CGRect(origin: .zero, size: sizeOfTitleView)) Expected Behavior On previous iOS versions, the titleView is perfectly centered in the navigation bar. Actual Behavior (iOS 26) On iOS 26, when leftBarButtonItem is nil, the titleView is pushed slightly to the left instead of being centered (see attached image). Question Has there been a change in UINavigationBar layout behavior in iOS 26? What is the correct way to ensure the titleView remains perfectly centered when there is no leftBarButtonItem? Any guidance would be appreciated. Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
24
6h
modifierFlags Monterey
Hello Using a MacBook Pro Intel with macOS 12.7.6 Monterey, I test in Objective-C an event for the option key but it is not working - (void)keyDown:(NSEvent *)event { printf("%s %p\n", __FUNCTION__, self); BOOL altFlag = [event modifierFlags] & NSEventModifierFlagOption; if (altFlag) { // UpdateClass printf("option pressed\n"); } else { printf("option not pressed\n"); } } The same in Swift works fine override func keyDown(with event: NSEvent) { if event.modifierFlags.contains(.option) { print("option pressed") } else { print("option NOT pressed") } } The Obj-C code works fine on a MacBook Air Tahoe 26.3 Any idea why it does not work on the macOS 12.7.6 Intel? Many Thanks Jean
2
0
65
13h
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.
1
1
28
14h
NSSegmentedCell misplaced in Liquid Glass mode (macOS 26)
We are currently testing our application under macOS 26 in Liquid Glass mode and noticed an issue with NSSegmentedCell. Our app makes extensive use of NSCell-based drawing. Since macOS 26, when running in Liquid Glass mode, NSSegmentedCell does not render at the expected location. The control itself appears visually correct, but it is clearly drawn offset from the rect it is supposed to occupy. In compatibility mode, everything renders exactly as expected (same code, same layout). To illustrate the issue, here are two screenshots of the same view: Liquid Glass mode 👉 (screenshot 1 – segmented control visibly shifted) Compatibility mode 👉 (screenshot 2 – correct rendering) The regression is obvious when switching between the two modes. This behavior has been present since the first macOS 26 release and is still reproducible with Xcode 26.2 (17C52). I have already filed a report via Feedback Assistant (FB reference available if useful), but I’m posting here to see whether others are experiencing the same issue or have found a workaround. Thanks.
Topic: UI Frameworks SubTopic: AppKit
2
0
54
15h
UITrackingElementWindowController crash when viewDidDisappear on iPadOS26.1
hello, I have been receiving crash reports on iPadOS 26.1, When UITrackingElementWindowController viewDidDisappear The feedback associated with this post is: FB20986398 and Exception Exception 'Cannot remove an observer <PKTextEffectsWindowObserver 0x10854cbe0> for the key path "frame" from <UITextEffectsWindow 0x10827ca00> because it is not registered as an observer.' #1 0x0000000183529814 in objc_exception_throw () #2 0x00000001845065a4 in -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] () #3 0x00000001845069c8 in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] () #4 0x00000001845068e0 in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] () #5 0x00000001cb22e894 in -[PKTextEffectsWindowObserver dealloc] () #6 0x000000018beafb28 in _setInteractionView () #7 0x000000018d81e8b8 in -[UIView(Dragging) removeInteraction:] () #8 0x00000001cb216448 in -[PKTextInputInteraction willMoveToView:] () #9 0x000000018beafb1c in _setInteractionView () #10 0x000000018d81e8b8 in -[UIView(Dragging) removeInteraction:] () #11 0x000000018d5ab094 in -[UIEditingOverlayViewController _removeInteractions] () #12 0x000000018cb166a8 in -[UIViewController _setViewAppearState:isAnimating:] () #13 0x000000018cb16d70 in __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke_2 () #14 0x000000018cb16c10 in __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke () #15 0x000000018655ef78 in __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ () #16 0x00000001866b4a24 in -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] () #17 0x000000018cb16a44 in -[UIViewController _setViewAppearState:isAnimating:] () #18 0x000000018cb1753c in -[UIViewController __viewDidDisappear:] () #19 0x000000018cb17638 in -[UIViewController _endAppearanceTransition:] () #20 0x000000018ca2401c in __48-[UIPresentationController transitionDidFinish:]_block_invoke () #21 0x000000018ca23cd0 in -[UIPresentationController transitionDidFinish:] () #22 0x000000018ca2d720 in -[_UICurrentContextPresentationController transitionDidFinish:] () #23 0x000000018ca27608 in __77-[UIPresentationController runTransitionForCurrentStateAnimated:handoffData:]_block_invoke.106 () #24 0x000000018cb31fec in -[_UIViewControllerTransitionContext completeTransition:] () #25 0x000000018d7f09bc in -[UITransitionView notifyDidCompleteTransition:] () #26 0x000000018d7f0750 in -[UITransitionView _didCompleteTransition:] () #27 0x000000018bf1c2a4 in __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ () #28 0x000000018d817960 in -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] () #29 0x000000018d7f7168 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] () #30 0x000000018d7f75cc in -[UIViewAnimationState animationDidStop:finished:] () #31 0x000000018d7f763c in -[UIViewAnimationState animationDidStop:finished:] () #32 0x0000000186fedda4 in run_animation_callbacks () #33 0x000000010365e2d0 in _dispatch_client_callout () #34 0x000000010367f4c0 in _dispatch_main_queue_drain.cold.5 () #35 0x0000000103654778 in _dispatch_main_queue_drain () #36 0x00000001036546b4 in _dispatch_main_queue_callback_4CF () #37 0x00000001865b42c8 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ () #38 0x0000000186567b3c in __CFRunLoopRun () #39 0x0000000186566a6c in _CFRunLoopRunSpecificWithOptions () #40 0x0000000226ee5498 in GSEventRunModal () #41 0x000000018bf2aba4 in -[UIApplication _run] () #42 0x000000018bed3a78 in UIApplicationMain ()
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
209
17h
PHAssetCreationRequest merges new Burst Photos into "Recently Deleted" instead of Library
Description I am observing a critical issue when saving burst photos using the Photos Framework. If a burst photo with the same burstIdentifier already exists in the "Recently Deleted" album, any new assets saved via PHAssetCreationRequest are automatically merged into that deleted entry instead of appearing in the main Library or "All Photos." Environment Framework: Photos Framework (iOS) API: [[PHPhotoLibrary sharedPhotoLibrary] performChanges:...] Code Snippet The following logic is used to save the burst assets: [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ // 'paths' is a custom object providing the creation request PHAssetCreationRequest *assetCreationRqst = [paths assetCreationRqst]; assetCreationRqst.favorite = [FavorManager.shared isSetDownloadedAssetFavorite:self.curItem]; PHObjectPlaceholder *placeHolder = assetCreationRqst.placeholderForCreatedAsset; localIdentifier = placeHolder.localIdentifier; } completionHandler:^(BOOL success, NSError * _Nullable error) { if (success) { // The handler returns success, but the asset is invisible to the user [weakSelf handleDownloadSuccess:localIdentifier]; } // ... cleanup and completion ... }]; Steps to Reproduce Save a burst photo to the iPhone's built-in Photos app. Manually delete that burst photo so it moves to the "Recently Deleted" album. Execute the code above to save the same burst photo (or a new set containing the same burstIdentifier in its metadata). Check the main Photo Library / "All Photos" view. Observed Result The completionHandler returns success = YES, and a localIdentifier is generated. The photo does not appear in the main Library or "All Photos." The newly saved photo is silently merged into the existing burst set located inside the "Recently Deleted" folder. The user cannot see the new photo unless they manually "Restore" the deleted items from the album. Expected Behavior PHAssetCreationRequest should always result in a visible asset in the user's Library. Even if a matching burstIdentifier exists in "Recently Deleted," the system should treat the new request as a new independent asset or provide an error, rather than hiding it within a deleted collection.
0
0
26
17h
iOS 26: hidesSharedBackground does not work for backBarButtonItem
What works let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) backButton.hidesSharedBackground = true self.navigationItem.rightBarButtonItem = backButton // or self.navigationItem.leftBarButtonItem = backButton What doesn't work let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) backButton.hidesSharedBackground = true self.navigationItem.backBarButtonItem = backButton I've tried setting this property on all possible permutations and combinations e.g. Inside navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) and pushViewController(_ viewController: UIViewController, animated: Bool) of a custom UINavigationController to make sure. Expected vs Actual behavior Setting hidesSharedBackground = true should remove the glass background from both regular bar button items and back bar button items but it has no effect on backBarButtonItem. Additional context I’m aware of the UIDesignRequiresCompatibility Info.plist key, but I’m looking for a programmatic solution if there is one. The goal is to remove the glass background from back buttons.
1
1
120
17h
"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 Reproducer @available(iOS 17, *) struct BugReproducerView: View { @State private var path: [Item] = [] let items: [Item] init() { let item1 = Item(name: "Item 1", relatedItems: []) let item2 = Item(name: "Item 2", relatedItems: [item1]) item1.relatedItems = [item2] self.items = [item1, item2] } var body: some View { NavigationStack(path: $path) { List(items) { item in NavigationLink(item.name, value: item) } .navigationTitle("Items") .navigationDestination(for: Item.self) { item in DetailView(item: item) } } } } // MARK: - Detail View with Bug @available(iOS 17, *) struct DetailView: View { let item: Item var body: some View { List { Section("Info") { Text("Selected: \(item.name)") } if !item.relatedItems.isEmpty { Section("Related") { ForEach(item.relatedItems) { related in NavigationLink(related.name, value: related) } } } } .navigationTitle(item.name) } } #Preview { if #available(iOS 17, *) { BugReproducerView() } else { } }
0
0
16
18h
How to Animate Fade of a View Simultaneously with Frame of Another View
Hi, I have two views in my view hierarchy searchButtonView and searchBarView. I am trying to fade out the searchButtonView while animating the change in the frame of searchBarView simultaneously within a UIView.animate block. However, when I run the app, the frame of searchBarView resizes correctly while the alpha of searchButtonView does not animate to 0 as expected. How can I fix this so that both view animate simultaneously? Please see my code below. Thank you class MovieTitlesViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } var searchButtonView: UIView! var searchBarView: UIView! override func viewDidLayoutSubviews() { createSearchButtonView() createSearchBarView() } func createSearchButtonView() { searchButtonView = UIView(frame: CGRect(x: 23, y: view.safeAreaInsets.top, width: 48, height: 48)) let searchImageView = UIImageView(image: UIImage(named: "Search Icon")!) searchImageView.frame = CGRect(x: searchButtonView.frame.width / 2 - 16, y: searchButtonView.frame.height / 2 - 16, width: 32, height: 32) searchButtonView.addSubview(searchImageView) searchButtonView.backgroundColor = .blue searchButtonView.layer.cornerRadius = 24 searchButtonView.layer.borderColor = UIColor.gray.cgColor searchButtonView.layer.borderWidth = 0.5 let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tappedSearchView)) tapGesture.numberOfTapsRequired = 1 searchButtonView.addGestureRecognizer(tapGesture) searchButtonView.isUserInteractionEnabled = true view.addSubview(searchButtonView) } func createSearchBarView() { searchBarView = UIView(frame: CGRect(x: 23, y: view.safeAreaInsets.top, width: 0, height: 48)) searchBarView.backgroundColor = .red // searchBarView.backgroundColor = UIColor(red: 217/255, green: 217/255, blue: 217/255, alpha: 1.0) searchBarView.layer.cornerRadius = 24 searchBarView.layer.borderColor = UIColor.gray.cgColor searchBarView.layer.borderWidth = 0.5 view.addSubview(searchBarView) } func animateExpandSearchView() { UIView.animate(withDuration: 0.25, delay: 0.0, options: .curveEaseInOut) { self.searchButtonView.alpha = 0.0 self.searchBarView.frame = CGRect(x: 23, y: self.view.safeAreaInsets.top, width: UIScreen.main.bounds.width - 46, height: 48) } } @objc func tappedSearchView() { print("tapped search view") animateExpandSearchView() } }
Topic: UI Frameworks SubTopic: UIKit
1
0
31
20h
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_TtGCs18_DictionaryStorageSSP__$ setFrame:]: unrecognized selector sent to instance 0x17ff59400'
We are facing some weird issue in the UILabel initialisation. Also it is occurring sometimes. class TextLabel: ConfigurableView<TextLabel.Config> { struct Config { var text: String = .empty var font: UIFont? var textColor: UIColor? var maxLines: Int = 0 var attributedText: NSAttributedString? var textAlignment: NSTextAlignment = .natural var truncateWithMore: Bool = false var onTapShowMore: (() -> Void)? var onTap: (() -> Void)? var accessibilityIdentifier: String? } private lazy var label: UILabel = { let label = UILabel() **//##### Crash is occurring in this line.** label.translatesAutoresizingMaskIntoConstraints = false label.adjustsFontForContentSizeCategory = true return label }() private lazy var tapGesture = UITapGestureRecognizer(target: self, action: #selector(onTap)) private var isTruncated = false override func setUp() { addSubview(label) label.equalsContainer() } override func layoutSubviews() { super.layoutSubviews() updateContent() } override func setConfig(_ config: Config) { super.setConfig(config) updateContent() } @objc func onTap() { if isTruncated { config?.onTapShowMore?() } else { config?.onTap?() } } func updateContent() { guard let config = config else { return } label.numberOfLines = config.maxLines label.text = config.text } } You can find my configurable view below. import UIKit class ConfigurableView<T>: UIControl { private(set) var config: T? init(_ config: T) { super.init(frame: .zero) setUp() setConfig(config) } override init(frame: CGRect) { super.init(frame: frame) setUp() } required init(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } func setUp() { } func setConfig(_ config: T) { self.config = config } } This crash is occurring randomly. Sometimes we could reproduce it in the app updates.
Topic: UI Frameworks SubTopic: UIKit
0
1
27
22h
AlarmKit SDK question
For the CountdownDuration initializer, since passing nil to both parameters of public init(preAlert: TimeInterval?, postAlert: TimeInterval?) is not considered valid, shouldn't the function signature be changed to be two separate inits, instead of a runtime error. EX: public init(preAlert: TimeInterval, postAlert: TimeInterval?) public init(preAlert: TimeInterval?, postAlert: TimeInterval)
Topic: UI Frameworks SubTopic: General
0
0
14
1d
Referencing IBOutlet to its class or to file's owner
In this Mac App, I have an IBOutlet (which is defined as instance of a subclass of NSView). When I connect the IBOutlet to the code, referencing as file's owner, it works OK. But if I reference to the class, it crashes, when I access a specific IBOutlet (but other IBOutlets are accessed just before it without crashing).. The IBOutlet turnPageControl is defined as instance of subclass of NSView. Note: I have implemented several init methods: override init(window: NSWindow!) { } required init?(coder: (NSCoder?)) { } // Yes, (NSCoder?) convenience init(parameters) { // loading from nib } override func windowDidLoad() { super.windowDidLoad() // Access turnpageControl I get those calls before crash: init(window:) init(parameters:) init(window:) windowDidLoad() -> crash inside on accessing the IBOutlet for turnPageControl.isHidden = true Is there any reason to this ?
1
0
36
1d
CoreText crash on iOS 26.0 Simulator (Xcode 26.2) when rendering string with zero-width non-joiner and combining marks
Environment: Xcode 26.2 Simulator: 26.0 / iPhone 17 Summary: Assigning a specific Unicode string to a UILabel (or any UITextView / text component backed by CoreText) causes an immediate crash. The string contains a visible base character followed by a zero-width non-joiner and two combining marks. let label = UILabel() label.text = "\u{274D}\u{200C}\u{1CD7}\u{20DB}" // ^ Crash in CoreText during text layout Crash stack trace: The crash occurs inside CoreText's glyph layout/shaping pipeline. The combining marks U+1CD7 and U+20DB appear to stack on the ZWNJ (which has no visible glyph), causing CoreText to fail during run shaping or bounding box calculation. Questions: Is this a known CoreText regression in the iOS 26.0 simulator? Is there a recommended fix or a more targeted workaround beyond stripping zero-width Unicode characters? Will this be addressed in an upcoming update
Topic: UI Frameworks SubTopic: General
3
0
82
1d
TimelineView using ExplicitTimelineSchedule ignores last date?
Hi, everyone. I'm trying my first TimelineView with an explicit schedule, but my attempt – and even the simple example from the documentation – doesn't seem to work as documented. Here's what the documentation says an explicit schedule does: The timeline view updates its content on exactly the dates that you specify, until it runs out of dates, after which it stops changing. And it gives this example: let dates = [ Date(timeIntervalSinceNow: 10), // Update ten seconds from now, Date(timeIntervalSinceNow: 12), // and a few seconds later. ] struct MyView: View { var body: some View { TimelineView(.explicit(dates)) { context in Text(context.date.description) } } } There are stipulations about what the view – which always displays some version of its content body – will do given only past or future dates, but it seems clear we should expect the view in this example to redraw at least once after it appears. Here's the rest of the discussion from the documentation with my comments after testing what's stated: If the dates you provide are in the past, the timeline view updates exactly once with the last entry. That seems true, considering the "update" to be the initial draw. If you only provide dates in the future, the timeline view renders with the current date until the first date arrives. Not exactly: it looks the "date" property of the initial render is the (future) date of the first schedule entry, even though it's drawn early. When the first date does arrive, the body closure doesn't seem to be called. Only on the next date, if there is one, is it called again. If you provide one or more dates in the past and one or more in the future, the view renders the most recent past date, refreshing normally on all subsequent dates. That also seems correct, except… … that in every scenario, the final date entry seems to be ignored completely! In other words, unless all date entries are in the past, the Timeline View stops before it runs out of dates. That documented example from the start, which we expect to redraw at least once after it appears? When I test it in a Playground, it appears, but doesn't redraw at all! So, that's my main point of confusion after experimenting with TimelineView for the first time. I can achieve my own goal by appending an extra entry to my explicit schedule – even appending an entry identical to the previous "final" entry seems to work – but naturally that leaves me unclear about why I need to. If anyone can tell me what I'm not understanding, I'd be grateful.
4
2
820
1d
UIKit Crash on iOS 18 when running tests on AWS Device Farm
1ada58e6-51b3-4cc5-98a3-31c8d1597de5.crash We are experiencing a segmentation fault crash when running our tests on AWS Device Farm. This crash only happens on iOS 18 and does not happen on iOS 26 also running on device farm. We have not been able to replicate this crash locally and we have not seen this in any of our production app usage. It appears there is some memory corruption going on and the trace always seems to crash inside Apple's UIKit code with -[UIImageSymbolConfiguration _initWithTraitCollection:]. I also see the following in the logs from CI: [TraitCollection] Class CKBrowserSwitcherViewController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API. We are not overriding traitCollection getter anywhere in our code and we have no usage of CKBrowserSwitcherViewController either. This crash happens when trying to go through the login flow to our app when KIF hits the login button. I have tried debugging with Zombies and the memory graph debugger but nothing is sticking out as to what would be causing this issue. When running locally with Zombies I do not get any memory warnings going through our login flow. Could this be a bug inside of UIKit on iOS18 which is getting exposed due to timing on AWS? Any help with next debugging steps would be appreciated.
Topic: UI Frameworks SubTopic: UIKit
0
1
34
1d
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
17
1d