Archived
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:
@@ -9,7 +9,7 @@
|
||||
import UIKit
|
||||
import MagazineLayout
|
||||
|
||||
class CustomizationViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateMagazineLayout {
|
||||
class CustomizationViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateMagazineLayout, UITextFieldDelegate {
|
||||
|
||||
var courses = [String]()
|
||||
var translatedCourses = [String]()
|
||||
@@ -24,6 +24,16 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource,
|
||||
@IBOutlet weak var txtCourses: UITextField!
|
||||
@IBOutlet weak var defaultSegments: UISegmentedControl!
|
||||
|
||||
@IBOutlet weak var textToolbar: UIToolbar!
|
||||
|
||||
@IBAction func textDismissButton(_ sender: Any) {
|
||||
view.endEditing(true)
|
||||
}
|
||||
|
||||
func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||
textField.inputAccessoryView = textToolbar
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
courses = self.df.courses
|
||||
@@ -45,6 +55,10 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource,
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.txtName.delegate = self
|
||||
self.txtClasses.delegate = self
|
||||
self.txtCourses.delegate = self
|
||||
|
||||
self.txtName.text = prefs.string(forKey: "username")
|
||||
self.txtClasses.text = prefs.string(forKey: "classes")
|
||||
self.txtCourses.text = prefs.string(forKey: "courses")
|
||||
|
||||
Reference in New Issue
Block a user