-
Using CocoaPods:
pod 'Moran'
import Moran
var transition: Moran?
//when you presenting another view controller set delegate and presentation style
let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
if let detailViewController = storyboard.instantiateViewController(withIdentifier: "DetailViewController") as? DetailViewController {
detailViewController.modalPresentationStyle = .custom
detailViewController.transitioningDelegate = self.transition
present(detailViewController, animated: true)
}
//add element where animation will started
self.transition = Moran(animatedView: button, transitionDuration: 0.5)
You can change transitionDuration as you wish. Default value is 0.3 second.
Moran(animatedView: someViewToStart, transitionDuration: 0.1)
Artem Lebedko, [email protected]
Thanks to JTMaterialTransition! I referred a lot to this project.
Moran is available under the MIT license. See the LICENSE file for more info.