Changed InfoViewController out for a UIAlertController

This commit is contained in:
Deniz Duezgoeren
2019-09-16 19:05:06 +02:00
parent d83f8f7342
commit 3608d7d363
9 changed files with 51 additions and 120 deletions
+8 -1
View File
@@ -9,7 +9,7 @@
import UIKit
import MagazineLayout
class MenuViewController : UICollectionViewController, UICollectionViewDelegateMagazineLayout {
class MenuViewController : UICollectionViewController, UICollectionViewDelegateMagazineLayout, UITabBarControllerDelegate {
var items = [String]()
private let refreshControl = UIRefreshControl()
@@ -47,6 +47,7 @@ class MenuViewController : UICollectionViewController, UICollectionViewDelegateM
refreshControl.addTarget(self, action: #selector(objDoAsync(_:)), for: .valueChanged)
refreshControl.tintColor = #colorLiteral(red: 0.07843137255, green: 0.5568627451, blue: 1, alpha: 1)
refreshControl.attributedTitle = NSAttributedString(string: NSLocalizedString("fetch_menu", comment: ""))
self.tabBarController?.delegate = self
self.items = self.df.readMenu()
self.collectionView.reloadData()
@@ -68,6 +69,12 @@ class MenuViewController : UICollectionViewController, UICollectionViewDelegateM
}
}
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
if let alert = self.df.presentInformationAlert(for: tabBarController, at: 3) {
self.present(alert, animated: true, completion: nil)
}
}
override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.items.count
}