Skip to content

Commit

Permalink
Adding ability to animate UILabel.textColor.
Browse files Browse the repository at this point in the history
  • Loading branch information
waltflanagan committed May 6, 2014
1 parent 8678237 commit 6a80ea4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pop-tests/POPAnimatablePropertyTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ - (void)testProvidedExistence
kPOPViewBounds,
kPOPViewSize,
kPOPTableViewContentSize,
kPOPTableViewContentOffset
kPOPTableViewContentOffset,
kPOPLabelTextColor
#endif
];

Expand Down
5 changes: 5 additions & 0 deletions pop/POPAnimatableProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,9 @@ extern NSString * const kPOPToolbarBarTintColor;
*/
extern NSString * const kPOPTabBarBarTintColor;

/**
Common UILabel property names.
*/
extern NSString * const kPOPLabelTextColor;

#endif
15 changes: 15 additions & 0 deletions pop/POPAnimatableProperty.mm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
// UITabBar
NSString * const kPOPTabBarBarTintColor = kPOPNavigationBarBarTintColor;

//UILabel
NSString * const kPOPLabelTextColor = @"label.textColor";

/**
State structure internal to static animatable property.
*/
Expand Down Expand Up @@ -500,6 +503,18 @@
},
kPOPThresholdColor
},

/* UILabel */

{kPOPLabelTextColor,
^(UILabel *obj, CGFloat values[]) {
POPUIColorGetRGBAComponents(obj.textColor, values);
},
^(UILabel *obj, const CGFloat values[]) {
obj.textColor = POPUIColorRGBACreate(values);
},
kPOPThresholdColor
},

#endif

Expand Down

0 comments on commit 6a80ea4

Please sign in to comment.