iOS 关闭UITabBarController双击返回根控制器

来源:互联网 发布:linux 编辑定时任务 编辑:程序博客网 时间:2024/05/22 11:16

<UITabBarControllerDelegate>

//接受tabbar代理方法

self.delegate =self;

// 调用代理方法

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{

   UIViewController *vcSelected = tabBarController.selectedViewController;

    if ([vcSelectedisEqual:viewController]) {

        returnNO;

    }

    return YES;

}

0 0
原创粉丝点击