danielsaidi / Sheeeeeeeeet

Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`presentActionSheet` is getting an empty frame for animation

davidleee opened this issue · comments

I am playing with the demo on iPhone 13 Pro simulator with iOS 15.4.
Happens to find that the sheets don't seem to slide in from all the way down, but the animation looks fine while sliding out.

Here's what I mean with slow animation on:
屏幕录制2022-03-22 下午5 14 57

After some debugging, I narrowed down to an empty frame in ActionSheetStandardPresenter:

open func presentActionSheet(completion: @escaping () -> ()) {
        guard let view = actionSheet?.stackView else { return }
        let frame = view.frame    // this is an empty, all zero
        view.frame.origin.y += frame.height + 100
        let animation = { view.frame = frame }
        animate(animation, completion: completion)
}

Wondering if this is an intended behavior?

Hi @davidleee

It's not intentional :) Do you have an idea how to fix it?

Hi @davidleee

It's not intentional :) Do you have an idea how to fix it?

Well, I've fixed it for my own use case. Will try to make a PR but it will take some time.

That would be great, otherwise you can just post the code and I'll fix it.

I've summited a PR to fix this. Please let me know if I miss anything. 🤔

Related PR merged. Closing here.