Skip to content

Commit f39ee46

Browse files
Gate ASButtonNode setTitle method since [UIFont buttonFontSize] is unavailable on tvOS 9.1
1 parent 08d15e4 commit f39ee46

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

AsyncDisplayKit/ASButtonNode.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
*/
5555
- (void)setAttributedTitle:(nullable NSAttributedString *)title forState:(ASControlState)state;
5656

57+
#if TARGET_OS_IOS
5758
/**
5859
* Sets the title to use for the specified state. This will reset styled title previously set with -setAttributedTitle:forState.
5960
*
@@ -63,7 +64,7 @@
6364
* @param state The state that uses the specified title. The possible values are described in ASControlState.
6465
*/
6566
- (void)setTitle:(nonnull NSString *)title withFont:(nullable UIFont *)font withColor:(nullable UIColor *)color forState:(ASControlState)state;
66-
67+
#endif
6768
/**
6869
* Returns the image used for a button state.
6970
*

AsyncDisplayKit/ASButtonNode.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ - (void)setLaysOutHorizontally:(BOOL)laysOutHorizontally
196196
[self setNeedsLayout];
197197
}
198198

199+
#if TARGET_OS_IOS
199200
- (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(ASControlState)state
200201
{
201202
NSDictionary *attributes = @{
@@ -207,6 +208,7 @@ - (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)
207208
attributes:attributes];
208209
[self setAttributedTitle:string forState:state];
209210
}
211+
#endif
210212

211213
- (NSAttributedString *)attributedTitleForState:(ASControlState)state
212214
{

0 commit comments

Comments
 (0)