Skip to content

Commit

Permalink
- use more modern/cleaner nullability flags
Browse files Browse the repository at this point in the history
- reorganize properties, update docs
  • Loading branch information
cbess committed Feb 18, 2017
1 parent f6fb772 commit 88f8b19
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions CBAutoScrollLabel/CBAutoScrollLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ typedef NS_ENUM(NSInteger, CBAutoScrollDirection) {
@interface CBAutoScrollLabel : UIView <UIScrollViewDelegate>

@property (nonatomic) CBAutoScrollDirection scrollDirection;
@property (nonatomic) float scrollSpeed; // pixels per second, defaults to 30
/// Scroll speed in pixels per second, defaults to 30
@property (nonatomic) float scrollSpeed;
@property (nonatomic) NSTimeInterval pauseInterval; // defaults to 1.5
@property (nonatomic) NSInteger labelSpacing; // pixels, defaults to 20

Expand All @@ -40,13 +41,13 @@ typedef NS_ENUM(NSInteger, CBAutoScrollDirection) {
@property (nonatomic) CGFloat fadeLength; // defaults to 7

// UILabel properties
@property (nonatomic, strong, nonnull) UIFont *font;
@property (nonatomic, copy, nullable) NSString *text;
@property (nonatomic, copy, nullable) NSAttributedString *attributedText;
@property (nonatomic, strong, nonnull) UIColor *textColor;
@property (nonatomic, strong, nonnull) UIFont *font;
@property (nonatomic) NSTextAlignment textAlignment; // only applies when not auto-scrolling
@property (nonatomic, strong, nullable) UIColor *shadowColor;
@property (nonatomic) CGSize shadowOffset;
@property (nonatomic) NSTextAlignment textAlignment; // only applies when not auto-scrolling

/**
* Lays out the scrollview contents, enabling text scrolling if the text will be clipped.
Expand All @@ -58,12 +59,12 @@ typedef NS_ENUM(NSInteger, CBAutoScrollDirection) {
* Set the text to the label and refresh labels, if needed.
* @discussion Useful when you have a situation where you need to layout the scroll label after it's text is set.
*/
- (void)setText:(NSString * __nullable)text refreshLabels:(BOOL)refresh;
- (void)setText:(nullable NSString *)text refreshLabels:(BOOL)refresh;

/**
Set the attributed text and refresh labels, if needed.
*/
- (void)setAttributedText:(NSAttributedString * __nullable)theText refreshLabels:(BOOL)refresh;
- (void)setAttributedText:(nullable NSAttributedString *)theText refreshLabels:(BOOL)refresh;

/**
* Initiates auto-scroll, if the label width exceeds the bounds of the scrollview.
Expand Down

0 comments on commit 88f8b19

Please sign in to comment.