diff --git a/README.md b/README.md index 2c9440e..c30a43e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ UIImageViewModeScaleAspect (2.0) ================================ -
Create animation of a UIImageView between two contentMode ( UIViewContentModeScaleAspectFill / UIViewContentModeScaleAspectFit )
+Create animation of a UIImageView between two contentMode ( `UIViewContentModeScaleAspectFill` / `UIViewContentModeScaleAspectFit` ) My WebSite - My Twitter Compatible Swift 3.0 @@ -13,7 +13,7 @@ Compatible Swift 3.0 Screenshot & Demo Video ----------------------- -To see a demo video, click here
+To see a demo video, click here
@@ -22,14 +22,15 @@ Screenshot & Demo Video
How To Get Started
------------------
-Use Pod (or download and add "UIImageViewModeScaleAspect.swift" in your xcodeprojet.) :
+Use Pod (or download and add "UIImageViewModeScaleAspect.swift" in your xcodeproject.): -``` objective-c +```objective-c pod 'UIImageViewModeScaleAspect' ``` -Init the UIImageViewModeScaleAspect. Important ! Do not forget to init the contentMode :
-``` swift +Init the UIImageViewModeScaleAspect. Important ! Do not forget to init the contentMode : + +```swift let myImage = UIImageViewModeScaleAspect(frame: CGRect(x: 0, y: 100, width: 200, height: 100)) myImage.contentMode = .scaleAspectFill // Add the first contentMode myImage.image = UIImage(named: "Octocat") @@ -39,21 +40,24 @@ view.addSubview(myImage) Automatic animation ------------------- -For convert UIViewContentModeScaleAspectFill to UIViewContentModeScaleAspectFit :
-``` swift +For convert `UIViewContentModeScaleAspectFill` to `UIViewContentModeScaleAspectFit`: + +```swift myImage.animate( .fit, frame: CGRect(x: 0, y: 0, width: 200, height: 200), duration: 0.4) ``` -For convert UIViewContentModeScaleAspectFit to UIViewContentModeScaleAspectFill :
-``` swift +For convert `UIViewContentModeScaleAspectFit` to `UIViewContentModeScaleAspectFill`: + +```swift myImage.animate( .fill, frame: CGRect(x: 0, y: 0, width: 200, height: 200), duration: 0.4) ``` Manual animation ---------------- -For convert UIViewContentModeScaleAspectFill to UIViewContentModeScaleAspectFit :
-``` swift +For convert `UIViewContentModeScaleAspectFill` to `UIViewContentModeScaleAspectFit`: + +```swift myImage.initialeState(.fit, newFrame: CGRect(x: 0, y: 100, width: 200, height: 100)) UIView.animate(withDuration: 0,4, delay: 0, options: .allowAnimatedContent, animations: { @@ -66,8 +70,9 @@ UIView.animate(withDuration: 0,4, delay: 0, options: .allowAnimatedContent, anim }) ``` -For convert UIViewContentModeScaleAspectFit to UIViewContentModeScaleAspectFill :
-``` swift +For convert `UIViewContentModeScaleAspectFit` to `UIViewContentModeScaleAspectFill`: + +```swift myImage.initialeState(.fill, newFrame: CGRect(x: 0, y: 100, width: 200, height: 100)) UIView.animate(withDuration: 0,4, delay: 0, options: .allowAnimatedContent, animations: {