Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lm2343635 committed Jan 12, 2017
1 parent 1710374 commit 186f6ba
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 8 deletions.
File renamed without changes.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
UIImageView+Extension ![Supported Platforms](https://img.shields.io/cocoapods/p/UIImageView+Extension.svg) [![Latest pod release](https://img.shields.io/cocoapods/v/UIImageView+Extension.svg)](https://cocoapods.org/pods/UIImageView+Extension) [![Build Status](https://travis-ci.org/alexandreos/UILabel-Copyable.svg?branch=master)]() [![License](https://img.shields.io/cocoapods/l/UIImageView+Extension.svg)](https://github.com/lm2343635/UIImageView-Extension/LICENSE)
===
A simple UIImageView category with some extension functions.

# Features
- Supports Interface Builder.
- Set border radius for image view.
- Set shadow for image view.

# Installation

### CocoaPods
Installing UIImageView+Extension by [CocoaPods](http://cocoapods.org/).

```ruby
pod 'UILabel+Copyable', '~> 1.0.0'
```
### Old-fashioned way

- Add `UIImageView+Extension.h` and `UIImageView+Extension.m` to your project.
- `#import "UIImageView+Extension.h"` where you want to use the control.
- These files require **ARC**.

# Usage

If you just want to set features in Interface Builder, just do it in Interface Builder, you need not to do anything.
![Interface Builder Guide](https://github.com/raw/lm2343635/UIImageView-Extension/master/Screenshoots/InterfaceBuilderGuide.png)
If you want to control your image view in your program, you should import the category header: `#import "UIImageView+Extension.h"` to your `.h` or `.m` file.
Binary file added 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.
16 changes: 12 additions & 4 deletions UIImageView+Extension Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
E443BD141E2769B9006140E8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E443BD121E2769B9006140E8 /* LaunchScreen.storyboard */; };
E443BD1F1E2769BA006140E8 /* UIImageView_Extension_DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E443BD1E1E2769BA006140E8 /* UIImageView_Extension_DemoTests.m */; };
E443BD3D1E276ABD006140E8 /* UIImageView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = E443BD3C1E276ABD006140E8 /* UIImageView+Extension.m */; };
E4CA26001E27CC0A007D51C8 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = E4CA25FF1E27CC0A007D51C8 /* README.md */; };
E4CA26021E27D294007D51C8 /* Screenshoots in Resources */ = {isa = PBXBuildFile; fileRef = E4CA26011E27D294007D51C8 /* Screenshoots */; };
E4E1C6F11E278FCC00A62D66 /* UIImageView+Extension.podspec in Resources */ = {isa = PBXBuildFile; fileRef = E4E1C6F01E278FCC00A62D66 /* UIImageView+Extension.podspec */; };
E4E1C6F31E278FFF00A62D66 /* LICENSE.md in Resources */ = {isa = PBXBuildFile; fileRef = E4E1C6F21E278FFF00A62D66 /* LICENSE.md */; };
E4E1C6F31E278FFF00A62D66 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E4E1C6F21E278FFF00A62D66 /* LICENSE */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -47,8 +49,10 @@
E443BD201E2769BA006140E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E443BD3B1E276ABD006140E8 /* UIImageView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+Extension.h"; sourceTree = "<group>"; };
E443BD3C1E276ABD006140E8 /* UIImageView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+Extension.m"; sourceTree = "<group>"; };
E4CA25FF1E27CC0A007D51C8 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
E4CA26011E27D294007D51C8 /* Screenshoots */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Screenshoots; sourceTree = "<group>"; };
E4E1C6F01E278FCC00A62D66 /* UIImageView+Extension.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "UIImageView+Extension.podspec"; sourceTree = "<group>"; };
E4E1C6F21E278FFF00A62D66 /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = "<group>"; };
E4E1C6F21E278FFF00A62D66 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -72,6 +76,7 @@
E443BCF81E2769B9006140E8 = {
isa = PBXGroup;
children = (
E4CA26011E27D294007D51C8 /* Screenshoots */,
E4E1C6EF1E278F9900A62D66 /* Podspec */,
E443BD281E2769BA006140E8 /* UIImageView+Extension */,
E443BD031E2769B9006140E8 /* UIImageView+Extension Demo */,
Expand Down Expand Up @@ -135,7 +140,8 @@
E4E1C6EF1E278F9900A62D66 /* Podspec */ = {
isa = PBXGroup;
children = (
E4E1C6F21E278FFF00A62D66 /* LICENSE.md */,
E4E1C6F21E278FFF00A62D66 /* LICENSE */,
E4CA25FF1E27CC0A007D51C8 /* README.md */,
E4E1C6F01E278FCC00A62D66 /* UIImageView+Extension.podspec */,
);
name = Podspec;
Expand Down Expand Up @@ -223,12 +229,13 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E4CA26021E27D294007D51C8 /* Screenshoots in Resources */,
E443BD141E2769B9006140E8 /* LaunchScreen.storyboard in Resources */,
E4E1C6F11E278FCC00A62D66 /* UIImageView+Extension.podspec in Resources */,
E443BD111E2769B9006140E8 /* Assets.xcassets in Resources */,
E443BD0F1E2769B9006140E8 /* Main.storyboard in Resources */,
E42425711E27AFB60052A669 /* demo.jpg in Resources */,
E4E1C6F31E278FFF00A62D66 /* LICENSE.md in Resources */,
E4E1C6F31E278FFF00A62D66 /* LICENSE in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -248,6 +255,7 @@
files = (
E443BD0C1E2769B9006140E8 /* ViewController.m in Sources */,
E443BD091E2769B9006140E8 /* AppDelegate.m in Sources */,
E4CA26001E27CC0A007D51C8 /* README.md in Sources */,
E443BD3D1E276ABD006140E8 /* UIImageView+Extension.m in Sources */,
E443BD061E2769B9006140E8 /* main.m in Sources */,
);
Expand Down
9 changes: 5 additions & 4 deletions UIImageView+Extension.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Pod::Spec.new do |s|
s.name = "UIImageView+Extension"
s.version = "0.1.0"
s.summary = "A extension category for UIImageView."
s.summary = "A simple UIImageView category with some extension functions."

s.description = <<-DESC
# Features
- Add border for image view
- Add shadow for image view
- Supports Interface Builder.
- Set border radius for image view.
- Set shadow for image view.
DESC

s.homepage = "https://github.com/lm2343635/UIImageView-Extension"
s.license = { :type => "MIT", :file => "LICENSE.md" }
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Meng Li" => "lm2343635@126.com" }
s.social_media_url = "http://fczm.pw"

Expand Down
18 changes: 18 additions & 0 deletions UIImageView+Extension/UIImageView+Extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
// Copyright © 2017 fczm.pw. All rights reserved.
//

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <UIKit/UIKit.h>

@interface UIImageView (Extension)
Expand Down
20 changes: 20 additions & 0 deletions UIImageView+Extension/UIImageView+Extension.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
// Copyright © 2017 fczm.pw. All rights reserved.
//

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import "UIImageView+Extension.h"
#import <objc/runtime.h>

Expand Down Expand Up @@ -37,6 +55,8 @@ - (void)setImageCornerRadius:(CGFloat)radius {
}

#pragma mark - Shadow
// This method should be invoked before you invoke methods including changeShadowColor:color,
// changeShadowXOffset:xOffset, changeShadowYOffset:yOffset and changeShadowRadius:(CGFloat)radius.
- (void)setShadowWithColor:(UIColor *)color
shadowXOffset:(CGFloat)xOffset
shadowYOffset:(CGFloat)yOffset
Expand Down

0 comments on commit 186f6ba

Please sign in to comment.