Use blur transiton effect in 2 steps.
First, subclass your dialog view controller. Second, chose tranistion style you want.
You can easily subclass TransitionViewController
to achieve blur background effect.
There have 2 kind of background effect. Blur and black with alpha.
enum TransitionStyle {
case black(CGFloat)
case blur(UIBlurEffectStyle)
}
Support 4 direction (top, bottom, left, right, none)
enum TransitionPosition {
case top, bottom, left, right, none
}
// 1. Subclass for your dialog view controller
class YourPopupViewController: TransitionViewController {
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
// 2. Change transition here!!
self.transition = TransitionAnimator(style: .blur(.light), presentFrom: .bottom, dismissTo: .bottom)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
- iOS 8.0 or later
TransitionViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'TransitionViewController'
Liyao Chen, gliyao@gmail.com
TransitionViewController is available under the MIT license. See the LICENSE file for more info.