I am trying to change the text color of the rightBarButtonItem item text and it blue by default . I am trying to change it to black .
My current code for that is:
self.navigationItem.rightBarButtonItem?.tintColor = .black
This does not change anything and the text color is the same . Added the cancel rightBarButtonItem image that i need to change the text from blue to black. How can i do that 
Make sure to initialize your
rightBarButtonItembefore setting its tint color otherwise your optional biding will fail silently: