美文网首页
iOS中 使用通知和NSOperationQueue跳转未创建的

iOS中 使用通知和NSOperationQueue跳转未创建的

作者: 我太难了_9527 | 来源:发表于2018-09-25 16:03 被阅读0次

最近在开发中遇到界面中的跳转, 通常的跳转 不必多说, 这里说的是我 使用通知,跳转实现 tabbar 的跳转 之后 在做对应的操作, 可能这个只适用于 我这种情况

添加通知

 [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [self.superVC selectTabbarIndex:2];
        [[NSOperationQueue mainQueue] addOperationWithBlock:^{
            
            [self.superVC.navigationController popViewControllerAnimated:NO];
            [YFNotificationCenter postNotificationName:@"JumpSpecialLineKeys" object:nil];
        }];
    }];

接手通知

 @weakify(self)
    [[YFNotificationCenter rac_addObserverForName:@"JumpSpecialLineKeys" object:nil] subscribeNext:^(id x) {
        @strongify(self)
        [self.titleScroll setSelectedIndex:1];
        [self titleClick:1];
    }];

相关文章

网友评论

      本文标题:iOS中 使用通知和NSOperationQueue跳转未创建的

      本文链接:https://www.haomeiwen.com/subject/ivdloftx.html