RegisterLoginManager.swift 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // RegisterLoginManager.swift
  3. // RainbowPlanet
  4. //
  5. // Created by 南鑫林 on 2019/8/1.
  6. // Copyright © 2019 RainbowPlanet. All rights reserved.
  7. //
  8. import UIKit
  9. class RegisterLoginManager: NSObject {
  10. class func registerLoginSuccessApi(vc:UIViewController?) {
  11. // 设置友盟别名
  12. UMManager.shared.addAlias()
  13. weak var vc = vc
  14. if UserModel.shared().getModel()?.isFollowSuggestTopic == 0 || UserModel.shared().getModel()?.isFollowSuggestTopic == nil { //设置性别
  15. vc?.navigationController?.pushViewController(GenderSelectionViewController(), animated: true)
  16. }else {// 设置首页
  17. baseTabbarViewController?.setBadge()
  18. if vc?.presentingViewController != nil {
  19. if vc?.navigationController?.presentationController != nil {
  20. vc?.navigationController?.dismiss(animated: false, completion: {
  21. NotificationCenter.default.post(name: NSNotification.Name("login"), object: nil)
  22. LoginNowView.removeLoginNowView()
  23. kAppDelegate.setData()
  24. })
  25. }else {
  26. vc?.dismiss(animated: false, completion: {
  27. NotificationCenter.default.post(name: NSNotification.Name("login"), object: nil)
  28. LoginNowView.removeLoginNowView()
  29. kAppDelegate.setData()
  30. })
  31. }
  32. } else {
  33. vc?.navigationController?.popToRootViewController(animated: false)
  34. NotificationCenter.default.post(name: NSNotification.Name("login"), object: nil)
  35. LoginNowView.removeLoginNowView()
  36. kAppDelegate.setData()
  37. }
  38. baseTabbarViewController?.selectedIndex = 0
  39. }
  40. }
  41. }