Skip to content

Repository files navigation

CustomModalTransition

This is simple framework for Swift or Objective-C to present your own controllers modally . You just need to put var into controller which you want to be presented modally, like this:

let modalTransitor = CustomModalTransition(option: .center, horizontalInsets: 20, hiewHeight: 262)

and set this var to transition delegate:

let vc = SomeUIViewController.instantiateViewController(withIdentifier: "SomeID")
vc.modalPresentationStyle = .custom
vc.transitioningDelegate = vc.modalTransitor

There are two option available for presentation:

  • .center (for Objective-c: UICustomTransitionOptionCenter) - modal view controller will be shown in the centre of the screen
  • .bottom (for Objective-c: UICustomTransitionOptionBottom) - it will be shown in bottom of the screen.

The parameter horizontalInsets is responsible for insets from left and right, with bottom option it's also responsible for bottom inset.

About

Present your own controllers modally

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages