Search results for

SwiftUI List performance

50,609 results found

Post

Replies

Boosts

Views

Activity

Reply to Pre-initialization of views?
Could you please provide some context on the steps you took to debugged the issue and code snippet that would help in reproducing the issue. Also, are you performing some operations in the onAppear closure? and are you using @State property wrapper to manage your view states. Keep in mind that the onAppear(perform:) method is completed before the first rendered frame appears and SwiftUI makes no guarantee as to the exact time the method is called.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
List half of an array
Dear all, I have initialized an array of a variable number of items @State private var squadre: [Squadre] = Squadre.test() Now, I'm showing in the following way the array: List { ForEach(squadre) { squadre in HStack { Text(squadre.squadra) Text((squadre.punti)) } } } I'd like to perform the following actions: Sort the array by the value punti (Int type) Show only the first half of the array in the list Do you have clue of how I can achieve it? I tried indexing the array, but didn't make it. Please support me. Thanks, A.
4
0
739
Mar ’24
SwiftUI list view with GroupedListStyle and horizontalSizeClass regular breaks on iOS 13.5 when turned to landscape mode
Looks like iOS 13.5 introduced a new bug, this is not reproducible in iOS 13.3. When using the following code and turn to landscape mode with device that has notch, the text inside the list gets cut off. Does anyone have any workaround or fix? Filed a bug report to Apple. var body: some View { ttList { ttttText(Some Text) tt} tt.listStyle(GroupedListStyle()) tt.environment(.horizontalSizeClass, .regular) }
2
0
1.4k
Jun ’20
iPhone7 very low performance issue
I have encounted an strange performance issue.For the same binary with neon cpu intensive task,iPhone4s performs better than iPhone7Plus.At first i guess it may be caused by different CPU arch: iPhone4 using armv7 and iPhone7Plus using arm64.But when I test the same binary on iPhone6, it performs normally as iPhone4s, far more better than iPhone7Plus, so the arm64 is confirmed no problem.Then I started to think may be the neon ASM code not optimized for Apple A10, hit align or cache missing issues.After many tests, I found iPhone7 performs good in some short period of time,and finnally I spoted when I set a breakpoint and then continue executing, the performance will greatly raised.Now I doubt this issue may caused by iPhone7 asymmetric multi core CPU and OS task schedle algorithm.Here is the first thread I've posted to webm fourm, for reference:https://bugs.chromium.org/p/webm/issues/detail?id=1345
0
0
307
Dec ’16
Extra Trailing Closure for List {}
I am a little lost. Why is Xcode complaining of this. Everything looks right here. I even removed my code and copy-pasted Apple's sample from here - https://developer.apple.com/documentation/swiftui/list Clean built and still get this. Not using List removes the error.
4
0
103
Apr ’25
Reply to Reducing space between list rows
Only solution that works for me is to use environment: List (myList, id: .self) { list in // your code here } .environment(.defaultMinListRowHeight, 12) // << NEW .overlay( // your code here I get this (I've added some bk color to see it better as well as separators Interesting discussion here: https://stackoverflow.com/questions/60474057/swiftui-reduce-spacing-of-rows-in-a-list-to-null
Topic: UI Frameworks SubTopic: SwiftUI
Sep ’24
List with ForEach Enumeration
When I enumerate an array of objects with ForEach, I often wonder how I use the array. For example, I have the following lines of code. import SwiftUI struct ContentView: View { @State var checkItems: [CheckItem] = [ .init(Susan), .init(Meagan), .init(Daniel) ] var body: some View { List() { ForEach(0..
1
0
738
Sep ’23
SwiftUI Menu
I want to use Menu in NavigationStack in my SwiftUI project. I found the menu list to wide - I want to use simple picture in the list. Menu{ ForEach(flagArray, id: .self) { name in Button { } label: { Image(name) // I want that the cell list will have maximum width 100 } } } label: { Image(name) .resizable() .frame(width: 40, height: 40) } I try to find a way to make it shorter. My .extension, MenuStyle, MenuCustomView didn't work. I found that you can hide it by simply .hidden! but how you can modify it? Please help
2
0
1.2k
May ’24
TabView in SwiftUI
I'm using SwiftUI. I want a child view that comes from a tab page to use all the screen, that is to say, to temperarily cover the entire tab bar. How should I do this? What code do I need?By the way, when I use a List, how to delete the line that seperate cells?thank you!
0
0
531
Oct ’19
How to write a performance test case
Currently I am facing some issues on writing a idea performance test case.Problem which I am facing could be lack of documentation.Method under test. func addStrings() { let maxCount = 100000 var array:Array = Array() for _ in 0.. array.append(Test) } }Performance test case.func testPerformanceExample() throws { // This is an example of a performance test case. let strings = StringsCreator() self.measure { // Put the code you want to measure the time of here. strings.addStrings() }How do i set the ideal paramters for testing?What is the relation between MAX STDDEV , RESULT , AVERAGE and BASELINE.Looking for a descriptive answer with example. Thanks in advance.
1
0
1.9k
Apr ’20
SecTrustEvaluate - what checks does it perform
There is no documentation that clearly states the checks that this method performs on the Server SSL Certificate.From the Technical note: TN2232 - https://developer.apple.com/library/ios/technotes/tn2232/_index.html//apple_ref/doc/navigation/#//apple_ref/doc/uid/DTS40012884-CH1-SECGLOSSARY1. I'm unsure if this method performs the X.509 checks mentioned in the above link2. Am also unsure if does the TLS specific tests that's also mentioned in the above link3. Because if it does so, then In my case of SSL Pinning using certifiecates signed by the company's Test CA (not the well known global ones eg. Verisign/Digicert/Geotrust), I'm guessing I will necessarily have to provide anchor certificates before callin the SecTrustEvaluate method or am I uncorrect in saying this?Got this link http://opensource.apple.com//source/Security/Security-55471/libsecurity_keychain/lib/SecTrust.cppam now reading it to see what checks are done... but have very little c++ experience, so an answer to this question wi
0
0
535
Jun ’16
reminders list
What determines what list reminders are included in, such as the Shopping List list of reminders that has it's own view in the Reminders app. How do I access that list and how do I create a separate list programmatically. Is there a class object that translates to a list?
2
0
1.6k
Jun ’17