-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Hi,
I installed the library through CocoaPods. Added a UIButton (just an image, no text) and set its class to MIBadgeButton. I didn't do any modifications through the IB.
Then I tried to increase the badge count every time the button is pressed. But when setting the badge string, the app crashes with a EXC_BAD_ACCESS error.
Below is my code.
import UIKit
import MIBadgeButton_Swift
class ViewController: UIViewController {
@IBOutlet weak var button: MIBadgeButton!
var count = 0
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func didTapButton(_ sender: MIBadgeButton) {
count = count + 1
sender.badgeString = "\(count)"
}
}I also uploaded a demo project here.
Metadata
Metadata
Assignees
Labels
No labels