Ответ 1
Вы, вероятно, сделали то, что я сделал, и чрезмерно отрезали и заменяли предупреждения компилятора для UITextAttributeTextShadowColor и UITextAttributeTextShadowOffset. Итак, у вас был код, похожий на этот:
NSDictionary *titleAttributes = @{UITextAttributeTextColor: [UIColor whiteColor],
UITextAttributeTextShadowColor: [UIColor blackColor],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(1, 0)],
UITextAttributeFont: [UIFont titleBolder]};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];
и заменил их как на NSShadowAttributeName, так и на следующий код:
NSDictionary *titleAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],
NSShadowAttributeName: [UIColor blackColor],
NSShadowAttributeName: [NSValue valueWithUIOffset:UIOffsetMake(1, 0)],
NSFontAttributeName: [UIFont titleBolder]};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];
Что вам нужно сделать, это иметь один атрибут NSShadowAttributeName и создать экземпляр NSShadow, который содержит теневой цвет и смещение тени.
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor blackColor];
shadow.shadowOffset = CGSizeMake(1, 0);
NSDictionary *titleAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],
NSShadowAttributeName: shadow,
NSFontAttributeName: [UIFont titleBolder]};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];