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

iOS26 beta ToolbarItem with placement to principal width is not fill to screen
I’m trying to add a TextField to the toolbar using .principal placement, and I want it to either fill the screen width or expand based on the surrounding content. However, it’s not resizing as expected — the TextField only resizes correctly when I provide a hardcoded width value. This behavior was working fine in previous versions of Xcode, but seems to be broken in Xcode 26. Not sure if this is an intentional change or a bug. i am using iOS26 beta and Xcode 26 beta struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() .toolbar { ToolbarItem(placement: .principal) { HStack { TextField("Search", text: .constant("")) .textFieldStyle(.roundedBorder) .frame(maxWidth: .infinity) // .frame(width: 300) Button("cancel") { } } .frame(maxWidth: .infinity) } } } } #Preview { NavigationView { ContentView() } }
0
0
264
Jun ’25
zoom navigationTransition breaks navigation title
When combining a zoom navigationTransition with a List in a NavigationStack we end up getting the navigationTitle not properly re-positioning itself on dismiss/back. It looks like a visual bug/glitch (unless I missed something). This seems to not happen with a ScrollView import SwiftUI struct Item: Identifiable { let id: UUID = UUID() } struct ContentView: View { @State private var selected: Item? @Namespace private var animation var body: some View { NavigationStack { List { ForEach((0..<50).map { _ in Item() }, id: \.id) { item in Button { selected = item } label: { Text(item.id.uuidString) .frame(maxWidth: .infinity, alignment: .leading) } .matchedTransitionSource(id: item.id, in: animation) } } .navigationTitle("Title") .navigationSubtitle("Subtitle") } .fullScreenCover(item: $selected) { item in Text(item.id.uuidString) .frame(maxWidth: .infinity) .navigationTransition(.zoom(sourceID: item.id, in: animation)) } } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: SwiftUI
0
1
110
Sep ’25
SwiftUI's `WebPage` back navigation not working as expected
I'm currently testing SwiftUI's WebKit by building a browsing application. For the back navigation, I have the following code implemented: if let item = webPage.backForwardList.backList.last { webPage.load(item) print( """ ===== backForwardList.backList: \(webPage.backForwardList.backList) --- backForwardList.currentItem: \(webPage.backForwardList.currentItem) --- backForwardList.forwardList: \(webPage.backForwardList.forwardList) ===== """.trimmingCharacters(in: .whitespacesAndNewlines) ) } When I look at the logs, it shows that whenever I navigate back, the currentItem is updated with the item, but the backList is appended with the previous currentItem, and the forwardList is always empty. Am I implementing this incorrectly? Thanks in advance!
0
0
123
Sep ’25
SCStreamUpdateFrameContentRect X coordinate always returns 48 instead of expected 0
SCStreamUpdateFrameContentRect X coordinate always returns 48 instead of expected 0 Environment Device: MacBook Pro 13-inch macOS: Sequoia 15.6.1 Xcode: 16.4 Framework: Screen Capture Kit Issue Description I'm experiencing an unexpected behavior with Screen Capture Kit where the SCStreamUpdateFrameContentRect X coordinate consistently returns 48 instead of the expected 0. Code Context I'm using SCContentSharingPicker to capture screen content and implementing the SCStreamOutput protocol to receive frame data. In my stream(_:didOutputSampleBuffer:of:) method, I'm extracting the content rect information from the sample buffer attachments: func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType) { switch type { case .screen: guard let attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, createIfNecessary: false) as? [[SCStreamFrameInfo: Any]] else { return } guard let attachments = attachmentsArray.first else { return } if !attachments.keys.contains(.contentRect) { return } print(attachments) // X coordinate always shows 48 /* , __C.SCStreamFrameInfo(_rawValue: SCStreamUpdateFrameContentRect): { Height = 540; Width = 864; X = 48; <<-- unexpected offset Y = 0; }] */ return // ... other cases } } Expected vs Actual Behavior Expected: X coordinate should be 0 (indicating the content starts at the left edge of the screen) Actual: X coordinate is consistently 48 Visual verification: When I display the captured screen content, it appears correctly without any offset, suggesting the actual content should indeed start at X=0 Additional Information The picker is configured with .singleDisplay mode I'm excluding the current app's bundle ID from capture The captured content visually appears correct, only the reported coordinates seem off Main ViewModel Class import Foundation import ScreenCaptureKit import SwiftUICore class VM: NSObject, ObservableObject, SCContentSharingPickerObserver, SCStreamDelegate, SCStreamOutput { @State var isRecording = false // Error handling delegate func stream(_ stream: SCStream, didStopWithError error: Error) { DispatchQueue.main.async { self.isRecording = false } } var picker: SCContentSharingPicker? func createPicker() -> SCContentSharingPicker { if let p = picker { return p } let picker = SCContentSharingPicker.shared picker.add(self) picker.isActive = true SCContentSharingPicker.shared.present(using: .display) return picker } var stream: SCStream? let videoSampleBufferQueue = DispatchQueue(label: "com.example.apple-samplecode.VideoSampleBufferQueue") // observer call back for picker func contentSharingPicker(_ picker: SCContentSharingPicker, didUpdateWith filter: SCContentFilter, for stream: SCStream?) { if let stream = stream { stream.updateContentFilter(filter) } else { let config = SCStreamConfiguration() config.capturesAudio = false config.captureMicrophone = false config.captureResolution = .automatic config.captureDynamicRange = .SDR config.showMouseClicks = false config.showsCursor = false // Set the frame rate for screen capture config.minimumFrameInterval = CMTime(value: 1, timescale: 5) // 10 FPS self.stream = SCStream(filter: filter, configuration: config, delegate: self) do { try self.stream?.addStreamOutput(self, type: .screen, sampleHandlerQueue: self.videoSampleBufferQueue) } catch { print("\(error)") } self.stream?.updateContentFilter(filter) DispatchQueue.main.async { self.stream?.startCapture() } } } func contentSharingPicker(_ picker: SCContentSharingPicker, didCancelFor stream: SCStream?) {} func contentSharingPickerStartDidFailWithError(_ error: any Error) { print(error) } func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType) { switch type { case .screen: guard let attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, createIfNecessary: false) as? [[SCStreamFrameInfo: Any]] else { return } guard let attachments = attachmentsArray.first else { return } if !attachments.keys.contains(.contentRect) { return } print(attachments) return case .audio: return case .microphone: return @unknown default: return } } func outputVideoEffectDidStart(for stream: SCStream) { print("outputVideoEffectDidStart") } func outputVideoEffectDidStop(for stream: SCStream) { print("outputVideoEffectDidStop") } func streamDidBecomeActive(_ stream: SCStream) { print("streamDidBecomeActive") } func streamDidBecomeInactive(_ stream: SCStream) { print("streamDidBecomeInactive") } }
0
0
82
Sep ’25
How to disable scrollToTop when clicking on selected tab
I currently have a SwiftUI TabView that has 5 Tab's. The first tab has a UIScrollView in a UIViewRepresentible with scrollView.scrollsToTop = false and that works fine for when the user hits the navigation bar, however if the user taps the first tab when it is already selected my UIScrollView scrolls to top. My UIScrollView is essentially 5 views, a center view, top, bottom, right, and left view. All views except for the center are offscreen but available for the user to scroll horizontal or vertical (and the respective views get updated based on the new center view). The issue I have is that clicking the first tab when its already selected, sets the content offset (for the y axis) to 0, which messes me up 2x, first it scrolls up but since its not really scrolling the right, left, and upper views dont exist, which makes the user think it can't be scrolled or it's broken. For now I subclassed UIScrollView like this class NoScrollToTopScrollView: UIScrollView { override func setContentOffset(_ contentOffset: CGPoint, animated: Bool) { if contentOffset.y == .zero { // Ignore SwiftUI’s re-tap scroll-to-top return } super.setContentOffset(contentOffset, animated: animated) } } which seems to work, but I'm just wondering if there is a better way to do this, or maybe a way to disable SwiftUI Tab from doing its default action which can help with a SwiftUI ScrollView as well?
0
0
129
Sep ’25
Record microphone in a Keyboard app (in the background)
I'm currently I'm working on an iOS app + custom keyboard extension, and I’m hoping to get some insight into how to best architect a workflow where the keyboard acts as a remote trigger for dictation, but the main app handles the actual microphone recording and transcription. I know that third-party keyboards are sandboxed and can’t access the microphone directly, so the pattern I’m following is similar to what Wispr Flow appears to be doing: What I'm Trying to Build The user taps a mic button in the custom keyboard (installed system-wide). This triggers the main app to open, start a recording session, and send the audio to my transcription endpoint (not using Speech.framework). Once the transcription result is ready, it's stored in an App Group shared container. The keyboard extension polls for or receives the transcribed text and inserts it into the current input field via textDocumentProxy.insertText(...). Key Questions Triggering App Dictation from Keyboard Is there a clean system-native way to transition from the keyboard to the main app and back? Are there best practices around?: Preventing jarring transitions (keyboard disappearing)? Letting the app record in the background once triggered (see below)? Keeping the App Alive During Audio Recording Once the main app is opened to handle the dictation: I want it to record audio continuously (sometimes for up to a minute or 2 ), send it to an external transcription API, and return the result. However, from what I have read, iOS aggressively suspends or kills apps that are not in the foreground or haven’t requested the correct background modes - especially if there are background tasks running for longer than 30 seconds. Even with audio enabled in Background Modes and a live AVAudioEngine session, I find that the app is sometimes paused or killed after a few seconds; especially when the user switches back to the app where they want to type. But apps like Wispr Flow seem to manage this well. Their flow allows the user to record voice and insert it seamlessly without the app being terminated mid-recording. So: ✅ How do I prevent my app from being killed/suspended while it's recording, especially when the user switches back to the original app? Do I need: A background AVAudioSession hack? Audio playback tricks (e.g. silent audio)? A workaround using CallKit (some apps seem to use it for persistent audio sessions)? Something else Apple allows but doesn’t document clearly (or I am just a bad sercher)? Returning Text to the Keyboard Extension I’m using UserDefaults(suiteName:) in the App Group to pass the transcription result. Is that still the recommended approach? Would it be better to use a shared file (for larger data or richer metadata)? Are there any timing issues I should be aware of, e.g. like race conditions, stale reads, etc.?
0
0
204
Sep ’25
SwiftUI Nav Bar Changes in Height When Loading While Presented in a Sheet
If you create a SwiftUI App where a ‘.sheet’ is presented and use a NavigationStack within that Sheet, when you use NavigationLink to present a view, the title of the Nav Bar will start at a height of 46px and pop to the Default Height of 54px when it loads causing a visual pop in the UI. In iOS 18 it functions correctly, in iOS 26 the visual pop is present. This impacts both inline and large styles, if you disable the back button it is still present, the only way I have discovered to get rid of it is by using 'fullScreenCover' instead of '.sheet'. This feels like buggy UI. This issue has been present since iOS 26 Beta 5, I was hoping it would be fixed but is still present in the GM. Feedback has been filed via Feedback Assistant: FB20228369 This is the code to re-produce the issue: import SwiftUI struct ContentView: View { @State private var showSheet: Bool = false var body: some View { VStack { Button { showSheet.toggle() } label: { Text("Show Sheet") } } .padding() .sheet(isPresented: $showSheet) { NavigationStack { List { NavigationLink { Rectangle() .foregroundStyle(.red) .navigationTitle("Red") } label: { Text("Show Red") } } } .presentationSizing(.page) } } } #Preview { ContentView() }
0
1
323
Sep ’25
Inconsistent button image scaling between dynamic type sizes 'XXX Large' and 'AX 1'
[Also submitted as FB20262774. Posting here in hopes of saving someone else from burning half a day chasing this down.] Dynamic scaling of an Image() in a Button(), incorrectly decreases when transitioning from XXX Large to AX 1 accessibility text sizes, instead of continuing to grow as expected. This occurs both on device and in the simulator, in iOS 18.6 and iOS 26. Repro Steps Create a project with sample code below Show the preview if not showing In Xcode Preview, click Canvas Device Settings and change Dynamic Type from XXX Large to AX 1 Sample Code struct ContentView: View { var body: some View { VStack(spacing: 30) { Text("Button Image Scaling Issue") .font(.system(size: 24, weight: .semibold)) Text("Switch dynamic type from **XXX Large** to **AX 1**. The **Button** icon shrinks while the **No Button** icon grows.") .font(.system(size: 14, weight: .regular)) TestView(title: "No Button", isButton: false) TestView(title: "Button", isButton: true) } .padding() } } struct TestView: View { let title: String let isButton: Bool var body: some View { VStack { Text(title) .font(.system(size: 16)) .foregroundColor(.secondary) if isButton { Button {} label: { Image(systemName: "divide") .font(.system(.largeTitle)) } .buttonStyle(.bordered) .frame(height: 50) } else { Image(systemName: "divide") .font(.system(.largeTitle)) .foregroundColor(.blue) .frame(height: 50) .background(Color.gray.opacity(0.2)) } } } } Expected Result Both the button and non-button images should continue to scale up proportionally when moving to larger accessibility text sizes. Actual Result When going from XXX Large to AX 1… Non-button image gets larger ✅ Button image gets smaller ❌ Screen Recording System Info Xcode Version 26.0 (17A321) iOS 26.0 and 18.6
0
0
192
Sep ’25
.safeAreaBar doesn't look good together with .searchable
When using .scrollEdgeEffectStyle(.hard, for: .top), search bar background doesn't match with . safeAreaBar view background (you can see that is is darker than the rest of the toolbar). Please find the screenshot in the attachment iOS 26 RC Light Mode Feedback ID - FB19768159 import SwiftUI struct ContentView: View { @State private var count = 0 var body: some View { NavigationStack { ScrollView(.vertical) { ForEach(0..<100) { index in Text("\(index)") .background(.red) } } .scrollEdgeEffectStyle(.hard, for: .top) .searchable( text: .constant(""), placement: .navigationBarDrawer(displayMode: .always) ) .safeAreaBar(edge: .top) { Text("Safe area bar") } } } } #Preview { ContentView() }
0
0
109
Sep ’25
Bug: Black Pixel Flicker When Using glassEffect() with Animation
When using .glassEffect(.clear, in: .circle) with animation in a View, there is a chance that black pixel blocks flash on the screen. The abnormal effect can be seen in the attached video and screenshots.FB20216507 Code is as follows: VStack { if isLoaded { VStack { if #available(macOS 26.0, *) { Color.clear .frame(maxWidth: .infinity, maxHeight: .infinity) .glassEffect(.clear, in: .circle) } } .transition(.asymmetric(insertion: .scale, removal: .opacity)) } } .animation(.bouncy, value: isLoaded)
Topic: UI Frameworks SubTopic: SwiftUI
0
0
157
Sep ’25
Alert Closures Not Firing + Navigation Animations Broken
Hi, I hope you are doing well. We have been running up against an issue in our application which despite our best efforts we cannot seem to solve. After a certain point of use (of which we cannot seem to isolate a trigger), something internally with the way SwiftUI handles animation transactions seems to be breaking. This results in the following behavior that we (and our users) are noticing: Alerts/Sheets/NavigationPath changes lose all animations Closures associated with buttons no longer fire at all. The alert disappears, but with no animation and any action associated with the button selected does nothing. This results in an infinite loop of triggering an alert, clicking on an alert action, and the alert dismissing without the corresponding action ever occurring. We have tried moving the navigationPath out of a view model (Observable) and into a @State variable on the view in case it was an issue with view pre-rendering due to path changes, but this did not improve our case. We hoisted the state and the alert presentation out of all subviews and onto the root view of our navigation destination (as this happens on a sub-page of the application) as well, and while did this seem to minimize occurrences it did not fully resolve it. The app structure of our watch app is as follows: We have a NavigationStack at the root level which wraps a TabView, containing 3 pages. Selecting a button triggers a navigation destination, presenting a detail view. The detail view is a ZStack which switches on a property contained in an @State Observable view model scoped to the detail view. The ZStack can contain one of 5 subviews, derived from a viewState enum with associated values (all of which are equatable, and by extension viewState is also an equatable type as well). One of the subviews receives a binding, which on button trigger updates the binding and thus the view containing the ZStack presents the alert. Sometimes, when this happens, the animations break, and then are subsequently broken for the remainder of the lifetime of the app until it is force-closed (not backgrounded, but a full force-close). NavigationStack { TabView { Tab1 Tab2 // triggers navigationDestination Tab3 } .navigationDestination(for:) { DestinationView() // the view containing the ZStack + Alert } } STEPS TO REPRODUCE Unfortunately we have not been able to ascertain exactly what is causing this issue as we cannot reproduce it in a sandbox environment, only when moving through the view flow associated with our code. Any debugging ideas or recommendations would be greatly appreciated, as we have already tried _printChanges and do not notice any erroneous view redraws.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
85
Sep ’25
[Want] A View detects one from multiple custom Gestures.
SwiftUI Gesture cannot detect one of multiple gestures. I made a library for it because no default functions for it exists and I need it for my app. https://github.com/Saw-000/SwiftUI-DetectGestureUtil I want to use a function like this library with "import SwiftUI". The function is needed in the core maybe, isn't it?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
128
Nov ’25
SwiftUI List optional refreshable
Currently refreshable modifier does not support nil as a value and there's no way of disabling refreshable without recreating the whole view. There are a few posts showing how refreshable could be optionally disabled on scrollViews using: \EnvironmentValues.refresh as? WritableKeyPath<EnvironmentValues, RefreshAction?> https://stackoverflow.com/a/77587703 However, this approach doesn't seem to work with Lists. Has anyone find any solutions for this?
0
0
172
Sep ’25
Modelactors, Repository and bootloader
In iOS 26, should we have bootloader that runs the repo on startup - or should we have that inside tasks in root view? we have repos that runs as a «closed» functions, we dont throw but updates swiftdata and we use @query in the views. So what is best? and for the repo we should have a repo that runs the upserts manage relations eg? Should that run on a modelactor?
0
0
221
Sep ’25
Changing the color of SwiftUI Link
Hi, I have trouble changing the color of the text of Link in SwiftUI. I tried with this code: Link("https://www.mylink.com/", destination: URL(string: "https://www.mylink.com/")!) .foregroundColor(Color.green) and this code: HStack(spacing: 0) { Link("https://www.mylink.com/", destination: URL(string: "https://www.mylink.com/")!) } .foregroundColor(Color.green) The link keeps getting the accent color. EDIT: I want to add that it used to work and I think the issue came with a beta of Xcode 26. I think that was around the beta 4 or beta 5. Is it a change of the APIs or a bug?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
123
Sep ’25
The sidebar toggle of the NavigationSplitView disappears when used with a .inspector modifier on iPadOS 26
If the NavigationSplitView on iPadOS 26 is combined with a .inspector column, the sidebarToggle is always hidden, when the sidebar is collapsed. If you remove the .inspector modifier, the sidebarToggle stays visible throughout the collapsed or expanded state. Has maybe someone a workaround for this issue? The problem does not exist in iOS 18. The bug is reported as FB20061260
0
1
77
Sep ’25
SwiftUI: .searchable displays incorrectly in child views under NavigationStack
There appears to be a visual bug when using .searchable in a child view that’s pushed via NavigationLink inside a NavigationStack. Specifically, the search bar appears briefly in the wrong position (or animates in an unexpected way) during the transition to the child view. This issue does not occur when using NavigationView instead of NavigationStack. Steps to Reproduce: Create a TabView with a single tab containing a NavigationStack. Push from a ContentView to a DetailsView using NavigationLink. Add a .searchable modifier to both the ContentView and DetailsView. Run the app and tap a row to navigate to the details view. Expected Behavior The search bar in the DetailsView should appear smoothly and in the correct position as the view transitions in, just like it does under NavigationView. Actual Behavior When the DetailsView appears, the search bar briefly animates or appears in the wrong location before settling into place. This results in a jarring or buggy visual experience. Feedback: FB17031212 Here is a reddit thread discussing the issue as well https://www.reddit.com/r/SwiftUI/comments/137epji/navigation_stack_with_search_bar_has_a_bug_and_a/ I hope that an Apple engineer can get this fixed soon. It's frustrating to have new APIs come out with the old deprecated yet there are still obvious bugs two years later. import SwiftUI public enum Tab { case main } struct AppTabNavigation: View { @State private var tabSelection = Tab.main var body: some View { TabView(selection: $tabSelection) { NavigationStack { ContentView() } .tag(Tab.main) .tabItem { Label("Main", systemImage: "star") } } } } struct ContentView: View { @State private var searchText = "" var body: some View { List(0..<100) { i in NavigationLink("Select \(i)", value: i) } .navigationTitle("Main") .searchable(text: $searchText) .navigationDestination(for: Int.self) { i in DetailsView(i: i) } } } struct DetailsView: View { @State private var searchText = "" let i: Int // MARK: - Body var body: some View { List { ForEach(0..<10, id: \.self) { i in Text("Hello \(i)") } } .navigationTitle(i.formatted()) .searchable(text: $searchText) } }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
85
Mar ’25
SwiftUI NavigationSplitView doesn't work for DocumentGroup
When using a NavigationSplitView in a DocumentGroup, SwiftUI renders incorrect UI and doesn’t let the user navigation between the sidebar and detail views. Even the default Xcode project template “Document App” doesn’t work. Steps to reproduce Create a new project and use the Document App template. Run the project on either iPad or iPhone running iOS 26 beta 9 Experience the following issues. On iPhone The back button (to return to the document browser) and the document title are rendered two times. When viewing the detail of an item, by navigating to the detail view, you cannot go back to the list of items, because the back button brings you back to the document browser. The same issues are also present on iPad. I've tested this on an iPad and iPhone running iOS 26 beta 9 and Xcode 26.0 beta 7. I've reported this issue already → FB20062294
Topic: UI Frameworks SubTopic: SwiftUI
0
0
128
Sep ’25
SwiftUI TextEditor undo button
I'm using SwiftUI's TextEditor. I'd like to include an undo button in my UI that operates on the TextEditor. I don't see a way to hook this up. You can get the UndoManager from the environment, but this is not the undo manager the TextEditor is using. I know that UITextView uses an undocumented UndoManager (_UITextUndoManager) and I've accessed that before when using a UIViewRepresentable wrapper around UITextView. I'd like to achieve the same with TextEditor.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
96
Jun ’25
Encountered an issue when adding a highlight effect to an image with rounded corners.
When I display 2/3 of the poster on tvos, after setting it according to the code, some semi-transparent background can be seen in the upper left and right corners of the image when it is in focus. How can I eliminate it? struct HighPosterView: View { let media: MediaDetail @State private var isShowingDetails = false @Environment(\.isFocused) private var isFocused: Bool var body: some View { Button { isShowingDetails.toggle() } label: { HighShelfImageView(imageURL: media.posterURL) .contentShape(RoundedRectangle(cornerRadius: 24, style: .continuous)) .hoverEffect(.highlight) Text(media.displayTitle) .lineLimit(1) .font(.subheadline) .frame(maxWidth: 300) } .buttonStyle(.borderless) .animation(.smooth) } } struct HighShelfImageView: View { let imageURL: URL? var body: some View { KFImage.url(imageURL) .targetCache(ImageCacheManager.shelfCache) .setProcessor(ImageCacheManager.mediaListShelfProcessor) .placeholder { Color.primary.opacity(0.1) .cornerRadius(Constants.cornerRadius) } .cancelOnDisappear(true) .cacheMemoryOnly(false) .fade(duration: 0.1) .cacheOriginalImage(true) .resizable() .aspectRatio(2/3, contentMode: .fill) .clipShape(RoundedRectangle(cornerRadius: Constants.cornerRadius)) } } I need to keep the image and text distributed vertically, keep customize corner, with the text pushed aside when the image is in focus.
0
0
179
Sep ’25
iOS26 beta ToolbarItem with placement to principal width is not fill to screen
I’m trying to add a TextField to the toolbar using .principal placement, and I want it to either fill the screen width or expand based on the surrounding content. However, it’s not resizing as expected — the TextField only resizes correctly when I provide a hardcoded width value. This behavior was working fine in previous versions of Xcode, but seems to be broken in Xcode 26. Not sure if this is an intentional change or a bug. i am using iOS26 beta and Xcode 26 beta struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() .toolbar { ToolbarItem(placement: .principal) { HStack { TextField("Search", text: .constant("")) .textFieldStyle(.roundedBorder) .frame(maxWidth: .infinity) // .frame(width: 300) Button("cancel") { } } .frame(maxWidth: .infinity) } } } } #Preview { NavigationView { ContentView() } }
Replies
0
Boosts
0
Views
264
Activity
Jun ’25
zoom navigationTransition breaks navigation title
When combining a zoom navigationTransition with a List in a NavigationStack we end up getting the navigationTitle not properly re-positioning itself on dismiss/back. It looks like a visual bug/glitch (unless I missed something). This seems to not happen with a ScrollView import SwiftUI struct Item: Identifiable { let id: UUID = UUID() } struct ContentView: View { @State private var selected: Item? @Namespace private var animation var body: some View { NavigationStack { List { ForEach((0..<50).map { _ in Item() }, id: \.id) { item in Button { selected = item } label: { Text(item.id.uuidString) .frame(maxWidth: .infinity, alignment: .leading) } .matchedTransitionSource(id: item.id, in: animation) } } .navigationTitle("Title") .navigationSubtitle("Subtitle") } .fullScreenCover(item: $selected) { item in Text(item.id.uuidString) .frame(maxWidth: .infinity) .navigationTransition(.zoom(sourceID: item.id, in: animation)) } } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
1
Views
110
Activity
Sep ’25
SwiftUI's `WebPage` back navigation not working as expected
I'm currently testing SwiftUI's WebKit by building a browsing application. For the back navigation, I have the following code implemented: if let item = webPage.backForwardList.backList.last { webPage.load(item) print( """ ===== backForwardList.backList: \(webPage.backForwardList.backList) --- backForwardList.currentItem: \(webPage.backForwardList.currentItem) --- backForwardList.forwardList: \(webPage.backForwardList.forwardList) ===== """.trimmingCharacters(in: .whitespacesAndNewlines) ) } When I look at the logs, it shows that whenever I navigate back, the currentItem is updated with the item, but the backList is appended with the previous currentItem, and the forwardList is always empty. Am I implementing this incorrectly? Thanks in advance!
Replies
0
Boosts
0
Views
123
Activity
Sep ’25
SCStreamUpdateFrameContentRect X coordinate always returns 48 instead of expected 0
SCStreamUpdateFrameContentRect X coordinate always returns 48 instead of expected 0 Environment Device: MacBook Pro 13-inch macOS: Sequoia 15.6.1 Xcode: 16.4 Framework: Screen Capture Kit Issue Description I'm experiencing an unexpected behavior with Screen Capture Kit where the SCStreamUpdateFrameContentRect X coordinate consistently returns 48 instead of the expected 0. Code Context I'm using SCContentSharingPicker to capture screen content and implementing the SCStreamOutput protocol to receive frame data. In my stream(_:didOutputSampleBuffer:of:) method, I'm extracting the content rect information from the sample buffer attachments: func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType) { switch type { case .screen: guard let attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, createIfNecessary: false) as? [[SCStreamFrameInfo: Any]] else { return } guard let attachments = attachmentsArray.first else { return } if !attachments.keys.contains(.contentRect) { return } print(attachments) // X coordinate always shows 48 /* , __C.SCStreamFrameInfo(_rawValue: SCStreamUpdateFrameContentRect): { Height = 540; Width = 864; X = 48; <<-- unexpected offset Y = 0; }] */ return // ... other cases } } Expected vs Actual Behavior Expected: X coordinate should be 0 (indicating the content starts at the left edge of the screen) Actual: X coordinate is consistently 48 Visual verification: When I display the captured screen content, it appears correctly without any offset, suggesting the actual content should indeed start at X=0 Additional Information The picker is configured with .singleDisplay mode I'm excluding the current app's bundle ID from capture The captured content visually appears correct, only the reported coordinates seem off Main ViewModel Class import Foundation import ScreenCaptureKit import SwiftUICore class VM: NSObject, ObservableObject, SCContentSharingPickerObserver, SCStreamDelegate, SCStreamOutput { @State var isRecording = false // Error handling delegate func stream(_ stream: SCStream, didStopWithError error: Error) { DispatchQueue.main.async { self.isRecording = false } } var picker: SCContentSharingPicker? func createPicker() -> SCContentSharingPicker { if let p = picker { return p } let picker = SCContentSharingPicker.shared picker.add(self) picker.isActive = true SCContentSharingPicker.shared.present(using: .display) return picker } var stream: SCStream? let videoSampleBufferQueue = DispatchQueue(label: "com.example.apple-samplecode.VideoSampleBufferQueue") // observer call back for picker func contentSharingPicker(_ picker: SCContentSharingPicker, didUpdateWith filter: SCContentFilter, for stream: SCStream?) { if let stream = stream { stream.updateContentFilter(filter) } else { let config = SCStreamConfiguration() config.capturesAudio = false config.captureMicrophone = false config.captureResolution = .automatic config.captureDynamicRange = .SDR config.showMouseClicks = false config.showsCursor = false // Set the frame rate for screen capture config.minimumFrameInterval = CMTime(value: 1, timescale: 5) // 10 FPS self.stream = SCStream(filter: filter, configuration: config, delegate: self) do { try self.stream?.addStreamOutput(self, type: .screen, sampleHandlerQueue: self.videoSampleBufferQueue) } catch { print("\(error)") } self.stream?.updateContentFilter(filter) DispatchQueue.main.async { self.stream?.startCapture() } } } func contentSharingPicker(_ picker: SCContentSharingPicker, didCancelFor stream: SCStream?) {} func contentSharingPickerStartDidFailWithError(_ error: any Error) { print(error) } func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType) { switch type { case .screen: guard let attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, createIfNecessary: false) as? [[SCStreamFrameInfo: Any]] else { return } guard let attachments = attachmentsArray.first else { return } if !attachments.keys.contains(.contentRect) { return } print(attachments) return case .audio: return case .microphone: return @unknown default: return } } func outputVideoEffectDidStart(for stream: SCStream) { print("outputVideoEffectDidStart") } func outputVideoEffectDidStop(for stream: SCStream) { print("outputVideoEffectDidStop") } func streamDidBecomeActive(_ stream: SCStream) { print("streamDidBecomeActive") } func streamDidBecomeInactive(_ stream: SCStream) { print("streamDidBecomeInactive") } }
Replies
0
Boosts
0
Views
82
Activity
Sep ’25
How to disable scrollToTop when clicking on selected tab
I currently have a SwiftUI TabView that has 5 Tab's. The first tab has a UIScrollView in a UIViewRepresentible with scrollView.scrollsToTop = false and that works fine for when the user hits the navigation bar, however if the user taps the first tab when it is already selected my UIScrollView scrolls to top. My UIScrollView is essentially 5 views, a center view, top, bottom, right, and left view. All views except for the center are offscreen but available for the user to scroll horizontal or vertical (and the respective views get updated based on the new center view). The issue I have is that clicking the first tab when its already selected, sets the content offset (for the y axis) to 0, which messes me up 2x, first it scrolls up but since its not really scrolling the right, left, and upper views dont exist, which makes the user think it can't be scrolled or it's broken. For now I subclassed UIScrollView like this class NoScrollToTopScrollView: UIScrollView { override func setContentOffset(_ contentOffset: CGPoint, animated: Bool) { if contentOffset.y == .zero { // Ignore SwiftUI’s re-tap scroll-to-top return } super.setContentOffset(contentOffset, animated: animated) } } which seems to work, but I'm just wondering if there is a better way to do this, or maybe a way to disable SwiftUI Tab from doing its default action which can help with a SwiftUI ScrollView as well?
Replies
0
Boosts
0
Views
129
Activity
Sep ’25
Record microphone in a Keyboard app (in the background)
I'm currently I'm working on an iOS app + custom keyboard extension, and I’m hoping to get some insight into how to best architect a workflow where the keyboard acts as a remote trigger for dictation, but the main app handles the actual microphone recording and transcription. I know that third-party keyboards are sandboxed and can’t access the microphone directly, so the pattern I’m following is similar to what Wispr Flow appears to be doing: What I'm Trying to Build The user taps a mic button in the custom keyboard (installed system-wide). This triggers the main app to open, start a recording session, and send the audio to my transcription endpoint (not using Speech.framework). Once the transcription result is ready, it's stored in an App Group shared container. The keyboard extension polls for or receives the transcribed text and inserts it into the current input field via textDocumentProxy.insertText(...). Key Questions Triggering App Dictation from Keyboard Is there a clean system-native way to transition from the keyboard to the main app and back? Are there best practices around?: Preventing jarring transitions (keyboard disappearing)? Letting the app record in the background once triggered (see below)? Keeping the App Alive During Audio Recording Once the main app is opened to handle the dictation: I want it to record audio continuously (sometimes for up to a minute or 2 ), send it to an external transcription API, and return the result. However, from what I have read, iOS aggressively suspends or kills apps that are not in the foreground or haven’t requested the correct background modes - especially if there are background tasks running for longer than 30 seconds. Even with audio enabled in Background Modes and a live AVAudioEngine session, I find that the app is sometimes paused or killed after a few seconds; especially when the user switches back to the app where they want to type. But apps like Wispr Flow seem to manage this well. Their flow allows the user to record voice and insert it seamlessly without the app being terminated mid-recording. So: ✅ How do I prevent my app from being killed/suspended while it's recording, especially when the user switches back to the original app? Do I need: A background AVAudioSession hack? Audio playback tricks (e.g. silent audio)? A workaround using CallKit (some apps seem to use it for persistent audio sessions)? Something else Apple allows but doesn’t document clearly (or I am just a bad sercher)? Returning Text to the Keyboard Extension I’m using UserDefaults(suiteName:) in the App Group to pass the transcription result. Is that still the recommended approach? Would it be better to use a shared file (for larger data or richer metadata)? Are there any timing issues I should be aware of, e.g. like race conditions, stale reads, etc.?
Replies
0
Boosts
0
Views
204
Activity
Sep ’25
SwiftUI Nav Bar Changes in Height When Loading While Presented in a Sheet
If you create a SwiftUI App where a ‘.sheet’ is presented and use a NavigationStack within that Sheet, when you use NavigationLink to present a view, the title of the Nav Bar will start at a height of 46px and pop to the Default Height of 54px when it loads causing a visual pop in the UI. In iOS 18 it functions correctly, in iOS 26 the visual pop is present. This impacts both inline and large styles, if you disable the back button it is still present, the only way I have discovered to get rid of it is by using 'fullScreenCover' instead of '.sheet'. This feels like buggy UI. This issue has been present since iOS 26 Beta 5, I was hoping it would be fixed but is still present in the GM. Feedback has been filed via Feedback Assistant: FB20228369 This is the code to re-produce the issue: import SwiftUI struct ContentView: View { @State private var showSheet: Bool = false var body: some View { VStack { Button { showSheet.toggle() } label: { Text("Show Sheet") } } .padding() .sheet(isPresented: $showSheet) { NavigationStack { List { NavigationLink { Rectangle() .foregroundStyle(.red) .navigationTitle("Red") } label: { Text("Show Red") } } } .presentationSizing(.page) } } } #Preview { ContentView() }
Replies
0
Boosts
1
Views
323
Activity
Sep ’25
Inconsistent button image scaling between dynamic type sizes 'XXX Large' and 'AX 1'
[Also submitted as FB20262774. Posting here in hopes of saving someone else from burning half a day chasing this down.] Dynamic scaling of an Image() in a Button(), incorrectly decreases when transitioning from XXX Large to AX 1 accessibility text sizes, instead of continuing to grow as expected. This occurs both on device and in the simulator, in iOS 18.6 and iOS 26. Repro Steps Create a project with sample code below Show the preview if not showing In Xcode Preview, click Canvas Device Settings and change Dynamic Type from XXX Large to AX 1 Sample Code struct ContentView: View { var body: some View { VStack(spacing: 30) { Text("Button Image Scaling Issue") .font(.system(size: 24, weight: .semibold)) Text("Switch dynamic type from **XXX Large** to **AX 1**. The **Button** icon shrinks while the **No Button** icon grows.") .font(.system(size: 14, weight: .regular)) TestView(title: "No Button", isButton: false) TestView(title: "Button", isButton: true) } .padding() } } struct TestView: View { let title: String let isButton: Bool var body: some View { VStack { Text(title) .font(.system(size: 16)) .foregroundColor(.secondary) if isButton { Button {} label: { Image(systemName: "divide") .font(.system(.largeTitle)) } .buttonStyle(.bordered) .frame(height: 50) } else { Image(systemName: "divide") .font(.system(.largeTitle)) .foregroundColor(.blue) .frame(height: 50) .background(Color.gray.opacity(0.2)) } } } } Expected Result Both the button and non-button images should continue to scale up proportionally when moving to larger accessibility text sizes. Actual Result When going from XXX Large to AX 1… Non-button image gets larger ✅ Button image gets smaller ❌ Screen Recording System Info Xcode Version 26.0 (17A321) iOS 26.0 and 18.6
Replies
0
Boosts
0
Views
192
Activity
Sep ’25
.safeAreaBar doesn't look good together with .searchable
When using .scrollEdgeEffectStyle(.hard, for: .top), search bar background doesn't match with . safeAreaBar view background (you can see that is is darker than the rest of the toolbar). Please find the screenshot in the attachment iOS 26 RC Light Mode Feedback ID - FB19768159 import SwiftUI struct ContentView: View { @State private var count = 0 var body: some View { NavigationStack { ScrollView(.vertical) { ForEach(0..<100) { index in Text("\(index)") .background(.red) } } .scrollEdgeEffectStyle(.hard, for: .top) .searchable( text: .constant(""), placement: .navigationBarDrawer(displayMode: .always) ) .safeAreaBar(edge: .top) { Text("Safe area bar") } } } } #Preview { ContentView() }
Replies
0
Boosts
0
Views
109
Activity
Sep ’25
Bug: Black Pixel Flicker When Using glassEffect() with Animation
When using .glassEffect(.clear, in: .circle) with animation in a View, there is a chance that black pixel blocks flash on the screen. The abnormal effect can be seen in the attached video and screenshots.FB20216507 Code is as follows: VStack { if isLoaded { VStack { if #available(macOS 26.0, *) { Color.clear .frame(maxWidth: .infinity, maxHeight: .infinity) .glassEffect(.clear, in: .circle) } } .transition(.asymmetric(insertion: .scale, removal: .opacity)) } } .animation(.bouncy, value: isLoaded)
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
157
Activity
Sep ’25
Alert Closures Not Firing + Navigation Animations Broken
Hi, I hope you are doing well. We have been running up against an issue in our application which despite our best efforts we cannot seem to solve. After a certain point of use (of which we cannot seem to isolate a trigger), something internally with the way SwiftUI handles animation transactions seems to be breaking. This results in the following behavior that we (and our users) are noticing: Alerts/Sheets/NavigationPath changes lose all animations Closures associated with buttons no longer fire at all. The alert disappears, but with no animation and any action associated with the button selected does nothing. This results in an infinite loop of triggering an alert, clicking on an alert action, and the alert dismissing without the corresponding action ever occurring. We have tried moving the navigationPath out of a view model (Observable) and into a @State variable on the view in case it was an issue with view pre-rendering due to path changes, but this did not improve our case. We hoisted the state and the alert presentation out of all subviews and onto the root view of our navigation destination (as this happens on a sub-page of the application) as well, and while did this seem to minimize occurrences it did not fully resolve it. The app structure of our watch app is as follows: We have a NavigationStack at the root level which wraps a TabView, containing 3 pages. Selecting a button triggers a navigation destination, presenting a detail view. The detail view is a ZStack which switches on a property contained in an @State Observable view model scoped to the detail view. The ZStack can contain one of 5 subviews, derived from a viewState enum with associated values (all of which are equatable, and by extension viewState is also an equatable type as well). One of the subviews receives a binding, which on button trigger updates the binding and thus the view containing the ZStack presents the alert. Sometimes, when this happens, the animations break, and then are subsequently broken for the remainder of the lifetime of the app until it is force-closed (not backgrounded, but a full force-close). NavigationStack { TabView { Tab1 Tab2 // triggers navigationDestination Tab3 } .navigationDestination(for:) { DestinationView() // the view containing the ZStack + Alert } } STEPS TO REPRODUCE Unfortunately we have not been able to ascertain exactly what is causing this issue as we cannot reproduce it in a sandbox environment, only when moving through the view flow associated with our code. Any debugging ideas or recommendations would be greatly appreciated, as we have already tried _printChanges and do not notice any erroneous view redraws.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
85
Activity
Sep ’25
[Want] A View detects one from multiple custom Gestures.
SwiftUI Gesture cannot detect one of multiple gestures. I made a library for it because no default functions for it exists and I need it for my app. https://github.com/Saw-000/SwiftUI-DetectGestureUtil I want to use a function like this library with "import SwiftUI". The function is needed in the core maybe, isn't it?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
128
Activity
Nov ’25
SwiftUI List optional refreshable
Currently refreshable modifier does not support nil as a value and there's no way of disabling refreshable without recreating the whole view. There are a few posts showing how refreshable could be optionally disabled on scrollViews using: \EnvironmentValues.refresh as? WritableKeyPath<EnvironmentValues, RefreshAction?> https://stackoverflow.com/a/77587703 However, this approach doesn't seem to work with Lists. Has anyone find any solutions for this?
Replies
0
Boosts
0
Views
172
Activity
Sep ’25
Modelactors, Repository and bootloader
In iOS 26, should we have bootloader that runs the repo on startup - or should we have that inside tasks in root view? we have repos that runs as a «closed» functions, we dont throw but updates swiftdata and we use @query in the views. So what is best? and for the repo we should have a repo that runs the upserts manage relations eg? Should that run on a modelactor?
Replies
0
Boosts
0
Views
221
Activity
Sep ’25
Changing the color of SwiftUI Link
Hi, I have trouble changing the color of the text of Link in SwiftUI. I tried with this code: Link("https://www.mylink.com/", destination: URL(string: "https://www.mylink.com/")!) .foregroundColor(Color.green) and this code: HStack(spacing: 0) { Link("https://www.mylink.com/", destination: URL(string: "https://www.mylink.com/")!) } .foregroundColor(Color.green) The link keeps getting the accent color. EDIT: I want to add that it used to work and I think the issue came with a beta of Xcode 26. I think that was around the beta 4 or beta 5. Is it a change of the APIs or a bug?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
123
Activity
Sep ’25
The sidebar toggle of the NavigationSplitView disappears when used with a .inspector modifier on iPadOS 26
If the NavigationSplitView on iPadOS 26 is combined with a .inspector column, the sidebarToggle is always hidden, when the sidebar is collapsed. If you remove the .inspector modifier, the sidebarToggle stays visible throughout the collapsed or expanded state. Has maybe someone a workaround for this issue? The problem does not exist in iOS 18. The bug is reported as FB20061260
Replies
0
Boosts
1
Views
77
Activity
Sep ’25
SwiftUI: .searchable displays incorrectly in child views under NavigationStack
There appears to be a visual bug when using .searchable in a child view that’s pushed via NavigationLink inside a NavigationStack. Specifically, the search bar appears briefly in the wrong position (or animates in an unexpected way) during the transition to the child view. This issue does not occur when using NavigationView instead of NavigationStack. Steps to Reproduce: Create a TabView with a single tab containing a NavigationStack. Push from a ContentView to a DetailsView using NavigationLink. Add a .searchable modifier to both the ContentView and DetailsView. Run the app and tap a row to navigate to the details view. Expected Behavior The search bar in the DetailsView should appear smoothly and in the correct position as the view transitions in, just like it does under NavigationView. Actual Behavior When the DetailsView appears, the search bar briefly animates or appears in the wrong location before settling into place. This results in a jarring or buggy visual experience. Feedback: FB17031212 Here is a reddit thread discussing the issue as well https://www.reddit.com/r/SwiftUI/comments/137epji/navigation_stack_with_search_bar_has_a_bug_and_a/ I hope that an Apple engineer can get this fixed soon. It's frustrating to have new APIs come out with the old deprecated yet there are still obvious bugs two years later. import SwiftUI public enum Tab { case main } struct AppTabNavigation: View { @State private var tabSelection = Tab.main var body: some View { TabView(selection: $tabSelection) { NavigationStack { ContentView() } .tag(Tab.main) .tabItem { Label("Main", systemImage: "star") } } } } struct ContentView: View { @State private var searchText = "" var body: some View { List(0..<100) { i in NavigationLink("Select \(i)", value: i) } .navigationTitle("Main") .searchable(text: $searchText) .navigationDestination(for: Int.self) { i in DetailsView(i: i) } } } struct DetailsView: View { @State private var searchText = "" let i: Int // MARK: - Body var body: some View { List { ForEach(0..<10, id: \.self) { i in Text("Hello \(i)") } } .navigationTitle(i.formatted()) .searchable(text: $searchText) } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
85
Activity
Mar ’25
SwiftUI NavigationSplitView doesn't work for DocumentGroup
When using a NavigationSplitView in a DocumentGroup, SwiftUI renders incorrect UI and doesn’t let the user navigation between the sidebar and detail views. Even the default Xcode project template “Document App” doesn’t work. Steps to reproduce Create a new project and use the Document App template. Run the project on either iPad or iPhone running iOS 26 beta 9 Experience the following issues. On iPhone The back button (to return to the document browser) and the document title are rendered two times. When viewing the detail of an item, by navigating to the detail view, you cannot go back to the list of items, because the back button brings you back to the document browser. The same issues are also present on iPad. I've tested this on an iPad and iPhone running iOS 26 beta 9 and Xcode 26.0 beta 7. I've reported this issue already → FB20062294
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
128
Activity
Sep ’25
SwiftUI TextEditor undo button
I'm using SwiftUI's TextEditor. I'd like to include an undo button in my UI that operates on the TextEditor. I don't see a way to hook this up. You can get the UndoManager from the environment, but this is not the undo manager the TextEditor is using. I know that UITextView uses an undocumented UndoManager (_UITextUndoManager) and I've accessed that before when using a UIViewRepresentable wrapper around UITextView. I'd like to achieve the same with TextEditor.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
96
Activity
Jun ’25
Encountered an issue when adding a highlight effect to an image with rounded corners.
When I display 2/3 of the poster on tvos, after setting it according to the code, some semi-transparent background can be seen in the upper left and right corners of the image when it is in focus. How can I eliminate it? struct HighPosterView: View { let media: MediaDetail @State private var isShowingDetails = false @Environment(\.isFocused) private var isFocused: Bool var body: some View { Button { isShowingDetails.toggle() } label: { HighShelfImageView(imageURL: media.posterURL) .contentShape(RoundedRectangle(cornerRadius: 24, style: .continuous)) .hoverEffect(.highlight) Text(media.displayTitle) .lineLimit(1) .font(.subheadline) .frame(maxWidth: 300) } .buttonStyle(.borderless) .animation(.smooth) } } struct HighShelfImageView: View { let imageURL: URL? var body: some View { KFImage.url(imageURL) .targetCache(ImageCacheManager.shelfCache) .setProcessor(ImageCacheManager.mediaListShelfProcessor) .placeholder { Color.primary.opacity(0.1) .cornerRadius(Constants.cornerRadius) } .cancelOnDisappear(true) .cacheMemoryOnly(false) .fade(duration: 0.1) .cacheOriginalImage(true) .resizable() .aspectRatio(2/3, contentMode: .fill) .clipShape(RoundedRectangle(cornerRadius: Constants.cornerRadius)) } } I need to keep the image and text distributed vertically, keep customize corner, with the text pushed aside when the image is in focus.
Replies
0
Boosts
0
Views
179
Activity
Sep ’25