Search results for

swiftui

16,633 results found

Post

Replies

Boosts

Views

Activity

.tabBarMinimizeBehavior(.onScrollDown) not triggering in tabs that use NavigationStack(path:) (iOS 26 / Xcode 26 beta 7)
Environment iOS 26.0 (device), Xcode 26 beta 7 SwiftUI TabView using the new Tab(…, value:) API iPhone only (aware that minimize is iPhone-only) Issue .tabBarMinimizeBehavior(.onScrollDown) only works reliably in my Settings tab. In my other tabs (Dashboard / Games / Help), the tab bar does not minimize when scrolling, even though the content is scrollable. The main difference: those tabs are wrapped in a NavigationStack(path:) with a bound NavigationPath. Settings has no path binding. Repro (minimal) import SwiftUI enum TabSel: Hashable { case dashboard, games, settings } struct Root: View { @State private var selection: TabSel = .dashboard // Per-tab paths @State private var dashPath = NavigationPath() @State private var gamesPath = NavigationPath() var body: some View { if #available(iOS 26, *) { TabView(selection: $selection) { // ❌ Does NOT minimize when scrolling SwiftUI.Tab(Dashboard, systemImage: square.grid.2x2.fill, value: .dashboard) { NavigationStack(path: $dashPath) { ScrollView
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2
0
287
Sep ’25
Reply to Navigation Title no longer showing for first Tab in iOS/iPadOS 26
iOS 26 Navigation Title Not Displaying - Solution Problem Description After updating to iOS 26 beta, navigation titles stopped displaying in some of our SwiftUI views, while others continued to work. The affected views showed no navigation bar - the title, large title display mode, and toolbar items were not visible. This behavior is different from iOS 18, where the same code displays navigation titles as expected. Affected Configuration iOS Version: iOS 26 beta (all current betas through beta 7) SwiftUI: NavigationStack with .navigationTitle() and .navigationBarTitleDisplayMode(.large) Specific Pattern: Views where ScrollView or Form is the direct child of the view body The Change in Behavior In iOS 26, when a view's body directly returns a ScrollView or Form, the navigation title doesn't appear. Here's an example of code that displays the navigation title in iOS 18 but not in iOS 26: struct DashboardView: View { var body: some View { ScrollView { LazyVStack { // Your content here } } .navi
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to WebView makes website content unaccessible on the top/bottom edges
@DTS Engineer That's great to hear! I'll definitely be on the lookout for OS 26 betas to see if it gets fixed and I'll remove the workarounds that I've added. Do you know if the issue is WebKit related or SwiftUI related? Asking because if it's WebKit, it might be available on the WebKit bug tracker that's publicly available, and rather than needing to check on every beta, I could keep an eye on the bug ticket to see what's the progress! Either way, thanks again for looking into this! Can't wait for it go get fixed, it'll make my app looks so much better! 🤞
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to hidesBottomBarWhenPushed in iOS 26
Hi team, I found another werid issue in iPad OS 26 only. I can easily reproduce it with a simple example app even in iPadOS 26 RC. I've submitted a feedback FB20215332, could you have a look? Thanks! We have a UITabBarController which contains two tabs. The first tab is a UINavigationController which includes ViewControllerA and ViewControllerB The second tab is just a simple UIViewController ViewControllerC We set the self.traitOverrides.horizontalSizeClass = .compact in TabBarController because we don't want to show the new style of tab bar. We set the hidesBottomBarWhenPushed to true for ViewControllerB when pusing from ViewControllerA because we don't want the tab bar to show in the navigation flow. Also, there is a button in ViewControllerB and it can navigate to ViewControllerC. However, when we tap the button in ViewControllerB, it did navigate to ViewControllerC but the TabBar is missing and at this point we have to kill the app, otherwise we cannot do anything. As I mentioned above, this issue only h
Topic: UI Frameworks SubTopic: UIKit
Sep ’25
TextEditor Problem Or Me?
When using SwiftUI's TextEditor, the application crashes immediately on launch. This occurs even in a brand new project with the simplest usage. If I remove the TextEditor, the application runs normally. Environment: OS: macOS 15.6.1 Xcode: 16.4 SDK: macOS 14 (and also tried with macOS 15 SDK) Steps to Reproduce: Create a new SwiftUI macOS App project. Replace ContentView with the following code: import SwiftUI struct ContentView: View { @State private var text = 114514 var body: some View { TextEditor(text: $text) } } Run the app. Expected Result: The app should display a working TextEditor. Actual Result: The app immediately crashes, and the debugger shows a Metal assertion error. If I remove the TextEditor, the app works fine. Screenshot: Additional Notes: This issue did not occur on macOS 14 / Xcode 15.4. It reproduces even in an empty project. Possibly related to SwiftUI/Metal integration on macOS 15.6.1. 這樣寫更專業、清楚,Apple 工程師能快速重現和定位問題。 如果你要用中文回報也可以,我能幫你翻譯。
Topic: UI Frameworks SubTopic: SwiftUI
4
0
148
Sep ’25
Reply to SwiftUI Table Header Background not appearing in iPadOS 26
Hi @DTS Engineer I included the exact sample code to reproduce this problem in my original post. It is a self-contained example snipped that can be previewed in Xcode. For reference, let me include it again: import SwiftUI struct TablePreviewContent: Identifiable { var id: Int { text.hashValue } var text: String } #Preview { let content = [TablePreviewContent(text: Hello), TablePreviewContent(text: World)] Table(content) { TableColumn(Title, value: .text) } } Previewing this on iPadOS 26 as well as iPadOS 18.5 within Xcode 26 (Release Candidate, Version 26.0 (17A321)) results in the output I shared in the screenshot above. Please note that this request is regarding SwiftUI.Table and not SwiftUI.List.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
URLSession is broken in iOS 18.4 RC Simulator
I'm seeing fully reproducible issues with URLSession on iOS 18.4 RC Simulator running from Xcode 16.3 RC. URLSession seems to get into a broken state after a second app run. The following sample succeeds in fetching the JSON on first app run but when the app is closed and ran again it fails with one of these errors: Error: Error Domain=NSURLErrorDomain Code=-1005 The network connection was lost. Error: Error Domain=NSURLErrorDomain Code=-1001 The request timed out. I'm wondering if this something related to my OS setup or is this due to internal URLSession changes in iOS 18.4. Already submitted as FB17006003. Sample code attached below: import SwiftUI @main struct NetworkIssue18_4App: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var message: String = var body: some View { VStack { Text(message) Button(Try Again) { Task { await fetch() } } } .task { await fetch() } } private func fetch() async { message = Loading... let url = URL(string: htt
55
0
23k
Sep ’25
Reply to SwiftUI Table Header Background not appearing in iPadOS 26
Thank you for sharing your post. I am unable to view your code for the Table and the customization you are implementing. For a simple list, you can utilize the code provided below, which will generate a list on the main body. However, it would be beneficial to observe the specific customization you are making to achieve that behavior. Additionally, could you please provide the Xcode version and beta number you are using? import SwiftUI struct ContentView: View { var body: some View { Text(Title) NavigationStack { List { Text(Hello) Text(World) } } } } #Preview { ContentView() } Resources: https://developer.apple.com/documentation/swiftui/list Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
Reply to Copy/Paste files between File App iOS device and External Storage Device
On iOS, your app is sandboxed, and hence doesn't have access to a file outside of its app sandbox. When you select the file using UIDocumentPickerViewController (or the SwiftUI counterpart fileImporter), the system automatically extends the app sandbox to the file, which allows the access to your app. From there, your app can grab and save the security-scoped bookmark of the file URL, and use it to access the file next time, without user interaction anymore. See Enabling Security-Scoped Bookmark and URL Access, if needed. The app sandbox is to protect resources and improve the security. There is no way to bypass the protection, and so the answer to your question is no. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’25
High CPU Usage in SwiftUI UIHostingController on iOS 26 Beta
Experiencing 100% CPU usage in SwiftUI app using UIHostingController, only on iOS 26 beta and Xcode beta. Issue involves excessive view updates in AttributeGraph propagation. Stack trace (main thread): thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP frame #0: 0x00000001c38b9aa4 AttributeGraph`AG::Graph::propagate_dirty(AG::AttributeID) + 416 frame #1: 0x00000001d9a743ec SwiftUICore`SwiftUI.ObservationGraphMutation.apply() -> () + 656 frame #2: 0x00000001d97c0d4c SwiftUICore`function signature specialization () in SwiftUI.(AsyncTransaction in _F9F204BD2F8DB167A76F17F3FB1B3335).apply() -> (), Argument Types : [SwiftUI.AsyncTransaction]> of generic specialization <()> of closure #1 () throws -> τ_0_0 in SwiftUI.withTransaction<τ_0_0>(SwiftUI.Transaction, () throws -> τ_0_0) throws -> τ_0_0 + 336 frame #3: 0x00000001d9a6ac80 SwiftUICore`merged function signature specialization of function signature specialization () in implicit closure #1
7
0
420
Sep ’25
Reply to SwiftUI Slider will cause app to crash on macOS Tahoe RC
Using a UIViewRepresentable like this works, but the Liquid Glass animations for the slider look very wonky and choppy. On slider release there isn't even an animation at all. import SwiftUI import UIKit struct ContentView: View { @State private var sliderValue: Double = 0.48 var body: some View { VStack { VStack { SafeSlider(value: $sliderValue, range: 0...1.18, step: 0.01) Text(Value: (sliderValue, specifier: %.2f)) } .frame(maxWidth: 128) } .padding() } } struct SafeSlider: View where Value.Stride: BinaryFloatingPoint { @Binding var value: Value var range: ClosedRange = 0...1 var step: Value = 0 var onEditingChanged: (Bool) -> Void = { _ in } var body: some View { #if targetEnvironment(macCatalyst) if #available(macOS 26.0, *) { SliderWrapper(value: $value, range: range, step: step, onEditingChanged: onEditingChanged) } else { defaultSlider } #else defaultSlider #endif } private var defaultSlider: some View { Slider(value: $value, in: range, step: Value.Stride(step), onEditingChanged: onEditing
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25
iOS 26 - ToolbarItem with .keyboard placement adds additional positive/negative top margin
Since iOS 26, when using toolbar items with .keyboard placement, the view inside the hierarchy which is pushed, does not directly stick to the toolbar anymore when a text field is focused, creating a gap, or moving the view below the toolbar. Focusing another field pushes the layout below the toolbar. Minimal example to reproduce the issue. import SwiftUI import Foundation @main struct testfocusApp: App { @State var showSheet = false var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { enum Field: Hashable { case body case title } @State var titleText = @State var bodyText = @FocusState private var focusedField: Field? var body: some View { NavigationView { VStack(spacing: 0) { ScrollView { VStack(spacing: 16) { TextField(, text: $titleText) .onSubmit { focusedField = .body } .background(Color.red) .focused($focusedField, equals: .title) VStack(spacing: 0) { VStack { Text(bodyText) .padding(.vertical, 9) .padding(.horizontal, 5) .hidden() TextEditor( text: $bodyText )
1
0
255
Sep ’25