Skip to content

Instantly share code, notes, and snippets.

@zxx
Forked from peerasak-u/NSShadow Example
Created May 4, 2016 09:33
Show Gist options
  • Save zxx/e0074cbfc6ed338b9f78c3d1602ab8e3 to your computer and use it in GitHub Desktop.
Save zxx/e0074cbfc6ed338b9f78c3d1602ab8e3 to your computer and use it in GitHub Desktop.
NSShadow Example
NSShadow *textShadow = [[NSShadow alloc] init];
textShadow.shadowColor = [UIColor darkGrayColor];
textShadow.shadowBlurRadius = 1.2;
textShadow.shadowOffset = CGSizeMake(1,1);
NSDictionary *attributes = @{NSForegroundColorAttributeName: [UIColor blackColor],
NSShadowAttributeName: textShadow
};
NSMutableAttributedString *testString = [[NSMutableAttributedString alloc] initWithString:@"Testing Attributed Strings"];
[testString setAttributes:attributes range:NSMakeRange(0, testString.length)];
firstAlphabetLabel.attributedText = testString;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment