添付のスクリーンショットのようなバッジ アラート ラベルを追加しようとしています。
タイトル、ラベル uitabbar アイテムを検索しようとしましたが、行き詰まっています。
どんな提案でも大歓迎です。
添付のスクリーンショットのようなバッジ アラート ラベルを追加しようとしています。
タイトル、ラベル uitabbar アイテムを検索しようとしましたが、行き詰まっています。
どんな提案でも大歓迎です。
Xcode 7.2.1 スウィフト 2.1.1
次のように、目的の UITabBarItem の BadgeValue を設定するだけです。
tabBarController?.tabBar.items?[4].badgeValue = "1" // this will add "1" badge to your fifth tab bar item
// or like this to apply it to your first tab
tabBarController?.tabBar.items?.first?.badgeValue = "1st"
// or to apply to your second tab
tabBarController?.tabBar.items?[1].badgeValue = "2nd"
// to apply it to your last tab
tabBarController?.tabBar.items?.last?.badgeValue = "Last"
UITabBarItem からバッジを削除するには、 nil 値を追加するだけです
tabBarController?.tabBar.items?.first?.badgeValue = nil