mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-25 12:56:13 -04:00
TabBarBadgeCount
This commit is contained in:
parent
4ff054f0e5
commit
8714e2cf7d
@ -22,6 +22,7 @@ class DownloadTasksController: UITableViewController, NSFetchedResultsController
|
||||
tabBarItem.title = LocalizedStrings.LibraryTabTitle.download
|
||||
tabBarItem.image = UIImage(named: "Download")
|
||||
tabBarItem.selectedImage = UIImage(named: "DownloadFilled")
|
||||
refreshTabBarBadgeCount()
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
@ -77,6 +78,11 @@ class DownloadTasksController: UITableViewController, NSFetchedResultsController
|
||||
}
|
||||
}
|
||||
|
||||
func refreshTabBarBadgeCount() {
|
||||
guard let count = fetchedResultController.fetchedObjects?.count else {return}
|
||||
tabBarItem.badgeValue = count > 0 ? "\(count)" : nil
|
||||
}
|
||||
|
||||
// MARK: - TableView Data Source
|
||||
|
||||
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
|
||||
@ -214,6 +220,7 @@ class DownloadTasksController: UITableViewController, NSFetchedResultsController
|
||||
|
||||
func controllerDidChangeContent(controller: NSFetchedResultsController) {
|
||||
tableView.endUpdates()
|
||||
refreshTabBarBadgeCount()
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.7.1481</string>
|
||||
<string>1.7.1486</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.7.1833</string>
|
||||
<string>1.7.1839</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
Loading…
x
Reference in New Issue
Block a user