OOUISwitch.swift 725 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // OOUISwitch.swift
  3. // o2app
  4. //
  5. // Created by 刘振兴 on 2017/10/16.
  6. // Copyright © 2017年 zone. All rights reserved.
  7. //
  8. import UIKit
  9. class OOUISwitch: UISwitch {
  10. override func awakeFromNib() {
  11. }
  12. override init(frame: CGRect) {
  13. super.init(frame: frame)
  14. commonInit()
  15. }
  16. required init?(coder aDecoder: NSCoder) {
  17. super.init(coder: aDecoder)
  18. commonInit()
  19. }
  20. func commonInit(){
  21. self.onImage = #imageLiteral(resourceName: "pic_anniu_2")
  22. self.offImage = #imageLiteral(resourceName: "pic_anniu_1")
  23. }
  24. override func prepareForInterfaceBuilder() {
  25. awakeFromNib()
  26. }
  27. }