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

2018-09-25  本文已影响0人  我太难了_9527

最近在开发中遇到界面中的跳转, 通常的跳转 不必多说, 这里说的是我 使用通知,跳转实现 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];
    }];
上一篇 下一篇

猜你喜欢

热点阅读