Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func pickerView(pickerView: UIPickerView!, didSelectRow row: Int, inComponent: Int) {
- colourSelected = row
- NSUserDefaults.standardUserDefaults().setInteger(colourSelected, forKey: "userSelectedColour")
- if colourSelected == 0 {
- self.navigationController.navigationBar.barTintColor = UIColor.newBlueColor()
- self.tabBarController.tabBar.selectedImageTintColor = UIColor.newBlueColor()
- UINavigationBar.appearance().barTintColor = UIColor.newBlueColor()
- UISegmentedControl.appearance().tintColor = UIColor.newBlueColor()
- changeButton.layer.backgroundColor = (UIColor.newBlueColor()).CGColor
- } else if colourSelected == 1 {
- self.navigationController.navigationBar.barTintColor = UIColor.newGreenColor()
- self.tabBarController.tabBar.selectedImageTintColor = UIColor.newGreenColor()
- UINavigationBar.appearance().barTintColor = UIColor.newGreenColor()
- UISegmentedControl.appearance().tintColor = UIColor.newGreenColor()
- changeButton.layer.backgroundColor = (UIColor.newGreenColor()).CGColor
- } else if colourSelected == 2 {
- self.navigationController.navigationBar.barTintColor = UIColor.newPinkColor()
- self.tabBarController.tabBar.selectedImageTintColor = UIColor.newPinkColor()
- UINavigationBar.appearance().barTintColor = UIColor.newPinkColor()
- UISegmentedControl.appearance().tintColor = UIColor.newPinkColor()
- changeButton.layer.backgroundColor = (UIColor.newPinkColor()).CGColor
- } else if colourSelected == 3 {
- self.navigationController.navigationBar.barTintColor = UIColor.newPurpleColor()
- self.tabBarController.tabBar.selectedImageTintColor = UIColor.newPurpleColor()
- UINavigationBar.appearance().barTintColor = UIColor.newPurpleColor()
- UISegmentedControl.appearance().tintColor = UIColor.newPurpleColor()
- changeButton.layer.backgroundColor = (UIColor.newPurpleColor()).CGColor
- } else if colourSelected == 4 {
- self.navigationController.navigationBar.barTintColor = UIColor.newRedColor()
- self.tabBarController.tabBar.selectedImageTintColor = UIColor.newRedColor()
- UINavigationBar.appearance().barTintColor = UIColor.newRedColor()
- UISegmentedControl.appearance().tintColor = UIColor.newRedColor()
- changeButton.layer.backgroundColor = (UIColor.newRedColor()).CGColor
- } else if colourSelected == 5 {
- self.navigationController.navigationBar.barTintColor = UIColor.newTurquoiseColor()
- self.tabBarController.tabBar.selectedImageTintColor = UIColor.newTurquoiseColor()
- UINavigationBar.appearance().barTintColor = UIColor.newTurquoiseColor()
- UISegmentedControl.appearance().tintColor = UIColor.newTurquoiseColor()
- changeButton.layer.backgroundColor = (UIColor.newTurquoiseColor()).CGColor
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement