Skip to content

Commit

Permalink
Update to version 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lm2343635 committed Jan 16, 2017
1 parent 6283c17 commit 5fa123b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A simple UIImageView category with some extension functions.
- Set border radius for image view.
- Set shadow for image view.
- Rotate image view.
- Set image view to circle.

# Installation

Expand All @@ -16,7 +17,7 @@ Installing UIImageView+Extension by [CocoaPods](http://cocoapods.org/).
```ruby
pod 'UIImageView+Extension', '~> 0.2'
```
### Old-fashioned way
### Manual Way

- Add `UIImageView+Extension.h` and `UIImageView+Extension.m` to your project.
- `#import "UIImageView+Extension.h"` where you want to use the control.
Expand All @@ -33,14 +34,19 @@ pod 'UIImageView+Extension', '~> 0.2'
# API Document
### Corner Radius

Setting corner radius is supported in Interface Builder.

```objective-c
// Set corner radius.
_imageView.cornerRadius = 10;
```

The method `setImageCornerRadius:`(version 0.2.1 and before) cannot use in this version now.
The method `setImageCornerRadius:`(version 0.2.1 and before) is not recommended to use in this version now.

### Shadow

Setting shadow is supported in Interface Builder.

The method `setShadowWithColor:shadowXOffset:shadowYOffset:shadowRadius:`should be invoked before you invoke methods including `changeShadowColor:color`, `changeShadowXOffset:xOffset`, `changeShadowYOffset:yOffset` and `changeShadowRadius:radius`.

```objective-c
Expand Down Expand Up @@ -68,6 +74,17 @@ You can rotate a image view infinitely by the method `startRotate:withClockwise:
[_imageView stopRotate];
```

### Circle

Setting image view to circle is supported in Interface Builder.
**You must insure your image view is a square(width = height).** We recommend you add `Aspect Ratio` constraint for your image view.

```objective-c
_imageView.circle = YES;
```

- Tip: If you set corner radius and circle at same time, corner radius will be invalid.

# Demo App
A demo project contained in this repository shows how to use UIImageView+Extension from a storyboard.

Expand All @@ -76,6 +93,10 @@ A demo project contained in this repository shows how to use UIImageView+Extensi
Another demo app: I used this extension in my app Rate Assistant, you can download this app from App Store: https://itunes.apple.com/app/murate/id1139573801 to see this demo, it is an open source app, you can get the source code from https://github.com/MuShare/Rate-iOS

# Change log
* version 0.2.2
* Set image view to circle.
* Set corner radius by setter method directly.

* version 0.2.1
* Rotate image view infinitely.

Expand Down
Binary file modified Screenshoots/DemoApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshoots/InterfaceBuilderGuide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions UIImageView+Extension.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "UIImageView+Extension"
s.version = "0.2.1"
s.version = "0.2.2"
s.summary = "A simple UIImageView category with some extension functions."

s.description = <<-DESC
Expand All @@ -9,6 +9,7 @@ Pod::Spec.new do |s|
- Set border radius for image view.
- Set shadow for image view.
- Rotate image view.
- Set image view to circle.
DESC

s.homepage = "https://github.com/lm2343635/UIImageView-Extension"
Expand All @@ -17,7 +18,7 @@ Pod::Spec.new do |s|
s.social_media_url = "http://fczm.pw"

s.platform = :ios
s.source = { :git => "https://github.com/lm2343635/UIImageView-Extension.git", :tag => "0.2.1" }
s.source = { :git => "https://github.com/lm2343635/UIImageView-Extension.git", :tag => "0.2.2" }

s.source_files = "UIImageView+Extension/**/*.{h,m}"

Expand Down

0 comments on commit 5fa123b

Please sign in to comment.