I am trying to change the default title colour of the view presented by UIDocumentInteractionController? The default color is balck and the only property available is title.
Asked
Active
Viewed 485 times
1
-
I was able to change the background colour and tint color, but not the title color. – Naveen George Thoppan Sep 02 '16 at 05:55
-
`tintColor` will change the title color also. – Nirav D Sep 02 '16 at 06:02
-
http://stackoverflow.com/questions/37703314/change-navigationbar-background-on-uidocumentinteractioncontroller – Anbu.Karthik Sep 02 '16 at 06:03
1 Answers
0
in swift
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController
{
navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white]
return self.navigationController ?? self
}

Rajesh Shiyal
- 19
- 3
-
2While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. – Yunnosch Jul 12 '21 at 12:59