Recent update broke cells auto-sizing and updating. #113
Comments
That is some strange behaviour indeed! I would appreciate a project that exhibits the issue as I couldn't manage to reproduce it to investigate. |
An unrelated suggestion: look into using a monospaced font for your timers, it's an easy way to avoid them changing size as the numbers change :) |
Got the same problem after update 🙁 |
@1234igor also using a flowLayout? |
@apptekstudios Hey! Regarding the monospaced font suggestion, I already dealt with that. Well, kinda. Inside every timer cell there is an invisible Text View with “88:88”, so that the width of the view doesn’t change every second :) |
@apptekstudios How could I send you my project privately? |
Please see my email 👍 |
@alexeyprimechaev Has everything been working with the latest version + changes I sent through? |
@apptekstudios not really. (you can see that the width of the cells doesn't actually change and yet they flicker like hell) |
@alexeyprimechaev I’ve made some further changes in V1.4 (which is now released) that I’m hopeful will resolve this. |
@apptekstudios Yes, now layout behaves as expected and cells only resize whenever necessary! However, (this one is probably specific to my project) when timers are run in default loop, scrolling works, but the views pause updating (while dragging) and the ASCV autoscrolls back to top on every redraw (I presume). When timers are run on the main thread the individual views do update, but scrolling is fundamentally broken as when even while dragging views are updating, and ASCV is attempting to scroll to the top. Both cases: https://imgur.com/a/ahFnTat ❤️❤️❤️ |
I’m working on moving the diffing (UICollectionViewDiffableDataSource) to a background thread, this should improve performance and hopefully mean updates are less susceptible to other things blocking the main thread. Regarding the scrolling to top, I’m not sure why this would be happening and will investigate later today :) An app I’m currently working on also has a timer view that needs regular updating, and I’ve found that (even without ASCollectionView) SwiftUI is struggling to keep up and is sometimes blocking user interaction. I’ve come up with a solution to ensure only the timer label is being refreshed (vs the entire view) and will aim to share ASAP 👍 |
The views not updating while scrolling is actually a known UIKit quirk. UIScrollView blocks the main runloop so timers aren't called. Schedule your timer specifically setting the let newTimer = Timer(timeInterval: 0.1, repeats: true, block: step)
RunLoop.current.add(newTimer, forMode: .common)
timer = newTimer https://stackoverflow.com/questions/5377914/uilabel-updating-stops-during-scrolling-uiscrollview |
I have identified the cause of scrolling to the top, turns out that setting certain UICollectionView properties resets the scroll position, even if they are unchanged. I will release an update shortly to address that 👍 |
@alexeyprimechaev Another recommendation regarding your code would be to decouple the coreData model from your actual timer class. Currently whenever the |
V1.4.1 should resolve the issue with scrolling back to the top 🎉 |
@apptekstudios checked out the update — yup, scrolling now works, and almost perfectly. I only have a couple of minor complaints with your otherwise beautiful library. |
@
will definitely work on that 👍 |
Regarding lack of animations, try wrapping your state change in a |
Describe the bug
A recent update (not sure which one, but I've switched from the dev branch (now non-existent) to the master branch) completely and utterly destroyed my layout (I'm using the layout from the TagsScreen Demo). Now cells not only flicker and are of incorrect sizes, but also not interactable while updating. Context menus (awesome menus tho) also do not work.
I'm attaching videos of behavior before the update and after.
I'm currently building an application that heavily relies on your wonderful library, so it would be very sad if I was unable to continue using it.
Love your work ❤️❤️❤️
To Reproduce
I could send you my project if you're interested.
Expected behaviour
Everything working gracefully.
Screenshots
https://imgur.com/a/fppwCwn
Xcode Version:
11.4 Beta
Simulator, Device, Both?
Both
The text was updated successfully, but these errors were encountered: