Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. func pickerView(pickerView: UIPickerView!, didSelectRow row: Int, inComponent: Int) {
  2. colourSelected = row
  3. NSUserDefaults.standardUserDefaults().setInteger(colourSelected, forKey: "userSelectedColour")
  4.  
  5. if colourSelected == 0 {
  6. self.navigationController.navigationBar.barTintColor = UIColor.newBlueColor()
  7. self.tabBarController.tabBar.selectedImageTintColor = UIColor.newBlueColor()
  8. UINavigationBar.appearance().barTintColor = UIColor.newBlueColor()
  9. UISegmentedControl.appearance().tintColor = UIColor.newBlueColor()
  10. changeButton.layer.backgroundColor = (UIColor.newBlueColor()).CGColor
  11. } else if colourSelected == 1 {
  12. self.navigationController.navigationBar.barTintColor = UIColor.newGreenColor()
  13. self.tabBarController.tabBar.selectedImageTintColor = UIColor.newGreenColor()
  14. UINavigationBar.appearance().barTintColor = UIColor.newGreenColor()
  15. UISegmentedControl.appearance().tintColor = UIColor.newGreenColor()
  16. changeButton.layer.backgroundColor = (UIColor.newGreenColor()).CGColor
  17. } else if colourSelected == 2 {
  18. self.navigationController.navigationBar.barTintColor = UIColor.newPinkColor()
  19. self.tabBarController.tabBar.selectedImageTintColor = UIColor.newPinkColor()
  20. UINavigationBar.appearance().barTintColor = UIColor.newPinkColor()
  21. UISegmentedControl.appearance().tintColor = UIColor.newPinkColor()
  22. changeButton.layer.backgroundColor = (UIColor.newPinkColor()).CGColor
  23. } else if colourSelected == 3 {
  24. self.navigationController.navigationBar.barTintColor = UIColor.newPurpleColor()
  25. self.tabBarController.tabBar.selectedImageTintColor = UIColor.newPurpleColor()
  26. UINavigationBar.appearance().barTintColor = UIColor.newPurpleColor()
  27. UISegmentedControl.appearance().tintColor = UIColor.newPurpleColor()
  28. changeButton.layer.backgroundColor = (UIColor.newPurpleColor()).CGColor
  29. } else if colourSelected == 4 {
  30. self.navigationController.navigationBar.barTintColor = UIColor.newRedColor()
  31. self.tabBarController.tabBar.selectedImageTintColor = UIColor.newRedColor()
  32. UINavigationBar.appearance().barTintColor = UIColor.newRedColor()
  33. UISegmentedControl.appearance().tintColor = UIColor.newRedColor()
  34. changeButton.layer.backgroundColor = (UIColor.newRedColor()).CGColor
  35. } else if colourSelected == 5 {
  36. self.navigationController.navigationBar.barTintColor = UIColor.newTurquoiseColor()
  37. self.tabBarController.tabBar.selectedImageTintColor = UIColor.newTurquoiseColor()
  38. UINavigationBar.appearance().barTintColor = UIColor.newTurquoiseColor()
  39. UISegmentedControl.appearance().tintColor = UIColor.newTurquoiseColor()
  40. changeButton.layer.backgroundColor = (UIColor.newTurquoiseColor()).CGColor
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement