Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dismissHandler to BLTNItemManager #199

Open
JCsplash opened this issue Jan 10, 2021 · 0 comments
Open

Add dismissHandler to BLTNItemManager #199

JCsplash opened this issue Jan 10, 2021 · 0 comments

Comments

@JCsplash
Copy link

Hi @alexisakers thanks for the great library!

Recently, I needed to know when a BLTNItemManager has dismissed and didn't want to implement a dismiss handler and every BLTNItem so I added a publicly accessible dismissHandler to the BLTNItemManager class. I would make a PR but since it's a small addition, thought Id just comment the code here.

@objc public final class BLTNItemManager: NSObject {

    /// Executes custom function when BLTNItemManager is dismissed
    public var dismissHandler: (() -> Void)?

}
    @nonobjc func completeDismissal() {
    
        // Calling BLTNManager's Main Dismiss Block (Set by User)
        dismissHandler?()

}

I followed the logic in this S/O answer: https://stackoverflow.com/a/45619821/8074346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant