Skip to content

Commit

Permalink
Use a separate method to check both isMorphingEnabled and [UIView are…
Browse files Browse the repository at this point in the history
…AnimationsEnabled]
  • Loading branch information
wanderwaltz committed Nov 21, 2014
1 parent 83a23a0 commit 2528dbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/TOMSMorphingLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ - (void)tickInitial

#pragma mark - Getters

- (BOOL)isMorphingEnabled
- (BOOL)shouldAnimateSettingText
{
return _morphingEnabled && [UIView areAnimationsEnabled];
return self.isMorphingEnabled && [UIView areAnimationsEnabled];
}

- (CGFloat)easedValue:(CGFloat)p
Expand Down Expand Up @@ -263,7 +263,7 @@ - (void)setText:(NSString *)text

- (void)setText:(NSString*) text withCompletionBlock:(void (^)(void))block{
_setTextCompletionBlock = block;
if (self.isMorphingEnabled) {
if ([self shouldAnimateSettingText]) {
self.nextText = text ? text : @"";
if (self.displayLinkDuration > 0) {
[self beginMorphing];
Expand Down

0 comments on commit 2528dbf

Please sign in to comment.