Created
November 18, 2013 03:58
-
-
Save brynbodayle/7522244 to your computer and use it in GitHub Desktop.
Fix for UILabel attributedPlaceholder not allowing a placeholder font different than the label's text font.
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 "CustomTextField.h" | |
@interface CustomTextField() | |
@property (nonatomic, strong) NSAttributedString *originalAttribtuedPlaceholder; | |
@end | |
@implementation CustomTextField | |
- (void) drawPlaceholderInRect:(CGRect)rect { | |
[self.originalAttribtuedPlaceholder drawWithRect:rect options:NSStringDrawingUsesLineFragmentOrigin context:NULL]; | |
} | |
- (void)setAttributedPlaceholder:(NSAttributedString *)attributedPlaceholder { | |
self.originalAttribtuedPlaceholder = attributedPlaceholder; | |
[super setAttributedPlaceholder:attributedPlaceholder]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment