0

I am using CNContactViewController form contact framework for adding new local contact, but after presenting this view controller navigation bar becomes some different color which is not matching in my app. below is the code and i am adding screenshot too for reference. please suggest me a way to customize this navigation bar.

CNContactStore *store = [[CNContactStore alloc] init];
CNMutableContact *contact = [[CNMutableContact alloc] init];
CNContactViewController *controller = [CNContactViewController viewControllerForNewContact:contact];


controller.contactStore = store;
controller.delegate = self;

[self presentViewController:controller animated:YES completion:nil];

enter image description here

manish
  • 109
  • 1
  • 11

1 Answers1

0

You can set in AppDelegate didFinishLaunching the bar tint color for all navigation bar instances of your app (CNContactViewController including) using:

[[UINavigationBar appearance] setBarTintColor: [UIColor ... yourColor]];
Francesco Deliro
  • 3,899
  • 2
  • 19
  • 24
  • 1
    in iOS 9.0 it's working but in iOS 12 it's not working. Can you suggest any idea for me.... – Naresh Apr 23 '19 at 12:18
  • I’m not sure because I haven’t tried it recently using a CNContactViewController, but seems like a bug along the iOS versions, check this [stackoverflow question](https://stackoverflow.com/questions/39793418/cncontactviewcontroller-navigation-bar-different-between-versions). – Francesco Deliro Apr 23 '19 at 20:16