Adding letterpress
Any text can appear to be letter pressed with the right amount of shadow and highlight. TextKit provides an easy and effective way to accomplish this with a new attribute parameter called NSTextEffectLetterpressStyle
.
Here is an example with code:
NSDictionary *attributes = @{ NSForegroundColorAttributeName : [UIColor blueColor], NSTextEffectAttributeName : NSTextEffectLetterpressStyle}; NSAttributedString* attrString = [[NSAttributedString alloc] initWithString:someString attributes:attributes];
Using attributed strings, we can apply this specific text effect in addition to other attributes. That's all it takes to apply this subtle effect! Take a look at our app as an example: