Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhurray/ioscustomtransitions
Custom animation transition manager and base VC for iOS apps.
https://github.com/jhurray/ioscustomtransitions
Last synced: 17 days ago
JSON representation
Custom animation transition manager and base VC for iOS apps.
- Host: GitHub
- URL: https://github.com/jhurray/ioscustomtransitions
- Owner: jhurray
- Created: 2014-09-16T02:39:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-10T22:46:33.000Z (about 10 years ago)
- Last Synced: 2023-08-09T08:44:07.462Z (over 1 year ago)
- Language: Objective-C
- Size: 148 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Custom animation transition manager and base VC for iOS apps.
##Use:
1. Clone repo
2. Add files to your XCode project (make sure you delete the README.md file)
3. Subclass whatever view controller you are making from JHBaseViewController
4. In viewDidLoad add the following lines of code with whatever transition type you want. This will determine the animations that will be used.```objective-c
// replace with another JHNavigationTransitionType for custom navigation transition
[[JHTransitionContextManager sharedInstance] setNavigationTransitionType:JHNavigationTransitionTypeDefault];
// replace with another JHModalTransitionType for custom modal transition
[[JHTransitionContextManager sharedInstance] setModalTransitionType:JHModalTransitionTypeDefault];
```
5. Push, Pop, Present and Dismiss like you normally would!##Custom Animations:
To create a custom modal or navigation animation subclass JHModalTransitionManager and JHNavigationTransitionManager respectively.
Then, override the following methods:
```objective-c
-(void)animatePresentTransitionFrom:(UIViewController *)fromVC to:(UIViewController *)toVC withTransitionContext:(id)transitionContext {
MustOverride();
}-(void) animateDismissTransitionFrom:(UIViewController *)fromVC to:(UIViewController *)toVC withTransitionContext:(id)transitionContext {
MustOverride();
}
```Also override:
```objective-c
-(NSTimeInterval)transitionDuration:(id)transitionContext {
if (self.transitionType == TransitionTypePresent) { // push and present
return 1.0;
} else { // dismissing and popping
return 0.4;
}
}
```
to set the animation duration.##Built-in Transitions
#####Navigation:
+ JHNavigationTransitionTypeZoom
+ JHNavigationTransitionTypeDropDown#####Modal:
+ JHModalTransitionTypeBounceUp
+ JHModalTransitionTypePullBack##Moving Forward:
1. Interactive transitions
2. More animations