Comments (2)
I write a categary for FlipBoardNavigationController .
So it has two new function
- -(void)popToViewController:(UIViewController*)toViewController;
you can use this pop to any controller in FlipBoardNavigationController.viewcontrollers
2-(void)popToRootViewController;
you can easy pop to the root viewcontroller
***************FlipBoardNavigationController.h ***
// FlipBoardNavigationController+extention.h
//
// Created by CHEN on 14-3-19.
//
#import "FlipBoardNavigationController.h"
@interface FlipBoardNavigationController (extention)
-(void)popToViewController:(UIViewController*)toViewController;
-(void)popToRootViewController;
***************FlipBoardNavigationController.h end ***
***************FlipBoardNavigationController.m ***
//
// FlipBoardNavigationController+extention.m
//
// Created by CHEN on 14-3-19.
//
#import "FlipBoardNavigationController+extention.h"
#import <FlipBoardNavigationController.h>
@implementation FlipBoardNavigationController (extention)
-(void)popToViewController:(UIViewController*)toViewController{
NSMutableArray *controllers = self.viewControllers;
NSInteger index = [controllers indexOfObject:toViewController];
UIViewController *needRemoveViewController;
for (int i = controllers.count - 2; i >index; i--) {
needRemoveViewController = [controllers objectAtIndex:i];
[needRemoveViewController.view setAlpha:0];
[needRemoveViewController removeFromParentViewController];
[controllers removeObject:needRemoveViewController];
}
[self popViewController];
}
-(void)popToRootViewController{
UIViewController *rootController = [self.viewControllers objectAtIndex:0];
[self popToViewController:rootController];
}
************_FlipBoardNavigationController.m end_
from flipboardnavigationcontroller.
非常感谢啊
------------------ 原始邮件 ------------------
发件人: "Jun.Chen";[email protected];
发送时间: 2014年4月2日(星期三) 上午10:21
收件人: "michaelhenry/FlipBoardNavigationController"[email protected];
主题: Re: [FlipBoardNavigationController] how could i pop to rootcontroller? (#16)
I write a categary for FlipBoardNavigationController .
So it has two new function
- -(void)popToViewController:(UIViewController*)toViewController;
2-(void)popToRootViewController;
***************FlipBoardNavigationController.h ***
// FlipBoardNavigationController+extention.h
//
// Created by CHEN on 14-3-19.
//
#import "FlipBoardNavigationController.h"
@interface FlipBoardNavigationController (extention)
-(void)popToViewController:(UIViewController*)toViewController;
-(void)popToRootViewController;
***************FlipBoardNavigationController.h end ***
***************FlipBoardNavigationController.m ***
//
// FlipBoardNavigationController+extention.m
//
// Created by CHEN on 14-3-19.
//
#import "FlipBoardNavigationController+extention.h"
#import
@implementation FlipBoardNavigationController (extention)
-(void)popToViewController:(UIViewController*)toViewController{
NSMutableArray *controllers = self.viewControllers; NSInteger index = [controllers indexOfObject:toViewController]; UIViewController *needRemoveViewController; for (int i = controllers.count - 2; i >index; i--) { needRemoveViewController = [controllers objectAtIndex:i]; [needRemoveViewController.view setAlpha:0]; [needRemoveViewController removeFromParentViewController]; [controllers removeObject:needRemoveViewController]; } [self popViewController];
}
-(void)popToRootViewController{
UIViewController *rootController = [self.viewControllers objectAtIndex:0];
[self popToViewController:rootController];
}
************_FlipBoardNavigationController.m end_
—
Reply to this email directly or view it on GitHub.
from flipboardnavigationcontroller.
Related Issues (12)
- how can i use it in UINavigationController.
- The better method to get instance of FlipBoardNavigationController from other UIViewController
- Hides Navigation bar.
- How disable scroll (tableview,scrollview,webview and etc) if used gesture animation?
- life cycle problems
- Remove arbitrary view controller from the stack HOT 2
- Not enough comments in the flipboardnavigationcontroller.m
- viewWillAppear / viewDidAppear HOT 1
- leftPan -> Push ViewController
- No explicit license. HOT 1
- how to use in navigationcontroller, and storyboard's segue? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipboardnavigationcontroller.