@@ -130,9 +130,9 @@ - (void)setSomeSubviews {
130130}
131131
132132#pragma mark - init Methods
133- /* * Terminating app due to uncaught exception 'Warning TXScrollLabelView -[TXScrollLabelView init] unimplemented!', reason: 'unimplemented, use - tx_setScrollTitle :scrollType:scrollVelocity:options:'*/
133+ /* * Terminating app due to uncaught exception 'Warning TXScrollLabelView -[TXScrollLabelView init] unimplemented!', reason: 'unimplemented, use - scrollWithTitle :scrollType:scrollVelocity:options:'*/
134134- (instancetype )init {
135- @throw [NSException exceptionWithName: [NSString stringWithFormat: @" Warning %@ %s unimplemented!" , self .class, __func__] reason: @" unimplemented, please use - tx_setScrollTitle :scrollType:scrollVelocity:options:" userInfo: nil ];
135+ @throw [NSException exceptionWithName: [NSString stringWithFormat: @" Warning %@ %s unimplemented!" , self .class, __func__] reason: @" unimplemented, please use - scrollWithTitle :scrollType:scrollVelocity:options:" userInfo: nil ];
136136}
137137
138138- (instancetype )initWithFrame : (CGRect)frame {
@@ -146,10 +146,10 @@ - (instancetype)initWithFrame:(CGRect)frame {
146146}
147147
148148- (instancetype )initWithTitle : (NSString *)scrollTitle
149- scrollType : (TXScrollLabelViewType)scrollType
150- scrollVelocity : (NSTimeInterval )scrollVelocity
151- options : (UIViewAnimationOptions)options
152- inset : (UIEdgeInsets)inset {
149+ type : (TXScrollLabelViewType)scrollType
150+ velocity : (NSTimeInterval )scrollVelocity
151+ options : (UIViewAnimationOptions)options
152+ inset : (UIEdgeInsets)inset {
153153 if (self = [super init ]) {
154154 self.scrollTitle = scrollTitle;
155155 self.scrollType = scrollType;
@@ -160,51 +160,53 @@ - (instancetype)initWithTitle:(NSString *)scrollTitle
160160 return self;
161161}
162162
163- + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle {
163+ + (instancetype )scrollWithTitle : (NSString *)scrollTitle {
164164
165- return [self tx_setScrollTitle : scrollTitle
166- scrollType : TXScrollLabelViewTypeLeftRight];
165+ return [self scrollWithTitle : scrollTitle
166+ type : TXScrollLabelViewTypeLeftRight];
167167}
168168
169- + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
170- scrollType : (TXScrollLabelViewType)scrollType {
169+ + (instancetype )scrollWithTitle : (NSString *)scrollTitle
170+ type : (TXScrollLabelViewType)scrollType {
171171
172- return [self tx_setScrollTitle : scrollTitle
173- scrollType : scrollType
174- scrollVelocity : TXScrollDefaultTimeInterval];
172+ return [self scrollWithTitle : scrollTitle
173+ type : scrollType
174+ velocity : TXScrollDefaultTimeInterval];
175175}
176176
177- + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
178- scrollType : (TXScrollLabelViewType)scrollType
179- scrollVelocity : (NSTimeInterval )scrollVelocity {
177+ + (instancetype )scrollWithTitle : (NSString *)scrollTitle
178+ type : (TXScrollLabelViewType)scrollType
179+ velocity : (NSTimeInterval )scrollVelocity {
180180
181- return [self tx_setScrollTitle : scrollTitle
182- scrollType : scrollType
183- scrollVelocity : scrollVelocity
184- options: UIViewAnimationOptionCurveEaseInOut];
181+ return [self scrollWithTitle : scrollTitle
182+ type : scrollType
183+ velocity : scrollVelocity
184+ options: UIViewAnimationOptionCurveEaseInOut];
185185}
186186
187- + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
188- scrollType : (TXScrollLabelViewType)scrollType
189- scrollVelocity : (NSTimeInterval )scrollVelocity
190- options : (UIViewAnimationOptions)options {
187+ + (instancetype )scrollWithTitle : (NSString *)scrollTitle
188+ type : (TXScrollLabelViewType)scrollType
189+ velocity : (NSTimeInterval )scrollVelocity
190+ options : (UIViewAnimationOptions)options {
191191
192- return [self tx_setScrollTitle: scrollTitle
193- scrollType: scrollType
194- scrollVelocity: scrollVelocity
195- options: options inset: UIEdgeInsetsMake (0 , 5 , 0 , 5 )];
196- }
197-
198- + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
199- scrollType : (TXScrollLabelViewType)scrollType
200- scrollVelocity : (NSTimeInterval )scrollVelocity
201- options : (UIViewAnimationOptions)options
202- inset : (UIEdgeInsets)inset {
192+ return [self scrollWithTitle: scrollTitle
193+ type: scrollType
194+ velocity: scrollVelocity
195+ options: options
196+ inset: UIEdgeInsetsMake (0 , 5 , 0 , 5 )];
197+ }
198+
199+ + (instancetype )scrollWithTitle : (NSString *)scrollTitle
200+ type : (TXScrollLabelViewType)scrollType
201+ velocity : (NSTimeInterval )scrollVelocity
202+ options : (UIViewAnimationOptions)options
203+ inset : (UIEdgeInsets)inset {
203204
204205 return [[self alloc ] initWithTitle: scrollTitle
205- scrollType: scrollType
206- scrollVelocity: scrollVelocity
207- options: options inset: inset];
206+ type: scrollType
207+ velocity: scrollVelocity
208+ options: options
209+ inset: inset];
208210}
209211
210212#pragma mark - Getter & Setter Methods
@@ -511,3 +513,52 @@ - (void)dealloc {
511513}
512514
513515@end
516+
517+ @implementation TXScrollLabelView (TXScrollLabelViewDeprecated)
518+
519+ + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle {
520+
521+ return [self scrollWithTitle: scrollTitle];
522+ }
523+
524+ + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
525+ scrollType : (TXScrollLabelViewType)scrollType {
526+
527+ return [self scrollWithTitle: scrollTitle
528+ type: scrollType];
529+ }
530+
531+ + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
532+ scrollType : (TXScrollLabelViewType)scrollType
533+ scrollVelocity : (NSTimeInterval )scrollVelocity {
534+
535+ return [self scrollWithTitle: scrollTitle
536+ type: scrollType
537+ velocity: scrollVelocity];
538+ }
539+
540+ + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
541+ scrollType : (TXScrollLabelViewType)scrollType
542+ scrollVelocity : (NSTimeInterval )scrollVelocity
543+ options : (UIViewAnimationOptions)options {
544+
545+ return [self scrollWithTitle: scrollTitle
546+ type: scrollType
547+ velocity: scrollVelocity
548+ options: options];
549+ }
550+
551+ + (instancetype )tx_setScrollTitle : (NSString *)scrollTitle
552+ scrollType : (TXScrollLabelViewType)scrollType
553+ scrollVelocity : (NSTimeInterval )scrollVelocity
554+ options : (UIViewAnimationOptions)options
555+ inset : (UIEdgeInsets)inset {
556+
557+ return [self scrollWithTitle: scrollTitle
558+ type: scrollType
559+ velocity: scrollVelocity
560+ options: options
561+ inset: inset];
562+ }
563+
564+ @end
0 commit comments