Search results for

SwiftUI List performance

50,614 results found

Post

Replies

Boosts

Views

Activity

SwiftUI NavigationSplitView EditMode
Dear Apple Engineers / SwiftUI team! NavigationSplitView A correct navigation will be provided by List 'selection' parameter, however in case of editing (EditMode) it should be occupied by dynamic data collection set... How do you think to alternate between these two parameters? @EnvironmentObject private var router: Router @State private var selection: Set = [] Navigation List(selection: $router.selectedItem) { ... } EditMode Active List(selection: $selection) { ... } Thanks in advance.
0
0
463
Apr ’23
Newbie ... Lists and Views
Hi , I am new to SwiftUI and Mac/iOS concepts so am on a very steep learning curve. If this is not the correct forum for this please let me know and I will delete and post elsewhere ... Basically I am doing a favor for a friend and writing a simple data collection app for his iPad in Swift... it consists of a quite long list list of items to select from, each of which will have several possible values. Clicking on a Change button next to each item will bring up a list of possible values to choose from. So .... The code works except that the list is displayed as an icon and has to be clicked to display the items to choose from ... **How do I get the list to display automatically when instanced without having to click on the List icon ? ** Code: I have a list view which is called as the result of a button press: Button(action: { isShowingList=true When the View is refreshed (State variable) results in the Selectable List view as fo
Topic: UI Frameworks SubTopic: SwiftUI
1
0
338
Jul ’24
Reply to sth wrong with .searchable
pulling down wont work Surprising, I tested, it worked. You have to drag the list down (that's what the screenshot tried to illustrate). Did you read the sarunw post ? Did you see the SwiftUI animation ? Is it a MacOS app (you didn't tell). Use is quite different on MacOS: https://developer.apple.com/documentation/swiftui/view/searchable(text:placement:)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to Just me, or SpriteKit in GMs terribly broken?
@indiedeveloper said: Many performance issues has been solved by the engineers, and they seem to be aware of the bugs.This is the third time I've seen you make these sorts of unsubstantiated claims - no corroborating evidence, nor proof.Where is the list of changes made?Care to elaborate on ANY specific performance issues that have been solved?Just seeing the fact that any single specific performance issue has been recognised and then fixed would go a little ways to supporting the idea the that they are doing something, and aware.Empty anecdotal evidence seeds only further doubts.
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Oct ’15
Reply to Is it possible to delete an item from Coredata using onTapGesture?
hi, the .onDelete modifier is usually something you add to a ForEach, as in List { tForEach(items) { item in ttText(item.name) t} tt.onDelete(perform: yourDeleteFunction) } the .onTapGesture is something you would add to a view associated with an item in the list, within the scope of the ForEach: List { tForEach(items) { item in ttText(item.name) ttt.onTapGesture({ doSomething(to: item) }) // doSomething could certainly delete this item t} } (i think that's right and) hope that helps, DMG
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’20
Reply to Custom @Observable RandomAcccessCollection List/ForEach issues
Ultimately you do need to use a data structure that provides you with collections of identifiable elements. If you're down the path of using a custom data type, for example ExpModel, you'll a IndexedIdentifierCollection. And using an Array in the view body has its performance issues because every time the body is evaluated a whole new array is being allocated. I recommend you review Demystify SwiftUI performance - WWDC23 - Videos - Apple Developer. It covers this topics.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25
Is 'List' unsupported in Widgets?
The following code, in an independent project works fine: struct ContentView: View { var body: some View { List { Text(Hello, world!) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } The following code in a Widget Extension results in an error being displayed in the SwiftUI view (it builds fine): struct ContentView: View { var body: some View { List { Text(Hello, World!) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() .previewContext(WidgetPreviewContext(family: .systemMedium)) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView().previewContext(WidgetPreviewContext(family: .systemMedium)) } }
0
0
720
Aug ’20
Reply to How to embed List in ScrollView using SwiftUI
Notes has a Recently Deleted folder view that shows a search field and some captions above the list. The whole vertical stack is scrollable. That makes me think they're using UIKit and not SwiftUI. Video Using ForEach with a Divider won't allow .swipeActions to work, as it must be inside a List.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’21
Detailed Performance Counters setup?
Is there any special setup needed to get GPU Frame Capture to produce the new Detailed Performance Counters?When I click on the GPU icon in the Debug Navigator after having performed a GPU Frame Capture the Editor Frame just shows a “No data” message.I’m running Xcode Version 9.0 beta (9M136h) under 10.12.5 (16F73) andtesting on an AppleTV running tvOS 11.0 (15J5284g) andiPad Air (Model A1475) running iOS 11.0 (15A5278f).
3
0
779
Jun ’17
AppIntent perform method not called.
We have a widget bundle with multiple widgets. I'm adding a widget that is interactive (iOS 17 and higher). Our widget code is in a static library that gets linked into the widget extension target in our main app Xcode project. I have SwiftUI buttons constructed with the intent constructor in our UI See https://developer.apple.com/documentation/swiftui/button/init(intent:label:) When I press the button the timeline refreshes (conforming to TimelineProvider) but the perform method doesn't seem to be called. I've seen multiple pieces of advice and none of them seem to work. I've tried on a physical device and a simulator. I've tried adding an AppIntentsPackage. I've tried including the AppIntent code in the app and the widget. I've tried setting the openAppWhenRun to true and false and not setting it at all. I've tried simplifying the intent to just printing out a line to the console and returning a result. At this point I have no idea how to debug this and I don't know what else to t
4
0
357
Mar ’25
Swift Array removeAll() performance (slow)
Using Swift Array I found removeAll() to be very slow and not perform well. Especially the larger the array (the more objects it contains), the slower it was. Is there a way to achieve good performance while performing the same function as removeAll() of an array? = [] This method also performed the same. And the way to declare the array after making it optional had the same performance. swift / xcode is the latest version and is being tested on iOS 15.4 / iOS 14.8 / iphone6s. Or can't Apple make a new function that speeds up the performance of removeAll()??
2
0
1k
Mar ’22