Notification+Extension.swift 748 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // Notification+Extension.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2018/4/18.
  6. // Copyright © 2018年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. enum OONotification:String {
  10. //登录相关
  11. case login
  12. case logout
  13. case bindCompleted
  14. // 考勤管理相关
  15. case location
  16. case newWorkPlace
  17. case staticsTotal
  18. var stringValue:String {
  19. return "OOK" + rawValue
  20. }
  21. var notificationName:Notification.Name {
  22. return Notification.Name(stringValue)
  23. }
  24. }
  25. extension NotificationCenter {
  26. static func post(customeNotification name: OONotification, object: Any? = nil) {
  27. NotificationCenter.default.post(name: name.notificationName, object: object)
  28. }
  29. }