@@ -42,14 +42,14 @@ extension UIViewController {
4242 registerOptions ( options)
4343 let targetParentVC = parentTargetViewController ( )
4444
45- targetParentVC. addChildViewController ( vc)
45+ targetParentVC. addChild ( vc)
4646 vc. beginAppearanceTransition ( true , animated: true )
4747
4848 objc_setAssociatedObject ( targetParentVC, & semiModalViewController, vc, . OBJC_ASSOCIATION_RETAIN_NONATOMIC)
4949 objc_setAssociatedObject ( targetParentVC, & semiModalDismissBlock, ClosureWrapper ( closure: dismissBlock) , . OBJC_ASSOCIATION_COPY_NONATOMIC)
5050
5151 presentSemiView ( vc. view, options: options) {
52- vc. didMove ( toParentViewController : targetParentVC)
52+ vc. didMove ( toParent : targetParentVC)
5353 vc. endAppearanceTransition ( )
5454
5555 completion ? ( )
@@ -69,7 +69,7 @@ extension UIViewController {
6969
7070 NotificationCenter . default. addObserver ( targetParentVC,
7171 selector: #selector( interfaceOrientationDidChange ( _: ) ) ,
72- name: . UIDeviceOrientationDidChange ,
72+ name: UIDevice . orientationDidChangeNotification ,
7373 object: nil )
7474
7575 let semiViewHeight = view. frame. size. height
@@ -192,7 +192,7 @@ extension UIViewController {
192192 let vc = objc_getAssociatedObject ( targetVC, & semiModalViewController) as? UIViewController
193193 let dismissBlock = ( objc_getAssociatedObject ( targetVC, & semiModalDismissBlock) as? ClosureWrapper ) ? . closure
194194
195- vc? . willMove ( toParentViewController : nil )
195+ vc? . willMove ( toParent : nil )
196196 vc? . beginAppearanceTransition ( false , animated: true )
197197
198198 UIView . animate ( withDuration: duration, animations: {
@@ -206,15 +206,15 @@ extension UIViewController {
206206 overlay. removeFromSuperview ( )
207207 modal. removeFromSuperview ( )
208208
209- vc? . removeFromParentViewController ( )
209+ vc? . removeFromParent ( )
210210 vc? . endAppearanceTransition ( )
211211
212212 dismissBlock ? ( )
213213
214214 objc_setAssociatedObject ( targetVC, & semiModalDismissBlock, nil , . OBJC_ASSOCIATION_COPY_NONATOMIC)
215215 objc_setAssociatedObject ( targetVC, & semiModalViewController, nil , . OBJC_ASSOCIATION_RETAIN_NONATOMIC)
216216
217- NotificationCenter . default. removeObserver ( targetVC, name: . UIDeviceOrientationDidChange , object: nil )
217+ NotificationCenter . default. removeObserver ( targetVC, name: UIDevice . orientationDidChangeNotification , object: nil )
218218 } )
219219
220220 if let screenshot = overlay. subviews. first {
@@ -255,19 +255,19 @@ extension UIViewController {
255255
256256 let duration = optionForKey ( . animationDuration) as! Double
257257 animation. duration = duration / 2
258- animation. fillMode = kCAFillModeForwards
258+ animation. fillMode = CAMediaTimingFillMode . forwards
259259 animation. isRemovedOnCompletion = false
260- animation. timingFunction = CAMediaTimingFunction ( name: kCAMediaTimingFunctionEaseOut )
260+ animation. timingFunction = CAMediaTimingFunction ( name: CAMediaTimingFunctionName . easeOut )
261261
262262 let animation2 = CABasicAnimation ( keyPath: " transform " )
263263 animation2. toValue = NSValue ( caTransform3D: forward ? id2 : CATransform3DIdentity)
264264 animation2. beginTime = animation. duration
265265 animation2. duration = animation. duration
266- animation2. fillMode = kCAFillModeForwards
266+ animation2. fillMode = CAMediaTimingFillMode . forwards
267267 animation2. isRemovedOnCompletion = false
268268
269269 let group = CAAnimationGroup ( )
270- group. fillMode = kCAFillModeForwards
270+ group. fillMode = CAMediaTimingFillMode . forwards
271271 group. isRemovedOnCompletion = false
272272 group. duration = animation. duration * 2
273273 group. animations = [ animation, animation2]
0 commit comments