SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 741 forks source link

feat(TopBottomPresentable): Adds 'TopBottomPresentable' protocol, allow any Animator to be presented correctly by the `Presenter` #548

Closed lifely closed 1 week ago

lifely commented 2 months ago

The current implementation of Presenter check for a topBottomStyle using TopBottomAnimation.Style enum which allow during install to present the Message over or under navigation-bar and tab-bar.

However the current implementation of the topBottomStyle computed property limit all customisation of behaviour and only allow presentation in .top or .bottom style with the TopBottomAnimation animator.

I've implemented a simple TopBottomPresentable protocol which return the TopBottomAnimation.Style? behaviour needed; thus we can add conformance of this protocol to our existing TopBottomAnimation and PhysicsAnimation.

This would allow customisation in any Animator in the futur by simple conforming to TopBottomPresentable.

Hope this is convenient for other people as well and can make it in, I'll be available if you need any change or need to drop the last commit (podspecs & version change for my own use atm)

wtmoose commented 2 months ago

Seems like a good improvement. I’ll try to get to this soon, but I’m super busy right now

lifely commented 2 months ago

no worry @wtmoose we all know how busyness can get 🐝

If you need anything done just holla @ me 👋