Commit 70384dffcbfd1ace3251898161066be7a2e718da

Authored by iOS-Xiaowen
1 parent bed727f0

no message

CNLiveBLoginModule/Classes/Controller/CNLiveLoginController.m
... ... @@ -50,15 +50,20 @@
50 50 // Do any additional setup after loading the view.
51 51 self.automaticallyAdjustsScrollViewInsets = NO;
52 52 self.view.backgroundColor = [UIColor whiteColor];
  53 + // 添加检测app进入后台的观察者
  54 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationEnterBackground) name: UIApplicationDidEnterBackgroundNotification object:nil];
53 55 [self createUI];
54 56 }
55 57  
56   -- (void)viewDidDisappear:(BOOL)animated {
57   - [super viewDidDisappear:animated];
  58 +- (void)applicationEnterBackground{
58 59 [QMUITips hideAllToastInView:[UIApplication sharedApplication].keyWindow animated:YES];
59 60 [QMUITips hideAllToastInView:self.view animated:YES];
60 61 }
61 62  
  63 +- (void)dealloc {
  64 + [[NSNotificationCenter defaultCenter] removeObserver:self];
  65 +}
  66 +
62 67 - (void)createUI{
63 68  
64 69 [self.view addSubview:self.close];
... ...