Gate ASButtonNode setTitle method since [UIFont buttonFontSize] is unavailable on tvOS 9.1

This commit is contained in:
Aaron Schubert
2016-02-05 14:23:01 +00:00
parent 08d15e4ca5
commit f39ee46b61
2 changed files with 4 additions and 1 deletions

View File

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

View File

@@ -196,6 +196,7 @@
[self setNeedsLayout];
}
#if TARGET_OS_IOS
- (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(ASControlState)state
{
NSDictionary *attributes = @{
@@ -207,6 +208,7 @@
attributes:attributes];
[self setAttributedTitle:string forState:state];
}
#endif
- (NSAttributedString *)attributedTitleForState:(ASControlState)state
{