Comments (12)
There is a new version of LNPopupUI too, which will no longer display the empty image on the bar if you don't set an image.
from lnpopupui.
Thanks, I’ll take a look. With 2.18, it’s supposed to gate each operation/animation. I guess it’s not as air-tight as I hoped.
from lnpopupui.
Hello,
Can you please check which version of LNPopupController you have cached in Xcode?
Please try updating to the latest version.
Thanks
from lnpopupui.
2.18.0, which is latest if I'm not mistaken.
from lnpopupui.
This is such a hard problem to solve. The SwiftUI/UIKit bridge manages to hide this issue by either disabling interactions during the transition (sheet) or breaking animations (showing/hiding navigation bar). I'm really not sure what to do. Not sure how to throttle or maintain state across animations.
from lnpopupui.
Would the animation break by snapping it back to shown when interrupting the animation to close? If that's the case, I'm not personally against it, but I figure you'd prefer it to be smoother for an official release. The way it is now kinda messes with the user experience in my opinion, getting stuck in this weird shown/hidden limbo.
from lnpopupui.
The issue with interruptible animations is that the underlying LNPopupController framework was never really designed to operate like this. It used to be a user error to change state while a transition was happening. One was supposed to listen to state events (didPresent, didOpen, etc.) and throttle UI on their own, considering the state. With SwiftUI, this is not really possible, and I did try to make it somewhat interruptible, but never got it to 100%. This queue mechanism I added recently was supposed to hide this, but I guess it doesn't work as you say. Apple is doing something similar too (try showing+hiding+showing+hiding+showing a sheet very fast—it will go the same queue mechanism), but their hacks are better behaved than mine. :)
from lnpopupui.
It's even worse. Even adding a hack at the UIKit level (just testing, not really for production), which blocks touch events while the animation is running, SwiftUI is so asynchronous that it manages to get several taps on the button before UIKit gets to run and disable interactions. 🤣 SwiftUI is just peaches.
from lnpopupui.
OK, I did something, and at least from a quick play, it seems to work correctly so far. I'll make a new LNPopupController release, so you can test to see if it solves your issues. Events are now being coalesced, so this might be enough to prevent crazy queues.
from lnpopupui.
Please try with LNPopupController 2.18.1.
from lnpopupui.
Massive props, works like a charm now.
https://github.com/LeoNatan/LNPopupUI/assets/40129637/868a5727-0637-4666-b755-0ff3d4a3863f
I did add a small check on my end to make sure whenever its switched to false it checks if it should be set to true, and switch it back this has helped to update it right as it can after the animation to keep it on track.
.onChange(of: showPopupBar) { popupBarOpen in
if !popupBarOpen {
if queueManager.queue.count > 0 {
showPopupBar = true
}
}
}
Huge Thank You!
from lnpopupui.
Great, thanks for confirming!
Happy coding!
from lnpopupui.
Related Issues (20)
- Change color of now playing bar background HOT 5
- popup bar and popup content can get stuck in wrong position when dismissing a modal sheet with the keyboard in a transitory state HOT 20
- iOS 15.2 has broken safe area insets under some conditions HOT 1
- LNPopupController: The popup controller is already in transition. Will ignore this transition request. HOT 2
- Using a custom view for the popup bar breaks presentation/dismiss animations HOT 4
- Run the example project HOT 1
- How to cooperate with withAnimation(...) when switching PopupOpen HOT 1
- After adding .popupBarStyle(.prominent) or .popupBarProgressViewStyle(.top) or .popupBarMarqueeScrollEnabled(true) to the View hierarchy, iOS keyboard will resign after single keypress HOT 3
- Possible regression between 1.4.0 and 1.4.1 in popupBarItems HOT 4
- Can't build test target while using LNPopupUI HOT 5
- Gesture Conflict HOT 3
- Interaction Style issues HOT 5
- State management breaks on quick opening/closing of the popup HOT 10
- Popover's background Scale Effect HOT 1
- Make popup image nullable
- Updating popup content while popup is closing causes popup to get stuck in a loop of closing and opening endlessly. HOT 6
- popupBarCustomView produces too much padding HOT 2
- Inconsistent Scrolling in PopupView HOT 2
- Limiting dragging area HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lnpopupui.