Notification+Extension.swift 811 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. var stringValue:String {
  21. return "OOK" + rawValue
  22. }
  23. var notificationName:Notification.Name {
  24. return Notification.Name(stringValue)
  25. }
  26. }
  27. extension NotificationCenter {
  28. static func post(customeNotification name: OONotification, object: Any? = nil) {
  29. NotificationCenter.default.post(name: name.notificationName, object: object)
  30. }
  31. }