Skip to content

rt_navigationController removeViewController 方法请教 #315

@Lee0820

Description

@Lee0820

请教下,我现在的项目结构是 tabbar 套nav,在项目中使用 [self.rt_navigationController removeViewController:self]的时候,我看库中的原方法是

- (void)removeViewController:(UIViewController *)controller animated:(BOOL)flag
{
    NSMutableArray<__kindof UIViewController *> *controllers = [self.viewControllers mutableCopy];
    __block UIViewController *controllerToRemove = nil;
    [controllers enumerateObjectsUsingBlock:^(__kindof UIViewController * obj, NSUInteger idx, BOOL * stop) {
        if (RTSafeUnwrapViewController(obj) == controller) {
            controllerToRemove = obj;
            *stop = YES;
        }
    }];
    if (controllerToRemove) {
        [controllers removeObject:controllerToRemove];
        [super setViewControllers:[NSArray arrayWithArray:controllers] animated:flag];
    }
}

这里的 [super setViewControllers:[NSArray arrayWithArray:controllers] animated:flag]; 未对 UIViewController 的 hidesBottomBarWhenPushed 作处理,就是出现 push 或者back回去的 UIViewController tabbar 显隐出现问题,目前并没有暴露相关的API可以处理?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions