DesignableViews.swift 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // DesignableViews.swift
  3. // SolarLamp
  4. //
  5. // Created by liaolj on 16/9/23.
  6. // Copyright © 2016年 SolarLamp. All rights reserved.
  7. //
  8. import Foundation
  9. import UIKit
  10. class UISwitchCustom: UISwitch {
  11. @IBInspectable var OffTint: UIColor? {
  12. didSet {
  13. self.tintColor = OffTint
  14. self.layer.cornerRadius = 16
  15. self.backgroundColor = OffTint
  16. }
  17. }
  18. }
  19. @IBDesignable
  20. class KKWLabel: UILabel {
  21. // @IBInspectable var cornerRadius: CGFloat {
  22. // get {
  23. // return layer.cornerRadius
  24. // }
  25. // set {
  26. // layer.cornerRadius = newValue
  27. // layer.masksToBounds = newValue > 0
  28. // }
  29. // }
  30. //
  31. // @IBInspectable var borderWidth: CGFloat = 0 {
  32. // didSet {
  33. // layer.borderWidth = borderWidth
  34. // }
  35. // }
  36. // @IBInspectable var borderColor: UIColor? {
  37. // didSet {
  38. // layer.borderColor = borderColor?.cgColor
  39. // }
  40. // }
  41. }
  42. @IBDesignable
  43. open class KKWButton: UIButton {
  44. // @IBInspectable open var cornerRadius: CGFloat {
  45. // get {
  46. // return layer.cornerRadius
  47. // }
  48. // set {
  49. // layer.cornerRadius = newValue
  50. // layer.masksToBounds = newValue > 0
  51. // }
  52. // }
  53. //
  54. // @IBInspectable open var borderWidth: CGFloat = 0 {
  55. // didSet {
  56. // layer.borderWidth = borderWidth
  57. // }
  58. // }
  59. // @IBInspectable open var borderColor: UIColor? {
  60. // didSet {
  61. // layer.borderColor = borderColor?.cgColor
  62. // }
  63. // }
  64. }
  65. @IBDesignable
  66. open class KKWView: UIView {
  67. // @IBInspectable open var cornerRadius: CGFloat {
  68. // get {
  69. // return layer.cornerRadius
  70. // }
  71. // set {
  72. // layer.cornerRadius = newValue
  73. // layer.masksToBounds = newValue > 0
  74. // }
  75. // }
  76. //
  77. // @IBInspectable open var borderWidth: CGFloat = 0 {
  78. // didSet {
  79. // layer.borderWidth = borderWidth
  80. // }
  81. // }
  82. // @IBInspectable open var borderColor: UIColor? {
  83. // didSet {
  84. // layer.borderColor = borderColor?.cgColor
  85. // }
  86. // }
  87. }