0

I have created a working share extension to share a URL, and am using the default share extension pop up. Now, I'd like to change the bar button font of the iOS share extension pop up. I have tried both of the following attributed text commands in the ShareViewController viewDidLoad() without success:

UIBarButtonItem.appearance(whenContainedInInstancesOf: [UINavigationBar.classForCoder() as! UIAppearanceContainer.Type]).setTitleTextAttributes([NSForegroundColorAttributeName: color, NSFontAttributeName: newFont], for: .normal)

and

self.navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName:UIFont(name:"OfficeCodeProD-Regular", size: 12)!]

Any suggestions or pointers towards the appropriate resources is much appreciated!

lucius degeer
  • 403
  • 1
  • 6
  • 17
  • Your approach is very "hacky" and it's usually a bad idea to forcefully changing non-changeable attributes in system elements. If you want a custom share pop-up, you should create a custom view. – Tamás Sengel Oct 02 '17 at 09:15
  • Thanks. Good to know. – lucius degeer Oct 03 '17 at 03:25
  • I don't think you can change the appearance of, what is in effect, a system controlled window. You would probably be better off just making your own UX for your extension. I wanted to change the button titles, and approached it this way. It was pretty simple. – Brian Trzupek Jan 06 '18 at 11:35

0 Answers0