Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

textfield refreshes the list
Hey guys, I have multiple textfields in a List. Every time I change one letter, the list immediately refreshes and causes the textfield keyboard to dismiss. I tried to use onCommit (on clicking Done on the keyboard), but if the user edits multiple textfields, only the last textfield would listen to the onCommit changes. Is this a swiftUI List bug? Thank you in advance
2
0
395
Apr ’22
Reply to Can't manage my sandbox account
I have this issue with my usual AppleID credentials - they were listed in Sandbox iOS Settings and I successfully performed sandboxed purchase (note - this apple id is not listed in Sandbox Testers list in App Store Connect). I have no issue (not yet at least) with another dummy AppleID that I have created via Sandbox Testers page.
Topic: App & System Services SubTopic: StoreKit Tags:
Jan ’23
NSBrowser in SwiftUI
Is there a SwiftUI equivalent for NSBrowser? I tried to create my own with a (horizontal) ScrollView containing an HStack of Lists, but it looks like List's selection can currently only be used for editing mode (i.e. checkmarks) rather than normal mode (i.e. gray backgrounds).
0
0
759
May ’21
Generating .onDelete on my list
I'm using a list with a navigation link in my swiftui app, and I'm not using a ForEach loop and trying to put the .onDelete method but I don't know how can I do that. Can you help me? NavigationView { List(courses) {course in NavigationLink(destination: CourseDetails(course: course)) { StudentExtractedCourses(course: course) } } }
2
0
1.3k
Apr ’22
Reply to Sidebar on macOS?
Sidebar is just a List with the listStyle of SidebarListStyle applied to it, like this: List { t/* ... contents of the sidebar ... */ } .listStyle(SidebarListStyle()) You can use NavigationView to display the sidebar side by side with your app's content: NavigationView { tSidebar() tMainContent() } Sidebar can be customised in any way you like, it's a simple SwiftUI List.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’20
SwiftUI and tvOS
Hi all!Is there any sort of tutorials or documentation related to the tvOS specific things for SwiftUI?E.g. how to get more control over tvOS Focus engine?Also, is there canBecomeFocused-property analog for SwiftUI View and how to enable focusing for SwiftUI Image? Currently, I'm unable even make working parallax effect for my layered images.The only Focus-related thing that I see are:func onHover(perform: (Bool) -> Void) -> Viewfunc focusable(Bool, onFocusChange: (Bool) -> Void) -> ViewIs there something that I missed or SwiftUI currently not useful for tvOS production applications?
2
0
1.4k
Oct ’19
Longpress and list scrolling
Hi,Using SwiftUI I'm trying to implement a long press gesture on items in a list, to allow user interaction with the individual items. The problem is that when I set onLongPressGesture anywhere in the list (on items, on the list itself), the list cannot be scrolled anymore. I can easily get a simple tap to work but a long press blocks scrolling.I've been Googling this for a couple of days now without any success. Hope someone can point me in the right direction.Yours,Jens
3
0
7.3k
Dec ’19
Reply to SwiftUI From/List Issue: All Buttons Trigger Simultaneously in List View
Confirm what darkpaw said. Whenever you have multiple buttons in a list row, you need to manually set the button style to .borderless or .plain . This is because buttons “adapt” to their context. According to the documentation: So when your button is in a List, its tap target extends to fill the row and you get a highlight animation. SwiftUI isn’t smart enough to stop this side effect when you have more than 2 buttons, so you need to set buttonStyle manually. .buttonStyle(.borderless) Get details here https://stackoverflow.com/questions/70399810/buttons-in-swiftui-list-foreach-view-trigger-even-when-not-tapped
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’24
In SwiftUI, how to hide tab bar when a list is tapped to show a new view (without the tab bar)?
This List in the first page of a tab view. When a cell is tapped, I want to show a new ChatRoomDetail view and hide tab bar. But I couldn't find a way in documentation. How should I do it? Thanks!struct ChatList: View { @State var showChatRoomDetail: Bool = false var items: [ChatRoom] var body: some View { NavigationView { List { ForEach(self.items) { item in NavigationLink(destination: ChatRoomDetail(currentMessage: , chatRoom: item)){ Text(item.titleString) } } }
7
0
11k
Oct ’19
Xcode 12.4 Performance
Hi there, updated Xcode to 12.4. After that, the overall performance of Xcode feels really slow. Just typing in the Editor und showing in the canvas is much laggier than before. Also starting the simulators feels like a pain. Is anybody else getting the same problems? I know that my machine (Macbook Pro 15, i7, 8GB) is not the fastest but Xcode 12.3 was much better in Performance.
9
0
3.1k
Feb ’21
Reply to Instruments: what is static AppName.$main() [inlined]
Hi marchyman, I'm guessing there are other methods being called by static AppName.$main() [inlined], but they might be framework functions and thus collapsed by default, depending on which view you look at. If you look at the heaviest backtrace view on the bottom right, you can click the small bottom at the top right of that backtrace view to toggle showing callings from functions that are not part of your app, e.g. from system frameworks. Sometimes this can give you a hint at what might be going on and what you can optimize. If you can post a screenshot of your Instruments trace document, we can help you interpret it. However, you mention SwiftUI, so here are some additional guesses what might help: What SwiftUI view are you using specifically? You are talking about a table. Are you really using the SwiftUI Table view, or maybe making something that looks like a table using a List or maybe VStack or Grid? List and Table should be lazy and only compute as many bodi
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’23
Reply to SwiftUi strange behaviour (bugs?)
If I put more than ten subviews into VStack/HStack/ScrollView/List, I got error Extra argument in call, but there is no extra argument (actually, I get this error if I just add 11 Text(Hello, world!)) It is a know limitation of the current implementation of SwiftUI. The Swift language currently does not support variadic generic parameters. So, in the implementation @ViewBuilder, can only get 10 arguments. I get this error if I just add 11 Text(Hello, world!) That Text(Hello, world!) definitely is the extra argument. All the views declared in VStack/HStack/ScrollView/List... are passed to a hidden method, each view as an argument. If I put List into ScrollView, this list is not rendered (just empty space instead it), but there is no any error/warning/log messages (like for wrong constraints) This is another known issue. You can find some articles searching with swiftui list in scrollview. List hides when adding in ScrollView SwiftUI
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’21
Reply to Hide separators in List (SwiftUI)
StackOverflow post - https://stackoverflow.com/questions/56489099/how-to-remove-row-separators-from-a-list-in-swiftui suggested something super tacky, would rather not do this. SwiftUI team, please just give us a .listSeparatorStyle(.none) view modifier.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’20