Skip to content

Commit

Permalink
[UPDATE] 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shevakuilin committed Apr 2, 2019
1 parent 513f97a commit 6b3f590
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 9 deletions.
54 changes: 47 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![](https://img.shields.io/badge/platform-iOS-green.svg)
![](https://img.shields.io/badge/pod-v1.6.0.beta.1-blue.svg)
![](https://img.shields.io/badge/language-ObjectiveC-purple.svg)
![](https://img.shields.io/badge/moduleVersion-v0.0.2-red.svg)
![](https://img.shields.io/badge/moduleVersion-v0.0.3-red.svg)

Automatically scrolling UILabel with both horizontal/vertical MARQUEE effects and gradient gradients on the edges.Gradient fading is used on the edge of the scroll to solve the problem of the hard edges of the rolling edge. The overall effect is a natural and easy to use.

Expand All @@ -28,10 +28,32 @@ Step 1: Execute `git clone [email protected]:shevakuilin/SKAutoScrollLabel.git`,t

Step 2: Copy the `SKAutoScrollLabel` from the directory directly into your project, or add `pod 'SKAutoScrollLabel'` to the Podfile.

Step 3: Reference header file `#import <SKAutoScrollLabel/SKAutoScrollLabel.h>`

# Installation

#### Created by code

```objectivec
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"Fly me to the moon.Let me play among the stars.Let me see what spring is like on Jupiter and Mars.In other words, hold my hand.In other words, baby, kiss me." direction:self.scrollType];
// Scroll from right to left
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"Fly me to the moon.Let me play among the stars.Let me see what spring is like on Jupiter and Mars.In other words, hold my hand.In other words, baby, kiss me." direction: SK_AUTOSCROLL_DIRECTION_LEFT];
scrollLabel.backgroundColor = [UIColor orangeColor];
scrollLabel.textColor = [UIColor whiteColor];
// ... other settings
```
#### Created by storyboard
```objectivec
// Set the object's class to SKAutoScrollLabel in the storyboard
@property (weak, nonatomic) IBOutlet SKAutoScrollLabel *scrollLabel;
// Scroll from right to left
self.scrollLabel.textContent = @"Fly me to the moon.Let me play among the stars.Let me see what spring is like on Jupiter and Mars.In other words, hold my hand.In other words, baby, kiss me.";
self.scrollLabel.direction = SK_AUTOSCROLL_DIRECTION_LEFT;
self.scrollLabel.backgroundColor = [UIColor orangeColor];
self.scrollLabel.textColor = [UIColor whiteColor];
// ... other settings
```

# Parameter meaning
Expand Down Expand Up @@ -97,17 +119,35 @@ SKAutoScrollLabel是一个同时支持水平/垂直两种类型的“跑马灯

2.直接将目录下的 SKAutoScrollLabel 拷贝到你的工程中,或在Podfile文件中添加 ```pod 'SKAutoScrollLabel'```

3.引用头文件 `#import <SKAutoScrollLabel/SKAutoScrollLabel.h>`

# 初始化

# 使用方法
#### 通过代码创建

#### 初始化
```objectivec
// 创建一个从右向左滚动的,背景颜色为橙色,字体颜色为白色的滚动 Label
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"你指尖跃动的电光, 是我此生不灭的信仰! 唯我超电磁炮永世长存!! 哔哩哔哩(゜-゜)つロ干杯~-bilibili" direction: SK_AUTOSCROLL_DIRECTION_LEFT];
scrollLabel.backgroundColor = [UIColor orangeColor];
scrollLabel.textColor = [UIColor whiteColor];
// ... 其他设置
```
#### 通过 storyboard 创建
```objectivec
SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:@"你指尖跃动的电光, 是我此生不灭的信仰! 唯我超电磁炮永世长存!! 哔哩哔哩(゜-゜)つロ干杯~-bilibili" direction:self.scrollType];
// 在 storyboard 中将对象的类设置为 SKAutoScrollLabel
@property (weak, nonatomic) IBOutlet SKAutoScrollLabel *scrollLabel;
// 创建一个从右向左滚动的,背景颜色为橙色,字体颜色为白色的滚动 Label
self.scrollLabel.textContent = @"你指尖跃动的电光, 是我此生不灭的信仰! 唯我超电磁炮永世长存!! 哔哩哔哩(゜-゜)つロ干杯~-bilibili";
self.scrollLabel.direction = SK_AUTOSCROLL_DIRECTION_LEFT;
self.scrollLabel.backgroundColor = [UIColor orangeColor];
self.scrollLabel.textColor = [UIColor whiteColor];
// ... 其他设置
```

#### 基本参数
# 基本参数

- `direction` 滚动方向
- SK_AUTOSCROLL_DIRECTION_RIGHT // 从左向右滚动, 默认选项
Expand All @@ -132,7 +172,7 @@ SKAutoScrollLabel *scrollLabel = [[SKAutoScrollLabel alloc] initWithTextContent:

- `enableFade` 开关梯度渐变,默认开启

#### 控制方法
# 控制方法

```objc
- (void)pauseScroll; // 暂停滚动
Expand Down
2 changes: 1 addition & 1 deletion SKAutoScrollLabel.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SKAutoScrollLabel"
s.version = "0.0.2"
s.version = "0.0.3"
s.summary = "水平/垂直跑马灯"
s.description = <<-DESC
Automatically scrolling UILabel with both horizontal/vertical MARQUEE effects and gradient gradients on the edges
Expand Down
2 changes: 1 addition & 1 deletion Source/SKAutoScrollLabel/SKAutoScrollLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ - (CGRect)fixLabelFrameWithDirection:(SK_AUTOSCROLL_DIRECTION)direction {

- (void)creatDisplayLink {
self.displayLinke = [CADisplayLink displayLinkWithTarget:self selector:@selector(processDisplayLink)];
[self.displayLinke addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[self.displayLinke addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
}

- (void)processDisplayLink {
Expand Down

0 comments on commit 6b3f590

Please sign in to comment.