Global.swift 860 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // Global.swift
  3. // SocketChat
  4. //
  5. // Created by Justine on 16/6/16.
  6. // Copyright © 2016年 AppCoda. All rights reserved.
  7. //
  8. import Foundation
  9. /**
  10. 检测用户是否已登陆
  11. - returns: 用户已登陆 返回True 反之false
  12. */
  13. func isLogin()->Bool{
  14. let ret = ManagerUserDefault().SelectUserDefault("isLogin") as! Int
  15. if ret == 0{ return false}
  16. else{return true}
  17. }
  18. /**
  19. 注销登录
  20. */
  21. func logout(){
  22. print("logout 被调用")
  23. //退出返回到登录界面 需要释放的资源
  24. //1全局变量TCPClient,服务器各项IP
  25. //
  26. }
  27. /**
  28. 更新版本
  29. */
  30. func updateVersion(){
  31. //从指定网址读取json 比对版本号
  32. }
  33. /**
  34. * 通知中心相关
  35. * icon角标
  36. * 网络连接状态
  37. * 消息接收(不含通知)
  38. * 消息发送
  39. */
  40. func regNSNotification(){
  41. }