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

Badge is not always showing #43

Open
hannesoud opened this issue Jun 26, 2017 · 0 comments
Open

Badge is not always showing #43

hannesoud opened this issue Jun 26, 2017 · 0 comments

Comments

@hannesoud
Copy link

I have a 3 UIView controller and they are called in sequence in navigation stack.
VC1->VC2->VC3

VC2 has UIBarButtonItem and it shows number of cart items in viewWillAppear() and it doesn't show when pushed from VC1, but shows when popping from VC3.

Here is code

@IBOutlet weak var cartItem: UIBarButtonItem!

override func viewWillAppear(_ animated: Bool) {
        if count == 0 {
            self.cartItem.clearBadge()
        } else {
            self.cartItem.badgeBgColor = UIColor(hex:"71c386")
            self.cartItem.badgeCenterOffset = CGPoint(x:-16, y:0)
            self.cartItem.badgeFont = UIFont.boldSystemFont(ofSize: 12)
            self.cartItem.showBadge(with: .number, value: count, animationType: .none)
        }
}

I am using Xcode 8.3.2 and testing on iOS 10.3.1 iPhone 6 plus.

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