ViewControllerSettings.swift (2100B)
1 // 2 // ViewControllerSettings.swift 3 // Teachers' Assistant 4 // 5 // Created by Benjamin Welner on 2/23/19. 6 // Copyright © 2019 FIGBERT Inc. All rights reserved. 7 // 8 9 import UIKit 10 11 class ViewControllerSettings: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate { 12 13 var signOutState: Bool = true 14 15 /* COLOR THEME PICKER VIEW START */ 16 //Connecting the picker view 17 @IBOutlet weak var colorTheme: UIPickerView! 18 //Declaring how many items in the color picker 19 func numberOfComponents(in pickerView: UIPickerView) -> Int { 20 return 1 21 } 22 //Assigning the colors to the empty slots 23 func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { 24 return ViewController.globalVariables.colorThemes[row] 25 } 26 func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 27 return ViewController.globalVariables.colorThemes.count 28 } 29 //What the selections do 30 func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 31 ViewController.globalVariables.activeColorTheme = ViewController.globalVariables.colorThemes[row] 32 } 33 34 /* COLOR THEME PICKER VIEW END */ 35 36 //Connecting settingsToHome segue to back button 37 @IBAction func settingsToHome(_ sender: Any) { 38 performSegue(withIdentifier: "settingsToHome", sender: self) 39 } 40 41 override func viewDidLoad() { 42 super.viewDidLoad() 43 // Do any additional setup after loading the view. 44 } 45 46 override func didReceiveMemoryWarning() { 47 super.didReceiveMemoryWarning() 48 // Dispose of any resources that can be recreated. 49 } 50 51 52 /* 53 // MARK: - Navigation 54 55 // In a storyboard-based application, you will often want to do a little preparation before navigation 56 override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 57 // Get the new view controller using segue.destinationViewController. 58 // Pass the selected object to the new view controller. 59 } 60 */ 61 62 }