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 ?
Search results for
SwiftUI List performance
50,605 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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.
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:
Could this help ? https://www.hackingwithswift.com/forums/swiftui/update-content-of-existing-row-of-list/3029
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
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:
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:
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.
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
Just did that. The dialog list was blank, but I hit Perform Changes anyways. Running the app again results in No such module Core Motion
Topic:
App & System Services
SubTopic:
General
Tags:
Yeah, I know it. So you're saying indented separator is correct behavior of SwiftUI List in NavigationView?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
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:
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:
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.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
My application is UIkit app(SWIFT + OBJECTIVE C ) , not swiftUI app , after implementing this new Widget kit how can I perform deeplink from widget to my app . can we call sometime thing like this in widget [self.extensionContext openURL:deeplinkURL completionHandler:nil];
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.