Skip to content

Instantly share code, notes, and snippets.

@mclaughj
Last active August 29, 2015 14:08
Show Gist options
  • Save mclaughj/83d709a7792e1611e118 to your computer and use it in GitHub Desktop.
Save mclaughj/83d709a7792e1611e118 to your computer and use it in GitHub Desktop.
A button that looks like it belongs in Notification Center
_myNCButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_myNCButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_myNCButton setBackgroundColor:[UIColor whiteColor]];
[_myNCButton setTitle:@"My Button Title" forState:UIControlStateNormal];
[_myNCButton.titleLabel setFont:[UIFont systemFontOfSize:13]];
_myNCButton.layer.cornerRadius = 4;
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect notificationCenterVibrancyEffect];
_vibrancyEffectView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
[[_vibrancyEffectView contentView] addSubview:_myNCButton];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment