@@ -21,42 +21,42 @@ extension UIView {
2121 self . fadeOutNowWithCallback ( nil )
2222 }
2323
24- func fadeInNowWithCallback( completion: AnimationCompletionBlock ? ) {
25- UIView . animateWithDuration ( 0.5 , delay: 0 , options: . CurveEaseOut , animations: {
24+ func fadeInNowWithCallback( _ completion: AnimationCompletionBlock ? ) {
25+ UIView . animate ( withDuration : 0.5 , delay: 0 , options: . curveEaseOut , animations: {
2626 self . alpha = 1.0
2727 } , completion: completion)
2828 }
2929
30- func fadeOutNowWithCallback( completion: AnimationCompletionBlock ? ) {
31- UIView . animateWithDuration ( 0.5 , delay: 0 , options: . CurveEaseOut , animations: {
30+ func fadeOutNowWithCallback( _ completion: AnimationCompletionBlock ? ) {
31+ UIView . animate ( withDuration : 0.5 , delay: 0 , options: . curveEaseOut , animations: {
3232 self . alpha = 0.0
3333 } , completion: completion)
3434 }
3535
3636 func flash( ) {
37- UIView . animateWithDuration ( 0.1 , delay: 0 , options: . CurveEaseOut , animations: { ( ) -> Void in
37+ UIView . animate ( withDuration : 0.1 , delay: 0 , options: . curveEaseOut , animations: { ( ) -> Void in
3838 self . alpha = 1
3939 } ) { ( param) -> Void in
40- UIView . animateWithDuration ( 0.1 , delay: 0 , options: . CurveEaseOut , animations: {
40+ UIView . animate ( withDuration : 0.1 , delay: 0 , options: . curveEaseOut , animations: {
4141 self . alpha = 0
4242 } , completion: nil )
4343 }
4444 }
4545
4646 // MARK: Resizing animations
47- func resizeWithFactor( factor: CGFloat ) {
47+ func resizeWithFactor( _ factor: CGFloat ) {
4848 self . resizeWithFactor ( factor, completion: nil )
4949 }
5050
51- func resizeWithFactor( factor: CGFloat , completion: AnimationCompletionBlock ? ) {
51+ func resizeWithFactor( _ factor: CGFloat , completion: AnimationCompletionBlock ? ) {
5252 let currentFrame = self . frame
5353 let width = currentFrame. size. width * factor
5454 let height = currentFrame. size. height * factor
5555 let leftOffset = ( currentFrame. origin. x + ( currentFrame. size. width * ( 1.0 - factor) ) ) / 2
5656 let topOffset = ( currentFrame. origin. y + ( currentFrame. size. height * ( 1.0 - factor) ) ) / 2
57- let newFrame : CGRect = CGRectMake ( leftOffset, topOffset, width, height)
57+ let newFrame : CGRect = CGRect ( x : leftOffset, y : topOffset, width: width , height : height)
5858
59- UIView . animateWithDuration ( 0.4 , delay: 0 , options: . CurveEaseOut , animations: {
59+ UIView . animate ( withDuration : 0.4 , delay: 0 , options: . curveEaseOut , animations: {
6060 self . frame = newFrame
6161 } , completion: completion)
6262 }
@@ -66,11 +66,11 @@ extension UIView {
6666 self . slideUp ( nil )
6767 }
6868
69- func slideUp( completion: ( ( Bool ) -> Void ) ? ) {
70- let screenBound = UIScreen . mainScreen ( ) . bounds
69+ func slideUp( _ completion: ( ( Bool ) -> Void ) ? ) {
70+ let screenBound = UIScreen . main . bounds
7171 let currentFrame = self . frame
72- let newFrame : CGRect = CGRectMake ( currentFrame. origin. x, currentFrame. origin. y - screenBound. size. height, currentFrame. size. width, currentFrame. size. height)
73- UIView . animateWithDuration ( 0.3 , delay: 0 , options: . CurveEaseOut , animations: {
72+ let newFrame : CGRect = CGRect ( x : currentFrame. origin. x, y : currentFrame. origin. y - screenBound. size. height, width : currentFrame. size. width, height : currentFrame. size. height)
73+ UIView . animate ( withDuration : 0.3 , delay: 0 , options: . curveEaseOut , animations: {
7474 self . frame = newFrame
7575 } , completion: completion)
7676 }
@@ -79,11 +79,11 @@ extension UIView {
7979 self . slideDown ( nil )
8080 }
8181
82- func slideDown( completion: ( ( Bool ) -> Void ) ? ) {
83- let screenBound = UIScreen . mainScreen ( ) . bounds
82+ func slideDown( _ completion: ( ( Bool ) -> Void ) ? ) {
83+ let screenBound = UIScreen . main . bounds
8484 let currentFrame = self . frame
85- let newFrame : CGRect = CGRectMake ( currentFrame. origin. x, currentFrame. origin. y + screenBound. size. height, currentFrame. size. width, currentFrame. size. height)
86- UIView . animateWithDuration ( 0.3 , delay: 0 , options: . CurveEaseOut , animations: {
85+ let newFrame : CGRect = CGRect ( x : currentFrame. origin. x, y : currentFrame. origin. y + screenBound. size. height, width : currentFrame. size. width, height : currentFrame. size. height)
86+ UIView . animate ( withDuration : 0.3 , delay: 0 , options: . curveEaseOut , animations: {
8787 self . frame = newFrame
8888 } , completion: completion)
8989 }
0 commit comments