Added done button to keyboard in Customization View Controller, added code for Firebase notifications (non-functional without APNs key from a developer account)

This commit is contained in:
Deniz Duezgoeren
2019-08-21 19:36:56 +02:00
parent 769ba6cf45
commit 573e5a5ab7
8 changed files with 99 additions and 26 deletions
+9 -2
View File
@@ -17,6 +17,7 @@ class MenuViewController : UIViewController, UICollectionViewDataSource, UIColle
let layout = MagazineLayout()
var collectionView: UICollectionView
let identifier = "menu_cell"
let prefs = UserDefaults.standard
required init?(coder decoder: NSCoder) {
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
@@ -62,6 +63,14 @@ class MenuViewController : UIViewController, UICollectionViewDataSource, UIColle
self.items = menuItems as! [String]
self.collectionView.reloadData()
self.refreshControl.endRefreshing()
if let tabItems = self.tabBarController?.tabBar.items {
let tabItem = tabItems[1]
if self.prefs.integer(forKey: "personalPlanCount") != 0 {
tabItem.badgeValue = "\(self.prefs.integer(forKey: "personalPlanCount"))"
} else {
tabItem.badgeValue = nil
}
}
}
}
@@ -83,8 +92,6 @@ class MenuViewController : UIViewController, UICollectionViewDataSource, UIColle
return cell
}
// generated stubs filled with return values
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeModeForItemAt indexPath: IndexPath) -> MagazineLayoutItemSizeMode {
let widthMode = MagazineLayoutItemWidthMode.fullWidth(respectsHorizontalInsets: true)
let heightMode = MagazineLayoutItemHeightMode.dynamic