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

How to add number badge label for BoomButton #5

Open
anhkieet opened this issue May 29, 2017 · 2 comments
Open

How to add number badge label for BoomButton #5

anhkieet opened this issue May 29, 2017 · 2 comments

Comments

@anhkieet
Copy link

Hi Nightonke. Have a nice day.

Could you show me how to add number badge label for BoomButton. Many thanks 👍

@Nightonke
Copy link
Owner

Hey.
Do you mean adding a label to the sub-buttons(boom-button)? Currently there is not a convenient way to achieve that. But you can try this method of BMB:

    /// Get the boom-button at index. Notice that the boom-buttons may not be created by BMB, so this method may return nil.
    ///
    /// - Parameter index: Index.
    /// - Returns: The boom-button at the given index, may be nil.
    public func boomButton(at index: Int) -> BoomButton? {
        if 0 <= index && index < boomButtons.count {
            return boomButtons[index]
        }
        return nil
    }

You can get the boom-button after booming(must at this time because the boom-buttons may not be created), then add a custom-views and animations to each boom-button.

@anhkieet
Copy link
Author

@Nightonke I have hamburger button (BoomButton) on navigation bar. And I have 3 sub-buttons (settings, chat, ranking). I want to show number unread message in chat button when tapping hamburger button :)

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

2 participants