您的位置:首页 > 产品设计 > UI/UE

如果想在UIView中直接进行跳转操作,你可以这么写

2018-02-06 00:00 411 查看
#import "QHChatRedBagView.h"
#import "QHRedPacketGetingViewController.h"

@interface QHChatRedBagView ()

@end

@implementation QHChatRedBagView

#pragma mark 点击红包领取
- (IBAction)clickRedBag:(id)sender {
QHRedPacketGetingViewController  *redViewCtrl = [[QHRedPacketGetingViewController alloc]initWithNibName:@"QHRedPacketGetingViewController" bundle:nil];
UIViewController *vc = [self obtainVisible];
[vc.navigationController pushViewController:redViewCtrl animated:YES];
}

- (UIViewController *)obtainVisible {
UITabBarController *tabCtrl = (UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController;
UINavigationController *navi = tabCtrl.selectedViewController;
UIViewController *vc = [navi visibleViewController];
return vc;

}

@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐