Notification+Extension.swift 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. //重载门户webview
  19. case reloadPortal
  20. //websocket使用
  21. case websocket
  22. //日程管理Main中使用
  23. case calendarIds
  24. var stringValue:String {
  25. return "OOK" + rawValue
  26. }
  27. var notificationName:Notification.Name {
  28. return Notification.Name(stringValue)
  29. }
  30. }
  31. extension NotificationCenter {
  32. static func post(customeNotification name: OONotification, object: Any? = nil) {
  33. NotificationCenter.default.post(name: name.notificationName, object: object)
  34. }
  35. }