写一个刷新角标数的通用方法
可用于IM消息数或者购物车商品数
func refreshBadgeValue(number:Int){
for vc in (AppDelegate.shared.tabbar?.viewControllers)!{
if ((vc as! UINavigationController).topViewController!).isKind(of: MCartViewController.self){
if number < 100 && number > 0{
vc.tabBarItem.badgeValue = "\(number)"
}else if number <= 0{
vc.tabBarItem.badgeValue = nil
}else{
vc.tabBarItem.badgeValue = "99+"
}
break
}
}
}