Search results for

SwiftUI List performance

50,608 results found

Post

Replies

Boosts

Views

Activity

List within a DisclosureGroup
Hello, I need to create a NavigationView with a List inside a DisclosureGroup but the list is not visible. Actually I did see one time a grey area of a list background. This is the code what I use. @State private var revealDetails = false var body: some View { VStack { DisclosureGroup(Show some Text, isExpanded: $revealDetails) { VStack{ Text(Some Text...) .padding() .lineLimit(5) Divider() List(){ Text(Hello, world!).padding() Text(Hello, world!).padding() Text(Hello, world!).padding() }.listStyle(SidebarListStyle()) Divider() } .padding() } Spacer() } } } Any suggestions, or could it be a beta SwiftUI 2 bug? Thank you
2
0
3.7k
Jul ’20
Reply to Type '()' cannot conform to 'View'
View here almost certainly means a SwiftUI view. Type () is another name for type Void, which is the return type of Swift functions or expressions that don't return a meaningful value. Here's how this can happen. If you have SwiftUI code like this: struct MyView: View { var body: some View { HStack { Text(abc) print(Got here) } } } your body function is building a SwiftUI view out of (essentially) a list of sub-views such as Text. The print statement, though, doesn't return a meaningful value (let alone a View that SwiftUI recognizes), so that line's type is Void aka (), and therefore can't belong to the list of views. All that's a long way round to tell you that you can't put arbitrary code inside a SwiftUI view, just things that SwiftUI allows. Of course, there might be other ways you can end up with the same error, but they all would reflect an issue similar to the example above.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’22
Reply to Preserving navigation state in NavigationSplitView detail view.
@milesegan You could try using a navigation link to perform navigation based on a presented data value: NavigationSplitView { List { NavigationLink(First, value: SelectedView.first) NavigationLink(Second, value: SelectedView.second) } } detail: { .... } Keep in mind that, If your List has a selection binding and it is of the same type as the navigation Link; when you activate the link, it will be added to the value of the lists selection and that resets the NavigationStack path.
Topic: UI Frameworks SubTopic: SwiftUI
Jun ’24
Performance Gains with Denormalization?
I'm new to Core Data, and busy trying to design my data model. I have tried to search for the answer in the forums as it's a rather classic issue I'm asking about, but couldn't find any relevent answers.I'm planning to tag content and store this content and the tags in my data model. Whenever I present the content in the app, I'll also present the tags. I thought it might be a good idea to denormalize this relationship by adding a 'tags' field to the Content entity and store the space delimited set of tags as a string. Then I could possibly do without a Tag entity. Part of my app allows users to define custom queries so a user could possibly want to see all content tagged with 4 or 5 (or more) tags. So they'd be building up a compond predicate with 4 or 5 AND clauses that are all evaluating the contents of the 'tag' string. Is this going to perform worse than simply creating a many-to-many join between a Content entity and Tag entity and querying across these tables? These queries are going to be use
0
0
449
Jun ’19
Particle Emitter performance
I use quite a lot of particles in my game, and I'm getting some performance issues under iOS 9.Spritekit now has an extra draw call for each Particle Emitter. So if I had 20 particle emitters in the scene, the draw call is increased by 20. This happens if the particles from the different emitters have the exact same texture and z position. This is obviously bad, as these particles should be batch drawn together. It affects performance quite significantly.iOS 8 worked as it should, not increasing the draw call for each particle emitter with the same texture and zpos.I've lodged a bug report for it, but has anyone else noticed it?Dan
7
0
1.4k
Oct ’15
Performing SPI Check
My new Mac Air M1 2020, when is pushing a new version to Apple Connect, it stays 3 minutes saying Performing SPI Check. I never saw this message before and it's deterministic on this mac. Xcode updated to the last version. What should I do?
16
0
11k
Mar ’22
XCode Performance
I am using XCode 11.3.1 and and iMac, 2017, 3.4GHz, Quad core i5 with 16GB of memory, Catalina 10.15.2. XCode seems very slow at times (e.g., startup, build times, preview times, simulator launch). It is particularly a problem for preview. Preview operations seem to take minutes at times. Using the activity monitor, I note that CPU utilization is low (well below that of a single core), memory pressure is low, and there appears to be minimal disk activity. The only culprit I can think of is network access. Network access may come into play because my project is located in Documents and Documents is on my iCloud Drive. Network access may also be an issue if XCode is extremely chatty for reasons of which I am unaware. My network latency is estimated to be 50ms. Even so, if I move everything off iCloud, there is no noticable change in performance. I have also encountered file not found errors on added files that were located on iCloud drive and not copied where the files had not be downloaded yet.What sh
1
0
759
Jan ’20
Reply to Can I set images async in a CPListTemplate in CarPlay?
You should only need to use -[CPListTemplate updateSections:] if you are adding, removing, or reordering list items in your list template. If instead you are updating existing list items, for example to change the list item image, then -[CPListItem setImage:] should be all you need, and the system should automatically reload the affected rows in your list template to display your new image. Please make sure you're trying out the latest iOS 14 SDK (or iOS 15 Beta), as a number of performance improvements have been made here!
Topic: App & System Services SubTopic: General Tags:
Jun ’21
Hello Compute performance...
The sample code HelloCompute (that demonstrates how to perform data-parallel computations using the GPU) needs 13 ms on an iPhone 5S to perform this very basic kernel on a 512 x 512 RGBA texture.kernel void grayscaleKernel(texture2d<half, access::read> inTexture [[texture(AAPLTextureIndexInput)]], texture2d<half, access::write> outTexture [[texture(AAPLTextureIndexOutput)]], uint2 gid [[thread_position_in_grid]]) { half4 inColor = inTexture.read(gid); outTexture.write(inColor, gid); }Unless I'm mistaken, this represent only 80MB loads and 80MB writes per second. Considering my current Neon code does 10 time more load and read per second, those numbers seem very low, no?
6
0
2.8k
Nov ’18