ios 实现微信的非最近会话聊天界面的返回按钮
2017-04-26 09:38
267 查看
改变navigation.viewcontrollers的栈,然后使用block push 到聊天界面
代码如下:
-(void)chageNavigationStack{
NSMutableArray *
newStackVC = [[NSMutableArrayalloc]init];
[self.navigationController.viewControllersenumerateObjectsUsingBlock:^(__kindofUIViewController
* _Nonnull obj,NSUInteger idx,BOOL *_Nonnull stop) {
UIViewController*VC = (UIViewController*)obj;
if ([VCisKindOfClass:[MTTRootViewControllerclass]])
{
MTTRootViewController*rootVC = (MTTRootViewController*)VC;
rootVC.selectedIndex =0;
[newStackVCinsertObject:VCatIndex:0];
[self.navigationControllersetViewControllers:newStackVCanimated:NO];
self.changeNavStacksVC();
*stop =YES;
}
}];
}
代码如下:
-(void)chageNavigationStack{
NSMutableArray *
newStackVC = [[NSMutableArrayalloc]init];
[self.navigationController.viewControllersenumerateObjectsUsingBlock:^(__kindofUIViewController
* _Nonnull obj,NSUInteger idx,BOOL *_Nonnull stop) {
UIViewController*VC = (UIViewController*)obj;
if ([VCisKindOfClass:[MTTRootViewControllerclass]])
{
MTTRootViewController*rootVC = (MTTRootViewController*)VC;
rootVC.selectedIndex =0;
[newStackVCinsertObject:VCatIndex:0];
[self.navigationControllersetViewControllers:newStackVCanimated:NO];
self.changeNavStacksVC();
*stop =YES;
}
}];
}
相关文章推荐
- iOS微信QQ聊天界面的UI框架以及Socket简单实现群聊功能
- iOS 类似微信,QQ聊天界面的气泡聊天简单实现Demo
- 微信页面触发返回按钮回到聊天界面
- 微信公众号开发 实现点击返回按钮就返回到聊天界面
- Lance老师UI系列教程第六课->微信聊天气泡界面的实现
- ios开发:怎么实现点击一个按钮,跳转到一个新的界面
- ios开发:怎么实现点击一个按钮,跳转到一个新的界面,并回退到上一界面
- IOS高访微信聊天对话界面(sizeWithFont:constrainedToSize和stretchableImageWithLeftCapWidth的使用)
- Lance老师UI系列教程第六课->微信聊天气泡界面的实现
- IOS高访微信聊天对话界面(sizeWithFont:constrainedToSize和stretchableImageWithLeftCapWidth的使用)
- iOS开发-仿微信图片分享界面实现
- iOS自定义相机界面,实现微信小视频UI效果
- IOS高访微信聊天对话界面(sizeWithFont:constrainedToSize和stretchableImageWithLeftCapWidth的使用)
- (ios实战) UINavigationBar 返回按钮 文本自定义实现
- IOS开发学习笔记043-QQ聊天界面实现
- 模仿微信语音聊天功能(1)项目介绍及自定义按钮实现
- Lance老师UI系列教程第六课->微信聊天气泡界面的实现
- Lance老师UI系列教程第六课->微信聊天气泡界面的实现
- Android开发学习之仿微信聊天界面的实现
- iOS_29仿微信聊天界面