Swiftui slow scroll with a long list of items macos - list

I'm having an issue when scrolling in my app. It has a long list of items (~300) and when I scroll it is very slow.
I tried a lot of things like switching to lazyvstack, adding an id to the list, using ScrollBar and none of them seem to work.
It is a macos app using swiftui 2.0

Related

SwiftUI Photo Gallery View Smooth Scrolling

I'm building a photo gallery using SwiftUI, and am trying to ensure that a user can smoothly scroll through thousands of photo thumbnails without performance degradation or visible load times for each photo.
So far, my research has led me to use a lazyvgrid within a ScrollView, which seems to perform better than a lazyvstack or a normal grid when working with a large data set. However, when scrolling through the lazyvgrid, it takes a moment for each new row of thumbnails to load (since lazyvgrid is lazy), and this is especially noticeable when scrolling very quickly.
Ultimately, I'm wondering how other apps with photo galleries get around this issue. Is it impossible to avoid when using SwiftUI, and would I need to use something like UIKit's CollectionView with prefetching?
Here's what I'm doing currently:
ScrollView {
LazyVGrid(columns: vGridLayout) {
ForEach(photoLibraryService.items, id: \.self) { asset in
PhotoThumbnailView(assetLocalId: asset.localIdentifier, mediaType: asset.mediaType, duration: asset.duration)
}
}
}
And here's what it looks like when I scroll through it quickly:

How to implement vertical scroll page on watchOS with SwiftUI

I want to implement a vertical scroll page like system workout app.
Now I can get a similar effect with this:
    TabView {
      page1
        .rotationEffect(.degrees(90))
      page2
        .rotationEffect(.degrees(90))
    }.tabViewStyle(.page(indexDisplayMode: .automatic))
    .rotationEffect(.degrees(-90))
But not good as system workout app does. It supports digital crown and dynamic show indicator and custom color.
So , how to implement that vertical scroll effect?
https://github.com/fredyshox/PageView
This repo works well except crown supports.

ZIPFoundation progress displayed using SwiftUI ProgressView

I'm having an application in SwiftUI and I am using ZIPFoundation to uncompress an archive. This works fine. At the moment I am using native SwiftUI ProgressView(title) to display during the uncompress process, again working fine, anyway it only displays a rotating wheel and no progress scale.
I would like to change to ProgressView(title, value, total) to display the scale, anyway not sure how. I have found this example, but it uses UIKit and addObserver() and I am not sure how to adapt this to SwiftUI, or if there is better way with SwiftUI.
Can anyone please help.

iOS 11 - Navigation Bar loading with half height during push transition

Since updating from Xcode 8.3 to 9, I'm seeing this weird behaviour that during push transition the target controller's Navigation Bar is loading with half height first and then settling with correct height.
Happening on all the screens of different navigation controllers.
Tried enable/disable nav bar translucent, and Safe Area Layout Guides but of no help. Happening only on iOS 11. For new view controllers too.
Screencast showing this behaviour.
Turns out that I'm using an old version of KMNavigationBarTransition library that uses method swizzling to manage navigation bar style during push transition. Update of this library fixed the issue.

Undesired auto scrolling of QComboBoxes

I discovered that in the latest Qt versions (currently I use 5.4.1 but it was the same in 5.2) if I add several items to a QComboBox and I position the mouse cursor in specific positions it will scroll itself which is really annoying ... I think.
I've got a very simple GUI created in Qt Designer. It only contains one QComboBox. I added a lot of items (30) to it to be able to check this bug. If the first N items are visible it cannot be reproduced, but if I scroll down a little, and then position the mouse as on the image with the red dot and starts moving the mouse around it then the auto scrolling started.
It does not seem like a great bug, but when you just want to move the mouse cursor away and it results that the list scrolls away.
UPDATE:
I found out that it can be only reproduced if the first item in the list is an empty string. Without that it works just fine.
It is a bug in the version of Qt 5.4.1. Reported.