Replace deprecated methods in iOS 7 with NSForegroundColorAttributeName and NSShadowAttributeName

This commit is contained in:
Wong Zigii
2016-04-28 16:33:36 +08:00
parent 985a832d5b
commit f92c0efdaa

View File

@@ -197,16 +197,16 @@
// uisearchbarcancel
[[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil]
setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[WPStyleGuide wordPressBlue],
UITextAttributeTextColor,
[UIColor clearColor],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
nil]
forState:UIControlStateNormal];
NSShadow *shadow = [NSShadow new];
[shadow setShadowColor:[UIColor clearColor]];
[shadow setShadowOffset:CGSizeMake(0.0f, -1.0f)];
UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]];
[barButtonItem setTitleTextAttributes:@{
NSForegroundColorAttributeName: [WPStyleGuide wordPressBlue],
NSShadowAttributeName: shadow,
}
forState:UIControlStateNormal];
}
- (void)applicationWillResignActive:(UIApplication *)application