Search results for

swiftui

16,584 results found

Post

Replies

Boosts

Views

Activity

Reply to .hidden not working when making UIBarButtonItem visibles on iOS 26
This is still a thing. I have a UIToolbar with some buttons in it. They are are created in Interface Builder. One is hidden. At runtime, something happens and I set hidden = NO to show that one button that is hidden and nothing happens. I see UIToolbar is now a wrapper on top of SwiftUI on iOS 26 so while this is disappointing this type of bug isn't really shocking. @N. Holzschuch Thanks for sharing. Setting the items like it's iOS 15.0 does the trick. I tried just resetting the property with a copy of the .items array but it didn't work. Adding a dummy bar button item then removing it seems to be required.
Topic: UI Frameworks SubTopic: General
Nov ’25
how to navigate programmatically without navigation link?
Hello. I'm making an app with several different views. I'm trying to switch views using a button but I can't seem to figure out how. I know Navigation Links work, but my case doesn't work. The reasons for this are because I need to run other code when they click the button and I don't want them to be able to navigate back (to CustomizationView/CreateAccountView). I know that you can hide the back button but my problem with that is the fact that i will be navigating to a view (MainView) that will also have navigation buttons in it, so if i'm thinking correctly, the button will be hidden but when they press the next navigationlink (in MainView) it will show again and then they can go back (to CustomizationView/CreateAccountView). i don't want them to go back because they will be navigating from a login/account view that wont be needed anymore. I'm currently using .fullScreenCover() and it works fine except for performance (I'm assuming). here's the code: import SwiftUI struct CustomizationView: View {
2
0
110
Nov ’25
Reply to Live Activity Shows Only Black Dynamic Island UI (No Content Rendering) — Widget Extension Receives Updates but SwiftUI UI Is Empty
Thanks for the reply! Just to clarify, even though the main app is built with Flutter, the Live Activity and widget extension are fully native Swift/SwiftUI and built in Xcode. The issue seems to be on the ActivityKit/WidgetKit side rather than the Flutter side. I’ve gone through Apple’s Live Activity tutorial and everything works except the actual UI rendering (Dynamic Island shows a black capsule even though the regions contain simple Text/Image views with no errors). I’m mainly hoping someone who’s run into a similar ActivityKit rendering issue can point out anything I may be missing in the widget extension setup. Any insights are appreciated!
Nov ’25
Live Activity Shows Only Black Dynamic Island UI (No Content Rendering) — Widget Extension Receives Updates but SwiftUI UI Is Empty
Hi all, very new developer trying to build my own app. The app works, just trying to improve it. I’m implementing a Live Activity in a widget extension (Swift/SwiftUI) for an app built with Flutter as the host app. ActivityKit is functioning correctly—activities start, update, and end normally, and the widget extension receives all state updates. However, the Live Activity UI renders as a completely black capsule (both compact and expanded Dynamic Island, as well as the Lock Screen presentation). The system shows the Live Activity container, but none of the SwiftUI content displays. Verified so far: ActivityAttributes contains at least one stored property (previously empty). ContentState fully Codable + Hashable. All Dynamic Island regions return visible test UI (Text/Image). No .containerBackground() usage. Added explicit .activityBackgroundTint() + system foreground colors. All Swift files included in widget extension target. No runtime errors, no decode failures, no SwiftUI logs.
3
0
137
Nov ’25
Severe Scroll Lag & Header Flickering in Complex SwiftUI Screen with Dynamic Content (GeometryReader + Scroll Direction Detection)
I’m working on a SwiftUI screen where I need to hide a header when the user scrolls down and show it again when the user scrolls up. I’m currently using a ScrollView combined with GeometryReader to detect scroll offset changes and update state variables like isScrolling or isScrollingDown. The issue is that the behavior is inconsistent. When I scroll down, the header hides correctly, but when I scroll back up, the header often doesn’t appear again even though the offset is changing. Sometimes the header comes back with a delay, and other times it never appears at all. Along with this, I’m also seeing noticeable UI lag whenever I try to calculate content height or read multiple geometry values inside the ScrollView. It looks like the frequent state updates inside the scroll offset tracking are causing layout recalculations and frame drops. I’ve tried placing the header in different positions (inside a ZStack aligned to the top, inside the VStack above the ScrollView, and with transitions like .push(fr
2
0
106
Nov ’25
Source item disappears after swipe-back with .navigationTransition(.zoom)
[Submitted as FB21078443] When using .matchedTransitionSource with .navigationTransition(.zoom), swiping back from the left edge to return from a detail view causes the source item to disappear once the transition finishes. It’s only a visual issue—the item is still there and can be tapped to open again. This doesn’t happen when using the Back button; only the swipe-back gesture triggers it. Also, it only reproduces on a physical device, not in Simulator. SYSTEM INFO Xcode 26.1.1 (17B100) macOS 26.1 (25B78) iOS 26.1 (23B85) iOS 26.2 (23C5044b) REPRO STEPS Run the code below on a physical device, tap an image, then swipe from the left edge to dismiss the detail view. ACTUAL The image zooms back to its origin, then disappears once the animation settles. EXPECTED The image card remains visible. SCREENSHOTS CODE import SwiftUI struct Item: Identifiable, Hashable { let id = UUID() let imageName: String let title: String } struct ContentView: View { @Namespace private var namespace let items = [ Item(image
Topic: UI Frameworks SubTopic: SwiftUI
2
0
104
Nov ’25
NavigationStack Back Button obscured in MacOS
A MacOS SwiftUI app using WindowGroup with a NavigationStack results in having the navigation title overlay the back button. Note that this does not occur if a tabbed interface is used. The work around is simply to hide the navigation bar back button and add a tool bar item that is custom back button. I found a fix on this forum, and it was similar to: #if os(macOS) .navigationBarBackButtonHidden(true) .toolbar { ToolbarItem(placement: .navigation) { Button(action: { dismiss() }) { Label(Back, systemImage: arrow.left.circle) } } } #endif modifying the NavigationLink targets and where the dismiss() function was provided by: @Environment(.dismiss) private var dismiss Is there any means to sign up for a notification to inform me that this bug has been fixed?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
136
Nov ’25
Reply to Apple-hosted managed asset pack not found on macOS
It appears to be correctly signed. Automatically manage signing is checked, my standard team is set. With those settings, as soon as I assign an app group in Xcode 26.1, it changes to an Xcode managed provisioning profile and my valid Apple Development certificate and does not let me change them. I also checked the build with codesign -dv --verbose=4 and in ~/Library/Developer/Xcode/UserData/Provisioning Profiles to verify and that the profiles update, e.g., when I change the Info.plist. I also tried setting up a fresh sample project from the standard multiplatform SwiftUI app template in Xcode and did not change anything in Signing & Capabilities except setting the app group for the app and download extension. Same minimal app just calling AssetPackManager.shared.assetPack(withID:), same result: on iOS it works, on macOS the URL override is not permitted.
Nov ’25
Recommended Way to Implement Digital Crown Zoom + Drag for Images on watchOS
I’m trying to implement smooth zoom and drag interactions for an image on watchOS—similar to the Photos app. DTS recommended using digitalCrownRotation + scaleEffect in SwiftUI, and ChatGPT also suggests a similar approach. However, the experience still isn’t as smooth or polished as the Photos app. Before I commit fully to this direction, I want to confirm: 1. Is SwiftUI with digitalCrownRotation, scaleEffect, and DragGesture the officially recommended approach for zoom + pan on watchOS? 2. Is there any public API that provides built-in Photos-style behavior, or is a custom SwiftUI implementation expected? 3. Are there best-practice patterns for smooth scaling, maintaining image bounds, and constrained panning? Thanks for any guidance
Topic: UI Frameworks SubTopic: SwiftUI
1
0
91
Nov ’25
Reply to Recommended Way to Implement Digital Crown Zoom + Drag for Images on watchOS
Yeah, SwiftUI is the officially recommended UI framework for watchOS app development. This is mentioned in TN3157. I don't see any system-provided API that provides a view behaving like Photos. That's something you need to implement in your app. Regarding the best practices, folks who have something to say may weigh in, but I think the ask is quite broad. I guess you might go ahead to create a prototype, and follow up here if you see any specific issue along the path. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI
Nov ’25
Reply to how to navigate programmatically without navigation link?
Use navigationDestination(isPresented:destination:) and hide the Back button at the destination View? import SwiftUI struct ContentView: View { @State var goToHello = false var body: some View { NavigationStack { Button { goToHello = true } label: { Text(Go to Hello?) } .navigationDestination(isPresented: $goToHello) { HelloView() } } } } #Preview { ContentView() } struct HelloView: View { var body: some View { NavigationStack { VStack { Text(Hello!) } .navigationBarBackButtonHidden() } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
Unable to create SwiftUI previews in Xcode 26 for iOS 15.5
I am getting this error msg when I try to run a SwiftUI Preview on an iOS 15.5 simulator: Termination Reason: Namespace DYLD, Code 1, Library missing | Library not loaded: /usr/lib/swift/libswift_StringProcessing.dylib | Referenced from: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libLiveExecutionResultsLogger.dylib | Reason: tried: '/Users/hfg/Library/Developer/Xcode/DerivedData/Testios15sim-aawlbfbtggzozseoekycwwpadhrc/Build/Intermediates.noindex/Previews/iphonesimulator/Testios15sim/Products/Debug-iphonesimulator/libswift_StringProcessing.dylib' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswift_StringProcessing.dylib' (no such file), '/usr/lib/swift/libswift_StringProcessing.dylib' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libswift_StringProcessing.dylib' (no
1
0
133
Nov ’25
'tabViewBottomAccessory' leaves an empty accessory area when conditionally hidden
We use SwiftUI's .tabViewBottomAccessory in our iOS apps for displaying an Audio MiniPlayer View (like in the Apple Music App). TabView(selection: $viewModel.selectedTab) { // Tabs here } .tabViewBottomAccessory { if viewModel.showAudioMiniPlayer { MiniPlayerView() } } The Problem This code works perfectly on iOS 26.0. When viewModel.showAudioMiniPlayer is false, the accessory is completely hidden. However, on iOS 26.1 (23B5059e), when 'viewModel.showAudioMiniPlayer' becomes false, the MiniPlayerView disappears, but an empty container remains, leaving a blank space above the tab bar. Is this a known Bug in iOS 26.1 and are there any effective workarounds?
Topic: UI Frameworks SubTopic: SwiftUI
8
0
793
Nov ’25
Layout issues occur when the Picker style is segmented on macOS.
When I run the following code and change Is On, I get a problem with the layout of the Picker. There is no problem when using Text(), but when using only Image, it works fine on iOS but there is a problem on macOS. Tested on macOS 26.1, Xcode 26.1. import SwiftUI struct ContentView: View { @State var model = Model() var body: some View { Form { Picker(Category, selection: $model.category) { ForEach(Category.allCases) { item in Image(systemName: item.icon) .tag(item) } } .pickerStyle(.segmented) Toggle(Is On, isOn: $model.isOn) } .formStyle(.grouped) } } struct Model { var category: Category = .a var isOn: Bool = false } enum Category: Int, Identifiable, CaseIterable { case a, b, c var id: Int { rawValue } var icon: String { switch self { case .a: return a.circle.fill case .b: return b.circle.fill case .c: return c.circle.fill } } var name: String { switch self { case .a: return a case .b: return b case .c: return c } } } code-block
1
0
54
Nov ’25