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

`didDismissWithBackgroundTap` not called

alfredcc opened this issue · comments

commented

here is the code in demo.

sheet.presenter.events.didDismissWithBackgroundTap = { print("Background tap!") }

Is the sheet dismissed when tapping the background?

commented

Is the sheet dismissed when tapping the background?

yep. I tapped on the background, the sheet was dismissed but the function was not called.

Ok, great. I'll check!

commented

I can reproduce it in this demo.
My Xcode version is 13.0. os version: 14.7.1

commented

@danielsaidi
here is the workaround
because the presenter is nil before sheet is presented.

sheet.present(in: self, from: cell.textLabel) {
    sheet.presenter?.events.didDismissWithBackgroundTap = { print("Background tap!") }
}

Oh, great! I'll update the demo.

Demo updated, thank you!