I set a LeftBarButton "Cancel" and a RightBarButton "OK" this way
_barButtonOK = [[UIBarButtonItem alloc] initWithTitle:@"OK" style:UIBarButtonItemStyleDone target:self action:@selector(barButtonOKAction)];
[_barButtonOK setTintColor:BUTTON_TEXTCOLOR];
[self.navigationItem setRightBarButtonItems:@[_barButtonOK]];
_barButtonCancel = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStyleDone target:self action:@selector(barButtonCancelAction)];
[_barButtonCancel setTintColor:BUTTON_TEXTCOLOR];
[self.navigationItem setLeftBarButtonItems:@[_barButtonCancel]];
But when I push a ViewController and then pop it back, the OK button looks like being disabled (actually it is still enabled) like this
It is fine with iOS 10 but just grays out with iOS 11 and I don't know why. Any advice will be appreciated.