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

Created

Different UITextFieldDelegate behavior in iOS 26 with shouldChangeCharactersInRanges
Scenario: Typing Chinese Zhuyin “ㄨㄤ” and then selecting the candidate word “王”. On iOS 18, the delegate (textField:shouldChangeCharactersInRange:replacementString:) is called with: range: {0, 2} replacementString: "王" On iOS 26, the delegate (textField:shouldChangeCharactersInRanges:replacementString:) instead provides: ranges: [{2, 0}] replacementString: "王" This results in inconsistent text input handling compared to earlier system versions. Implement: Limit user input to a maximum of 100 Chinese characters. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { if ([textField markedTextRange]) { return YES; } NSString *changedString = [textField.text stringByReplacingCharactersInRange:range withString:string]; if (changedString.length > 100) { return NO; } return YES; } Questions: Is this an intentional change in iOS 26? If intentional, what is the recommended way to handle such cases in order to support both iOS 18 and iOS 26 consistently?
Topic: UI Frameworks SubTopic: UIKit
1
0
94
4d
Different UITextFieldDelegate behavior in iOS 26 with shouldChangeCharactersInRanges
Scenario: Typing Chinese Zhuyin “ㄨㄤ” and then selecting the candidate word “王”. On iOS 18, the delegate (textField:shouldChangeCharactersInRange:replacementString:) is called with: range: {0, 2} replacementString: "王" On iOS 26, the delegate (textField:shouldChangeCharactersInRanges:replacementString:) instead provides: ranges: [{2, 0}] replacementString: "王" This results in inconsistent text input handling compared to earlier system versions. Implement: Limit user input to a maximum of 100 Chinese characters. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { if ([textField markedTextRange]) { return YES; } NSString *changedString = [textField.text stringByReplacingCharactersInRange:range withString:string]; if (changedString.length > 100) { return NO; } return YES; } Questions: Is this an intentional change in iOS 26? If intentional, what is the recommended way to handle such cases in order to support both iOS 18 and iOS 26 consistently?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
47
4d
UIButton does not receive any touches after I add clearGlassButtonConfiguration for iOS26
I have a customized navigationbar, the back button does not receive any touches after I add clearGlassButtonConfiguration for iOS26, also there is no touch effects for clearGlassButtonConfiguration when I remove this UIButtonConfiguration setting,everything workes. - (UIButton *)backButton { if (!_backButton) { _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; _backButton.frame = CGRectMake(0, 0, 44, 44); UIImage * img = [[UIImage imageNamed:@"IVC_back"]imageWithColor:HEXCOLOR(0xFFFFFF)]; [_backButton setImage:img forState:UIControlStateNormal]; [_backButton addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)]; if (@available(iOS 26.0, *)){ _backButton.configuration = UIButtonConfiguration.clearGlassButtonConfiguration; } } return _backButton; }
Topic: UI Frameworks SubTopic: UIKit
2
0
98
4d
iOS 26 Custom keyboard always displays a gray bar above it
This is because when opening the keyboard in an app that supports Liquid Glass, iOS will automatically wrap the keyboard with a bottom view that uses the Liquid Glass effect. In this case, we need to remove the background color. However, in apps that do not support Liquid Glass, having a background color still displays normally. So right now, I’m trying to find a way for the keyboard to know whether the host app supports Liquid Glass when the keyboard is opened, but I haven’t found a solution yet.
Topic: UI Frameworks SubTopic: UIKit
0
0
63
4d
ScrollView + LazyVStack buggy animation. Fixable?
The below code will render a list of items and a button to shuffle them and change their height withAnimation. If you scroll down and shuffle it you will eventually see glitches in the animation, mostly consisting of ghost items animating on top of other items and disappearing. Does anyone know why this is happening, and how to stop it happening? The issue goes away entirely if I use a VStack, but using a VStack brings its own problems. import SwiftUI struct Item: Identifiable { let id = UUID() var height: CGFloat var label: String } struct ContentView: View { @State private var items: [Item] = (0..<30).map { i in Item(height: .random(in: 80...220), label: "Row \(i)") } var body: some View { NavigationStack { ScrollView { LazyVStack(spacing: 8) { ForEach(items) { item in Text(item.label) .frame(maxWidth: .infinity) .frame(height: item.height) .background(.gray.opacity(0.15)) .clipShape(RoundedRectangle(cornerRadius: 12)) .padding(.horizontal) } } .padding(.vertical) } .navigationTitle("LazyVStack Demo") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Shuffle") { withAnimation() { items.shuffle() for i in items.indices { items[i].height = .random(in: 80...220) } } } } } } } } #Preview { ContentView() }
0
0
36
4d
iPadOS 26: System window controls overlap UINavigationBar buttons in resizable windows (UIKit + Storyboards)
Hello, I’m seeing a layout issue where the system window controls overlap the navigation bar’s right-side buttons when the app window is resized on iPadOS 26. Environment Xcode: 16.4 Simulator: iPadOS 26.0, device profile iPad Pro 13-inch Physical device: iPad updated to iPadOS 26 (same behavior) UI stack: UIKit + Storyboards (no SwiftUI) App structure: Root UINavigationController Summary Since iPadOS 26 introduced freely resizable app windows, the system’s window management controls (close/minimize/resize at the top-right) begin to overlap the navigation bar buttons as the window size becomes smaller. At maximum window size there’s no issue. Additionally, the navigation bar buttons themselves appear to scale down visually when the window gets smaller. Steps to Reproduce Build with Xcode 16.4 and run on iPadOS 26.0 (simulator or device). Open a screen embedded in a UINavigationController with right-side bar button items. Resize the app window to a smaller size. Observe the top-right system window controls overlapping the navigation bar buttons. Expected Result System window controls should not overlap app content; the navigation bar should remain usable and properly spaced at all supported window sizes. Actual Result When the window is small, the system window controls overlap the right-side navigation bar buttons. The bar button items also appear to shrink as the window size decreases. Notes Reproducible on both simulator and a real device updated to iPadOS 26. Project uses UIKit + Storyboards only (no SwiftUI). Safe areas and basic constraints look fine, so the root cause is unclear. Questions Is this a known issue with iPadOS 26 resizable windows? Any recommended workaround (e.g., API to reserve space near the window controls, UINavigationBar configuration, or trait/size-class handling)? I can provide a minimal sample project and screenshots if helpful. Thank you!
0
0
62
4d
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
0
40
4d
Need help with attribute inspector in Xcode 26
I am trying to learn Xcode and swift ui for a class project but the attribute inspector just does not show up, I can have the simulator open or closed I click on it nothing works. I feel so stupid. I suppose you don't need it but it helps a lot. anyone have any trouble shooting that could help?
Topic: UI Frameworks SubTopic: SwiftUI
2
1
72
4d
SwiftUI Slider onEditingChanged is unreliable on iOS 26
For information I stumbled upon a regression with SwiftUI Slider on iOS 26. Its onEditingChanged closure might be called twice when interaction ends, with a final Boolean incorrect value of true provided to the closure. As a result apps cannot reliably rely on this closure to detect when an interaction with the slider starts or ends. I filed a feedback under FB20283439 (iOS 26.0 regression: Slider onEditingChanged closure is unreliable).
2
3
119
4d
NSButtons with NSBezelStyleGlass Sometimes Very Long Delay Before Adjusting Appearance After Toggling Dark Mode
I have some buttons. I set the bezelStyle to NSBezelStyleGlass. I'm sometimes experiencing the following issue: Put the system in dark mode. Some glass buttons still draw with the light appearance. One or more of the following actions usually makes the appearance redraw proper: -Clicking the button -Deactivating and then reactivating the window. -Close and then reopen the window. I tried setNeedsDisplay YES etc. but that didn't work The delay is quite noticeable. Everything else is in dark mode except one or two glass buttons. This seems to workaround the issue: BOOL didToggleGlass = NO; if (self.bezelStyle == NSBezelStyleGlass) { // Turn glass off just for a sec. self.bezelStyle = NSBezelStyleToolbar; didToggleGlass = YES; } if (didToggleGlass) { // Put glass back on. self.bezelStyle = NSBezelStyleGlass; } Apparently toggling glass cause the effective appearance to change so you can't use the above workaround in a -viewDidChangeEffectiveAppearance b/c you'll create an infinite loop unless you guard against it.
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
31
5d
toolbar buttons not showing sometimes after upgraded to iPadOS26.
(Sorry if this is not the right place to post...) I upgraded my iPad / macOS to 26 yesterday. Soon, I noticed that the two buttons in the toolbar would sometimes not appear: Note that they should be visible at all times. I played a little more to see if there was any pattern, but I could not find any. Has anyone experienced something similar...? Is this an iPadOS26 bug? (I haven't checked with an iPhone yet.) Thanks.
Topic: UI Frameworks SubTopic: General Tags:
0
0
40
5d
WindowServer crash when moving window near left edge of external display
Steps to Reproduce: Connect a MacBook Pro (lid closed) to a large external monitor. Run the SDL3 testwm test application. git clone https://github.com/libsdl-org/SDL.git cmake -S . -B build -DBUILD_SHARED_LIBS=OFF -DSDL_TESTS=ON cmake --build build The testwm binary will be located in the build/test directory. Move the application window around the left edge of the external display. Observed Result: WindowServer crashes. System Configuration: MacBook Pro M3 Max, macOS Sequoia 15.6.1 LG GX9, 5120x2160 resolution, running at 165 Hz refresh rate Lid closed, single external display Panic Log: panic(cpu 7 caller 0xfffffe0027f61d5c): "mismatched swapID's 6386399 vs 6386400\n" @UnifiedPipeline.cpp:14570 Debugger message: panic Memory ID: 0xff OS release type: User OS version: 24G90 Kernel version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:55 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6031 Fileset Kernelcache UUID: 8AA69CD2038CD2BAE2ED364428F4DBEA Kernel UUID: 75A21406-D046-3232-AA3F-085335D5C848 Boot session UUID: B949E839-683B-4DAF-BE42-4562758F976E iBoot version: iBoot-11881.140.96 iBoot Stage 2 version: iBoot-11881.140.96 secure boot?: YES roots installed: 0 Paniclog version: 14 KernelCache slide: 0x000000001e0ec000 KernelCache base: 0xfffffe00250f0000 Kernel slide: 0x000000001e0f4000 Kernel text base: 0xfffffe00250f8000 Kernel text exec slide: 0x000000001f870000 Kernel text exec base: 0xfffffe0026874000 mach_absolute_time: 0x64e7db3e6a9 Epoch Time: sec usec Boot : 0x68b207f0 0x00082ee7 Sleep : 0x68c1a51c 0x00048c6c Wake : 0x68c1a760 0x00039aa4 Calendar: 0x68c1b78d 0x0001776a Zone info: Zone map: 0xfffffe1018000000 - 0xfffffe3618000000 . VM : 0xfffffe1018000000 - 0xfffffe15e4000000 . RO : 0xfffffe15e4000000 - 0xfffffe187e000000 . GEN0 : 0xfffffe187e000000 - 0xfffffe1e4a000000 . GEN1 : 0xfffffe1e4a000000 - 0xfffffe2416000000 . GEN2 : 0xfffffe2416000000 - 0xfffffe29e2000000 . GEN3 : 0xfffffe29e2000000 - 0xfffffe2fae000000 . DATA : 0xfffffe2fae000000 - 0xfffffe3618000000 Metadata: 0xfffffe393c010000 - 0xfffffe3945810000 Bitmaps : 0xfffffe3945810000 - 0xfffffe394c104000 Extra : 0 - 0 CORE 0 recently retired instr at 0xfffffe0026a407a0 CORE 1 recently retired instr at 0xfffffe0026a40798 CORE 2 recently retired instr at 0xfffffe0026a407a0 CORE 3 recently retired instr at 0xfffffe0026a407a0 CORE 4 recently retired instr at 0xfffffe0026a407a0 CORE 5 recently retired instr at 0xfffffe0026a407a0 CORE 6 recently retired instr at 0xfffffe0026a407a0 CORE 7 recently retired instr at 0xfffffe0026a3eefc CORE 8 recently retired instr at 0xfffffe0026a407a0 CORE 9 recently retired instr at 0xfffffe0026a407a0 CORE 10 recently retired instr at 0xfffffe0026a407a0 CORE 11 recently retired instr at 0xfffffe0026a407a0 CORE 12 recently retired instr at 0xfffffe0026a407a0 CORE 13 recently retired instr at 0xfffffe0026a407a0 TPIDRx_ELy = {1: 0xfffffe29e4ef5ee0 0: 0x0000000000001007 0ro: 0x000000016c59b0e0 } CORE 0 PVH locks held: None CORE 1 PVH locks held: None CORE 2 PVH locks held: None CORE 3 PVH locks held: None CORE 4 PVH locks held: None CORE 5 PVH locks held: None CORE 6 PVH locks held: None CORE 7 PVH locks held: None CORE 8 PVH locks held: None CORE 9 PVH locks held: None CORE 10 PVH locks held: None CORE 11 PVH locks held: None CORE 12 PVH locks held: None CORE 13 PVH locks held: None CORE 0: PC=0xfffffe0026abfa40, LR=0xfffffe0026ae4fc8, FP=0xfffffe65b8703980 CORE 1: PC=0x0000000193ae2730, LR=0x000000019389d108, FP=0x000000016f43e590 CORE 2: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b850bed0 CORE 3: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b8ee7ed0 CORE 4: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b7eebed0 CORE 5: PC=0xfffffe0026a3ac1c, LR=0xfffffe0026a3ac18, FP=0xfffffe65b8c63e40 CORE 6: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b7033ed0 CORE 7 is the one that panicked. Check the full backtrace for details. CORE 8: PC=0xfffffe0026a3ac1c, LR=0xfffffe0026a3ac18, FP=0xfffffe65b737be40 CORE 9: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b8f1fed0 CORE 10: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b7fe7ed0 CORE 11: PC=0xfffffe0026a3ac1c, LR=0xfffffe0026a3ac18, FP=0xfffffe65b870fe40 CORE 12: PC=0xfffffe0026911e84, LR=0xfffffe0026911e84, FP=0xfffffe65b80a7ed0 CORE 13: PC=0xfffffe0026a3ac1c, LR=0xfffffe0026a3ac18, FP=0xfffffe65b685fe40 Compressor Info: 6% of compressed pages limit (OK) and 16% of segments limit (OK) with 0 swapfiles and OK swap space Panicked task 0xfffffe23153cb940: 10375 pages, 28 threads: pid 406: WindowServer Panicked thread: 0xfffffe29e4ef5ee0, backtrace: 0xfffffe65b6f07210, tid: 5146 lr: 0xfffffe00268d53d4 fp: 0xfffffe65b6f072a0 lr: 0xfffffe0026a36da0 fp: 0xfffffe65b6f07310 lr: 0xfffffe0026a35114 fp: 0xfffffe65b6f073d0 lr: 0xfffffe002687f8b0 fp: 0xfffffe65b6f073e0 lr: 0xfffffe00268d5710 fp: 0xfffffe65b6f077b0 lr: 0xfffffe0027169290 fp: 0xfffffe65b6f077d0 lr: 0xfffffe0027f61d5c fp: 0xfffffe65b6f07850 lr: 0xfffffe0029186878 fp: 0xfffffe65b6f07880 lr: 0xfffffe00270bd2a0 fp: 0xfffffe65b6f078b0 lr: 0xfffffe00270bd5b0 fp: 0xfffffe65b6f07a40 lr: 0xfffffe0026a00194 fp: 0xfffffe65b6f07b60 lr: 0xfffffe00268dcd48 fp: 0xfffffe65b6f07c00 lr: 0xfffffe00268b2ed4 fp: 0xfffffe65b6f07c60 lr: 0xfffffe00268c6868 fp: 0xfffffe65b6f07cb0 lr: 0xfffffe00268c6c80 fp: 0xfffffe65b6f07da0 lr: 0xfffffe0026a29bbc fp: 0xfffffe65b6f07e50 lr: 0xfffffe0026a355a4 fp: 0xfffffe65b6f07f10 lr: 0xfffffe002687f8b0 fp: 0xfffffe65b6f07f20 lr: 0x000000018dc89c34 fp: 0x0000000000000000 Kernel Extensions in backtrace: com.apple.iokit.IOMobileGraphicsFamily(343.0)[6C8CFA29-99CD-39D4-81BC-2B0F147BE64F]@0xfffffe002917d860->0xfffffe00291a024f
1
0
58
5d
What's wrong with tabbar color effect on iOS 26?
In my project, the window.rootViewController is a UITabBarController containing four UIViewControllers. The first, third, and fourth VCs are empty, while the second VC's view hierarchy is structured as follows: UIViewController.view ├── UIScrollView (contentSize: self.view.width * 2, 0; backgroundColor: .red) ├── UIScrollView (contentSize: 0, self.view.height * 2; backgroundColor: .black) └── UIScrollView (contentSize: 0, self.view.height * 2; backgroundColor: .white) When I switch to the second tab and horizontally scroll the scrollView, the tabBar color doesn't adapt to the current view's dominant color. However, if I launch the app and sequentially tap every tab before switching to the second tab, the tabBar color then changes dynamically during horizontal scrolling. But if I background the app and return, the tabBar reverts to black. Why does this happen? How can I either: Manually control the tabBar color, or Make it automatically match the page's dominant color? This issue occurs when the "Reduce Transparency" accessibility setting is enabled.
Topic: UI Frameworks SubTopic: UIKit
1
0
124
5d
Cannot render ScrollView + VStack + ScrollPosition correctly scrolled initially
The following code works properly, ensuring the list is scrolled at the correct ID when first rendered: import SwiftUI struct DataItem: Identifiable { let id: Int let height: CGFloat init(id: Int) { self.id = id self.height = CGFloat.random(in: 100...300) } } struct ContentView: View { @State private var items = (0..<1000).map { DataItem(id: $0) } @State private var scrollPosition: ScrollPosition init() { let mid = 500 _scrollPosition = State(initialValue: .init(id: mid, anchor: .center)) } var body: some View { ScrollView { LazyVStack(spacing: 8) { ForEach(items) { item in Text("Item \(item.id)") .frame(height: item.height) .frame(maxWidth: .infinity) .background(.gray) } } .scrollTargetLayout() } .scrollPosition($scrollPosition, anchor: .center) } } However, if I change this to use VStack this ceases to work - the list begins rendered at the top of the list. The only way I can render it starting at the correct position is using side effects like onAppear or task, where I would update the scroll position. I have observed the following behavior on my iPhone 15 Pro/iOS 26. Is this a bug?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
33
5d
Default document-based app menu items missing icons
In a new document-based macOS app project created in Xcode, some of the default system-provided menu commands appear without their standard icons in the menu bar. Steps to Reproduce: 1. In Xcode, create a new macOS “Document App” project (using Swift/SwiftUI or AppKit template). 2. Build and run the project. 3. Open the app’s main menu bar and examine the default items such as New Document, Open…, Save, Duplicate, etc. Expected Results: System-provided menu items (e.g. Open…, Save, Duplicate) should display their standard SF Symbol–based icons automatically, as they do in TextEdit and other system apps. Actual Results: Some of these menu items display only text, with no icon namely: Services Open Recent Revert To Share This happens even though the items are the system-managed defaults generated by the document-based app template. Notes: • No code modifications were made — this occurs in a fresh, unedited template project. • Behavior seen on macOS 26.0 (25A354). • Xcode Version 26.0 (17A324) used.
1
0
94
5d
Any way to have the old Sidebar look with macOS 26 SDK?
Sadly my app doesn't look too good with the new sidebar style and currently I don't have the time to redesign it. (That will come later). When using Xcode 26 is there a way to keep the sidebar behavior but use the old Sequoia look? I initialize my sidebar splitview item with NSSplitViewItem(sidebarWithViewController: - when I switch to a different inititalizer (contentlist, inspector) it looks OK but the sidebar behavior (tracking toolbar item) is gone and the toolbar looks broken. Any other way to keep the old style besides not upgrading to Xcode 26? (The friendly integrated AI hallucinated some BS and then somehow applied those changes to my code ... luckily I had no pending code changes and could just revert via git).
Topic: UI Frameworks SubTopic: AppKit
0
0
39
5d
Extra margins around custom keyboard extensions in iOS 26 native apps
Hello, I’ve noticed an issue with custom keyboard extensions in iOS 26 that seems specific to native apps. When a custom keyboard is opened in apps like Messages, Notes, or Safari, there’s an extra strip of native grey space around the left, right, and top edges of the keyboard. This extra margin cannot be rendered over by the keyboard’s own views. Interestingly, this behaviour does not occur in third-party apps like Instagram. It also wasn’t present in earlier iOS versions. The result is that keyboards with custom or non-grey backgrounds look visually inconsistent (they appear framed by unwanted grey). Has anyone else run into this? Is this a known change in iOS 26, or could it be a bug? Any guidance or official clarification would be appreciated. Thanks!
0
0
25
5d
vision pro notifications too small for shareplay
A is there a way to get big huge notitifications for Shareplay invitations ? B can i have the notifications inside the app ? we have a corporate app to check archtecture projects we want to share these 3d spaces walking inside with near users in the same place to discuss about the project .. but it takes too long shareplay invitation is a small circle on top, if the others users just put the vision without configuring eyes and hands... it's gonna be impossible thanks for sharing and giving us support
2
0
96
5d
Issue keeping scroll position in SwiftUI
Hey there, Link to the sample project: https://github.com/dev-loic/AppleSampleScrolling Context We are working on creating a feed of posts in SwiftUI. So far, we have successfully implemented a classic feed that opens from the top, with bottom pagination — a standard use case. Our goal, however, is to allow the feed to open from any post, not just the first one. For example, we would like to open the feed directly at the 3rd post and then trigger a network call to load elements both above and below it. Our main focus here is on preserving the scroll position while opening the screen and waiting for the network call to complete. To illustrate the issue, I created a sample project (attached) with two screens: MainView, which contains buttons to open the feed in different states. ScrollingView, which initially shows a single element, simulates a 3-second network call, and then populates with new data depending on which button was tapped. I am currently using Xcode 26 beta 6, but I can also reproduce this issue on Xcode 16.3. Tests on sample project I click on a button and just wait the 3 seconds for the call. In this scenario, I expect that the “focused item” stays at the exact same place on the screen. I also expect to see items below and above being added. Simulator iPhone 16 / iOS 18.4 with itemsHeight = 100 position = 0, 1, 2, 3 ⇒ works as expected position = 4, 5, 6, 7, 8, 9 ⇒ scroll is reset to the top and we loose the focused item Simulator iPhone 16 / iOS 18.4 with itemsHeight = 500 position = 0, 1, 2, 3, 4 ⇒ works as expected position = 5, 6, 7 ⇒ I have a glitch (the focused element moves on the screen) but the focused element is still visible position = 8, 9 ⇒ scroll is reset to the top and we loose the focused item Simulator iPhone 16 / iOS 26 with itemsHeight = 100 or 500 position = 0, 1, 2, 3, 4 ⇒ works as expected position = 5, 6, 7, 8, 9 ⇒ I have a glitch (the focused element moves on the screen) but the focused element is still visible Device iPhone 15 / iOS 26 with itemsHeight = 100 position = 0, 1, 2, 3, 4 ⇒ works as expected position = 5, 6, 7, 8, 9 ⇒ I have a glitch (the focused element moves on the screen) but the focused element is still visible Device iPhone 15 / iOS 26 with itemsHeight = 500 position = 0, 1, 2, 3 ⇒ works as expected position = 4, 5, 6, 7, 8, 9 ⇒ I have a glitch (the focused element moves on the screen) but the focused element is still visible Not any user interaction Moreover, in this scenario, the user does not interact with the screen during the simulated network call. Regardless of the situation, if the ScrollView is in motion, its position always resets to the top. This behavior prevents us from implementing automatic pagination when scrolling upward, which is ultimately our goal. My conclusion so far As far as I know it seems not possible to have both keeping scroll possible and upward automatic pagination using a SwiftUI LazyVStack inside a ScrollView. This appears to be standard behavior in messaging apps or other feed-based apps, and I’m wondering if I might be missing something. Thank you in advance for any guidance you can provide on this topic. Cheers
2
0
45
5d
I need help
I am trying to learn to write swift. I am very proficient MS VB, which I have been using for almost 20 years. The Book I am learning from is: SwiftUI for Masterminds. I have got to chapter 7 with no problem. The exercise I am having a problem with Listing 7-5. The error I am getting is: Thread 1: Fatal error: No Observable object of type ApplicationData found. A View.environmentObject(_:) for ApplicationData may be missing as an ancestor of this view. I have spent the last 2 days rechecking my code. The MacBook I am using was purchased in May this year, is 16 in, M4 Max chip, 128 G ram. Firstly I want to thank you for reading this post. Secondly is there a better book to learn SwiftUI. Regards Terry Harrison
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2
0
150
5d