AppDelegate+Appearance.swift 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // AppDelegate+Appearance.swift
  3. // SheeeeeeeeetExample
  4. //
  5. // Created by Daniel Saidi on 2018-10-08.
  6. // Copyright © 2018 Daniel Saidi. All rights reserved.
  7. //
  8. /*
  9. This extension isolates how the example app applies colors,
  10. fonts etc to the example action sheets.
  11. */
  12. import UIKit
  13. import Sheeeeeeeeet
  14. extension AppDelegate {
  15. func applyAppearance() {
  16. let blue = UIColor(hex: 0x0FA2F5)
  17. let green = UIColor(hex: 0x81c03f)
  18. let pink = UIColor(hex: 0xec5f72)
  19. let purple = UIColor(hex: 0xd9007b)
  20. let red = UIColor(hex: 0xff3333)
  21. let robotoBlack = "Roboto-Black"
  22. let robotoMedium = "Roboto-Medium"
  23. let robotoRegular = "Roboto-Regular"
  24. let appearance = ActionSheetAppearance.standard
  25. // appearance.popover.width = 500
  26. appearance.item.font = UIFont(name: robotoRegular, size: 17)
  27. appearance.item.textColor = .darkText
  28. appearance.item.tintColor = .darkGray
  29. appearance.item.subtitleFont = UIFont(name: robotoRegular, size: 14)
  30. appearance.item.subtitleTextColor = blue
  31. // appearance.separatorColor = .red
  32. // appearance.itemsSeparatorColor = .blue
  33. // appearance.buttonsSeparatorColor = .green
  34. appearance.title.hideSeparator()
  35. appearance.title.font = UIFont(name: robotoMedium, size: 15)
  36. appearance.sectionTitle.hideSeparator()
  37. appearance.sectionTitle.font = UIFont(name: robotoMedium, size: 13)
  38. appearance.sectionTitle.height = 20
  39. appearance.sectionMargin.height = 20
  40. appearance.selectItem.selectedIcon = UIImage(named: "ic_checkmark")
  41. appearance.selectItem.unselectedIcon = UIImage(named: "ic_empty")
  42. appearance.selectItem.selectedTintColor = blue
  43. appearance.selectItem.selectedTextColor = green
  44. appearance.selectItem.selectedIconTintColor = purple
  45. appearance.singleSelectItem.selectedTintColor = green
  46. appearance.singleSelectItem.selectedTextColor = purple
  47. appearance.singleSelectItem.selectedIconTintColor = blue
  48. appearance.multiSelectItem.selectedTintColor = purple
  49. appearance.multiSelectItem.selectedTextColor = blue
  50. appearance.multiSelectItem.selectedIconTintColor = green
  51. appearance.multiSelectToggleItem.hideSeparator()
  52. appearance.multiSelectToggleItem.font = UIFont(name: robotoMedium, size: 13)
  53. appearance.multiSelectToggleItem.selectAllTextColor = .lightGray
  54. appearance.multiSelectToggleItem.deselectAllTextColor = red
  55. appearance.linkItem.linkIcon = UIImage(named: "ic_arrow_right")
  56. appearance.okButton.textColor = .darkGray
  57. appearance.okButton.font = UIFont(name: robotoBlack, size: 17)
  58. appearance.dangerButton.textColor = pink
  59. appearance.dangerButton.font = UIFont(name: robotoMedium, size: 17)
  60. appearance.cancelButton.textColor = .lightGray
  61. appearance.cancelButton.font = UIFont(name: robotoMedium, size: 17)
  62. }
  63. }