Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@ LLSwitch
This is a funny switch for iOS<br>
一个有趣的switch

Thank [Dribbble](https://dribbble.com/shots/2706143-Dribbble-Debut-Boring-Funny-Slider-Animation) for providing inspiration
Thanks [Dribbble](https://dribbble.com/shots/2706143-Dribbble-Debut-Boring-Funny-Slider-Animation) for providing inspiration

----------


Preview 预览
-------------
![LLSwitchDemo](https://github.com/lilei644/LLSwitch/blob/master/Preview/LLSwitchDemo.gif)

## Installation &nbsp;安装
* pod
```
1.pod "LLSwitch"
2.pod install // 若获取失败请重新 pod setup
3.#import "LLSwitch.h"
```
* Common
```
1.Add "LLSwitch" files to your Project // 直接导入“LLSwitch”文件夹到项目中
2.#import "LLSwitch.h"

#### CocoaPods
You can use [CocoaPods](http://cocoapods.org/) to install `LLSwitch` by adding it to your `Podfile`:

```ruby
platform :ios, '8.0'
use_frameworks!
pod 'LLSwitch'
```
To get the full benefits import `LLSwitch` wherever you import UIKit

#### Manually
1. Download and drop ```/LLSwitch```folder in your project.
2. Congratulations!

## Usage &nbsp;用法
* Init &nbsp;初始化

#### Initialization &nbsp;初始化
```
LLSwitch *llSwitch = [[LLSwitch alloc] initWithFrame:CGRectMake(100, 100, 120, 60)];
[self.view addSubview:llSwitch];
```
* Reset Base Property &nbsp;重设基本属性

#### Reset Base Property &nbsp;重设基本属性
```
llSwitch.onColor = [UIColor blueColor]; // switch is open color 开关打开的颜色
llSwitch.offColor = [UIColor grayColor]; // switch is close color 开关关闭的颜色
llSwitch.faceColor = [UIColor whiteColor]; // switch face color 圆脸的颜色
llSwitch.animationDuration = 1.2f; // switch open or close animation time 开关的动画时间
```

* delegate &nbsp;代理监听
#### delegate &nbsp;代理监听
```
<LLSwitchDelegate>
llSwitch.delegate = self;
Expand All @@ -58,7 +58,7 @@ NSLog(@"stop");
NSLog(@"stop --- on:%hhd", on);
}
```
* support xib and storyboard&nbsp;支持xib和storyboard
#### support xib and storyboard&nbsp;支持xib和storyboard
![LLSwitchForXib](https://github.com/lilei644/LLSwitch/blob/master/Preview/LLSwitchForXib.png)

## Requirements &nbsp;版本要求
Expand Down