2

How can I present a view controller from top to down direction in Swift?

I have a view controller with a notification(bell) icon at the top. When I click this icon, I want to show a view controller that originates from top.

Thanks.

Kiran Thapa
  • 1,230
  • 2
  • 13
  • 28

3 Answers3

2

There is no default transition style that will give you this effect. But you can use custom animations applied on view controller to acheive this effect. These are some links you can follow.

http://www.raywenderlich.com/113845/ios-animation-tutorial-custom-view-controller-presentation-transitions

How do you present a UIViewController from the top of the screen instead of the bottom?

Community
  • 1
  • 1
Krishna Kumar
  • 1,652
  • 9
  • 17
1

There is an control available to presenting a uiviewcontroller as a popup with different type of animations.

MJPopupViewController try it may be it help you.

Mehul Sojitra
  • 1,181
  • 9
  • 15
1

There are two ways to do it:

  1. Making a custom transition as suggested above

  2. Add view controller as child view controller and animate it from top.

Prajeet Shrestha
  • 7,978
  • 3
  • 34
  • 63