Skip to content

iOSGL/AnimatedTransitions

Repository files navigation

UBER imitate animated transitions

I made reference to a version of the Swift transition animation, made a OC version. Screenshot

Setup

Have your viewcontroller conform to UIViewControllerTransitioningDelegate. Set the transitionMode, the startingPoint, the bubbleColor and the duration.

 - (TransitionModel *)transitionModel {
    if (_transitionModel == nil) {
        _transitionModel = [[TransitionModel alloc]init];
    }
    return _transitionModel;
}
- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
    self.transitionModel.transitionMode = Present;
    self.transitionModel.startingPoint = self.modelBtn.center;
    self.transitionModel.bubbleColor = self.modelBtn.backgroundColor;
    self.transitionModel.duration = 0.5;
    return self.transitionModel;
}

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
    self.transitionModel.transitionMode = Dismiss;
    self.transitionModel.startingPoint = self.modelBtn.center;
    self.transitionModel.bubbleColor = self.modelBtn.backgroundColor;
    self.transitionModel.duration = 0.5;
    return self.transitionModel;
}

MIT License

The MIT License (MIT)

Copyright (c) 2016 GL

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.





About

UBER imitate animated transitions

Resources

License

Stars

Watchers

Forks

Packages

No packages published