Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

Omit items from List without leaving a gap in produced list
I'm working on an app in SwiftUI, Xcode 12.4 / iOS14. In one view I need to produce a list - but the data for the list is subject to an if / else condition - if a condition is met then the item should be omitted from the list. This works - but the list now has gaps in it from where items have been omitted. Question is - is there a way to produce a list and omit the gaps or would I need to rebuild a new set of data using the if / else condition and then pass that to the list to avoid gaps ?
4
0
690
Apr ’21
List Categories
Hello, I'm just starting with Xcode and I was trying to learn with apples examples. I wanted to edit one off the example Apps to my liking but don't really know how to do so. In the App, the national parks are divided in three categories: Lakes, Mountains and Rivers. (see image) As of now to see all listed parks you would go to the list icon and see a list of all the parks. (see image) What I want to do is the following: When you click on the list Icon, you won't see all the listed parks, but a short list of the previously mentioned categories and by clicking on the list you'll see the parks in the chosen category. This is the program I'm using. https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit I hope somebody can help me with this project. If you got any follow-up questions please let me know.
0
0
380
Aug ’22
CILanczosScaleTransform performance
I am trying to use a CIFilter : CILanczosScaleTransform. Basically, I perform two basic steps :Feeding an image/video frame to the CIFilter and getting the output : CIFilter *f = [CIFilter filterWithName:@CILanczosScaleTransform];// Downscale the image [f setValue:[NSNumber numberWithFloat:scaleFactor] forKey:@inputScale]; [f setValue:[NSNumber numberWithFloat:1.0] forKey:@inputAspectRatio]; [f setValue:inputImage forKey:@inputImage]; CIImage *outImage = [f valueForKey:@outputImage];2. In the second step I render the image on to a CVPixel buffer CVPixelBufferLockBaseAddress( outputPixelBuffer, 0 ); [ciContext render: outImage toCVPixelBuffer:outputPixelBuffer]; CVPixelBufferUnlockBaseAddress(outputPixelBuffer, 0);Here the cicontext is created from a OpenGL context. EAGLContext *eaglContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];NSDictionary *options = @{ kCIContextWorkingColorSpace : [NSNull null] }; CIContext *ciContext = [CIContext contextWithEAGLContext:eaglContext options:
0
0
519
Jun ’15
Reply to How do I create this type of list?
I was not speaking of a SwiftUI design (not sur the Settings app was coded in SwiftUI).And, so far, SwiftUI is still les flexible than Storyboard based designs.That may be the reason.However, everything needed seem to be present in your code.Did you try to set the list type into.listStyle(GroupedListStyle())
Topic: App & System Services SubTopic: General Tags:
Nov ’19
Reply to Additional Appearance Calls Triggered When Removing TabView or NavigationView/Stack From View Tree
I faced the same problem recently and my workaround is to create a view modifier for authenticated views and use it only for such screens/views: import SwiftUI struct GuardedOnAppearViewModifier: ViewModifier { let perform: () -> Void @EnvironmentObject private var accountState: AccountState func body(content: Content) -> some View { content .onAppear { guard accountState.isAuthorized else { return } perform() } } } extension View { func onGuardedAppear(perform: @escaping () -> Void) -> some View { modifier(GuardedOnAppearViewModifier(perform: perform)) } } So when I'm logging out none of my onAppear method of authorized views will be called during the removal of NavigationView.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’23
Swift performance today?
When Swift was new, people liked to do various performance tests and compare Swift to C++. Swift was often lagging behind in those early days, but we are now at version 3 and I'm sure the team made many optimizations and fixed many bugs. So I am wondering if there are any new performance tests or discussions of the performance.
3
0
755
Oct ’16
SwiftUI List scroll indicator stutters, does not call `onAppear` or `onDisappear` consistently in iOS 16
My team has been debugging problems with the SwiftUI List component this week. We have found that it's performance is sub-optimal on iOS 16. You can see a simple grid of images, the scroll indicator stutters when scrolling down: Now compare it to what happens when we use a ScrollView with a LazyVStack: (An error occurred while uploading my second image, but pretend you see a scroll indicator moving smoothly down the side of the screen). You can see the scroll indicator moves smoothly without issue. We also found that the ScrollView combined with a LazyVStack properly calls onDisappear, which enables us to call a cancel method on the async image loading code that we use for our individual cells in this example. Though in a previous question, it was asserted that onDisappear cannot be reliably expected to be called in a List, I do not feel that answer is correct or proper behavior. Is this a bug, or is this expected behavior on a List? This is the cell that is being
2
0
2.2k
Oct ’22
Reply to Performance of selecting table rows
AFAIK, Finder is not using SwiftUI… Well, yes. But I'd expect a table view constructed with SwiftUI to have similar performance characteristics to one built with AppKit. Is it on simulator or on device ? Could you post the code or the reference to the sample app ? I am posting about the Garden App SwiftUI Mac app that is built during the code along WWDC21 sessions. See the tags for more info.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’21
Reply to SwiftUI Version
The changes/additions to SwiftUI are only going to be available on iOS 14 and beyond. If you look at the list here - https://developer.apple.com/documentation/swiftui/views-and-controls, you can look for the items marked Beta, which are a part of the new SwiftUI additions and are only available on iOS 14 and beyond.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’20
Reply to Any SwiftData change updates every SwiftUI view
I believe the behavior you described is what the framework currently implemented, and that's because it is hard for SwiftData to determine if a change is really relevant to the result set (Items) with reasonable performance, especially when object graph is complicated. You are right though that the change on UnrelatedItem is irrelevant and that triggering a SwiftUI view update in this case is unnecessary. I'd hence suggest that you file a feedback report for SwiftData folks to see if any potential improvement can be done – If you do so, please share your report ID here for folks to track. In a typical case, this doesn't seem to lead to any serious issue because, as you have noticed, SwiftUI is smart enough to determine (based on the attribute graph it maintains) that the view hierarchy under the list is only relevant to Item, and so doesn't go further to update the view hierarchy. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Feb ’25
2. 3 Performance: Accurate Metadata Guideline 2.3.1 - Performance
2. 3 Performance: Accurate Metadata Guideline 2.3.1 - Performance We discovered that your app contains obfuscated code, selector mangling, or features meant to subvert the App Review process by changing this app's concept after approval to the App Store.My previous version of app got approved.Current version of app minor UI/UX changed and i received above app rejection reason from apple.Any suggestion.
10
0
15k
Jan ’19