Created
December 1, 2013 00:22
-
-
Save mbbischoff/7726898 to your computer and use it in GitHub Desktop.
Used instead of `hasText` due to an inscrutable bug in iOS 7.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UITextField (LCKHacks) | |
/// Fixes a bug in UIKit where the `hasText` methods sometimes returns the string's length instead of a BOOL in iOS 7.0.x. | |
- (BOOL)actuallyHasText; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "UITextField+LCKHacks.h" | |
@implementation UITextField (LCKHacks) | |
- (BOOL)actuallyHasText { | |
BOOL hasText = NO; | |
if ([self hasText]) { | |
hasText = YES; | |
} | |
return hasText; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment