MCDatePikerStyleDelegateImp.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // MCDatePikerStyle.swift
  3. // HCQuanfangtong
  4. //
  5. // Created by Apple on 2022/5/7.
  6. // Copyright © 2022 Jyp. All rights reserved.
  7. //
  8. import Foundation
  9. extension MCDatePikerView : MCDatePikerStyleDelegate{
  10. func delegateForPikerBackgroundColor() -> UIColor{
  11. UIColor.white
  12. }
  13. func delegateForPikerHeight() -> CGFloat {
  14. 222
  15. }
  16. func delegateForPikerRowHeight() -> CGFloat {
  17. 44
  18. }
  19. func delegateForPikerTitleColor() -> UIColor {
  20. kThemeOfTextBlackColor
  21. }
  22. func delegateForPikerTitleFont() -> UIFont {
  23. UIFont.pingFangSC(withWeight: .semibold, size: 16)
  24. }
  25. func delegateForPikerTitleDisableColor() -> UIColor{
  26. kThemeOfTextDisabledColor
  27. }
  28. func delegateForPikerTitleDisableFont() -> UIFont{
  29. UIFont.pingFangSC(withWeight: .semibold, size: 16)
  30. }
  31. func delegateForPikerContentWidth() -> CGFloat{
  32. kSCREEN_WIDTH - 40
  33. }
  34. func delegateForToolBarHeight() -> CGFloat {
  35. 38
  36. }
  37. func delegateForCancelTitle() -> String {
  38. "取消"
  39. }
  40. func delegateForCancelTitleColor() -> UIColor {
  41. kThemeOfTextBlackColor
  42. }
  43. func delegateForCancelTitleFont() -> UIFont {
  44. UIFont.systemFont(ofSize: 16)
  45. }
  46. func delegateForOKTitle() -> String {
  47. "完成"
  48. }
  49. func delegateForOKTitleColor() -> UIColor {
  50. kThemeColor
  51. }
  52. func delegateForOKTitleFont() -> UIFont {
  53. UIFont.pingFangSC(withWeight: .regular, size: 16)
  54. }
  55. func delegateForOKBackgroundColor() -> UIColor {
  56. kThemeOfBackgroundColor
  57. }
  58. func delegateForCancelBackgroundColor() -> UIColor {
  59. kThemeOfBackgroundColor
  60. }
  61. func delegateForToolBarBackgroundColor() -> UIColor {
  62. kThemeOfBackgroundColor
  63. }
  64. func delegateForToolBarItemWidth() -> CGFloat {
  65. 64
  66. }
  67. func delegateForToolBarItemMarginLeftSpace() -> CGFloat {
  68. 0
  69. }
  70. func delegateForToolBarItemMarginTopSpace() -> CGFloat {
  71. 0
  72. }
  73. func delegateForPikerViewBottomSpace() -> CGFloat{
  74. if #available(iOS 11.0, *) {
  75. guard let dis = UIApplication.shared.delegate?.window??.safeAreaInsets.bottom, dis > 0 else{
  76. return 0
  77. }
  78. return 20
  79. }
  80. return 0
  81. }
  82. }