Skip to content

Commit

Permalink
[NEW] New features coming. Now TXScrollLabelView support both array &…
Browse files Browse the repository at this point in the history
… string. (And refactor code again!)
  • Loading branch information
tingxins committed May 6, 2017
1 parent eb69601 commit 7a27329
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 71 deletions.
32 changes: 29 additions & 3 deletions TXScrollLabelView/TXScrollLabelView.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
//
// Created by tingxins on 2/23/16.
// Copyright © 2016 tingxins. All rights reserved.
// Welcome to my blog: https://tingxins.com
// 滚动视图
// 如果在使用 TXScrollLabelView 的过程中出现bug,请及时联系,我会尽快进行修复。如果有更好的点子,直接 Open an issue 或者 submit a pr。
/**
Blog : https://tingxins.com
简书 :http://www.jianshu.com/u/5141561e4d59
GitHub : https://github.com/tingxins
Weibo : http://weibo.com/tingxins
Twitter : http://twitter.com/tingxins
*/

#define TX_DEPRECATED_METHODS(explain) __attribute__((deprecated(explain)))
#define TX_DEPRECATED_MESSAGES(explain) __deprecated_msg(explain)
Expand Down Expand Up @@ -76,7 +82,7 @@ typedef NS_ENUM(NSInteger, TXScrollLabelViewType) {
options:(UIViewAnimationOptions)options
inset:(UIEdgeInsets)inset;

#pragma mark - Class Methods
#pragma mark - Factory Methods

+ (instancetype)scrollWithTitle:(NSString *)scrollTitle;

Expand Down Expand Up @@ -123,6 +129,26 @@ typedef NS_ENUM(NSInteger, TXScrollLabelViewType) {

@end

@interface TXScrollLabelView (TXArray)

/**
类初始化方法
@param scrollTexts 滚动文本数组
*/
- (instancetype)initWithTextArray:(NSArray *)scrollTexts
type:(TXScrollLabelViewType)scrollType
velocity:(NSTimeInterval)scrollVelocity
options:(UIViewAnimationOptions)options
inset:(UIEdgeInsets)inset;

+ (instancetype)scrollWithTextArray:(NSArray *)scrollTexts
type:(TXScrollLabelViewType)scrollType
velocity:(NSTimeInterval)scrollVelocity
options:(UIViewAnimationOptions)options
inset:(UIEdgeInsets)inset;

@end

@interface TXScrollLabelView (TXScrollLabelViewDeprecated)

+ (instancetype)tx_setScrollTitle:(NSString *)scrollTitle TX_DEPRECATED_MESSAGES("Method deprecated. Use `+ scrollWithTitle:`");
Expand Down
Loading

0 comments on commit 7a27329

Please sign in to comment.