I have a UIBarButtonItem with an image I setup in the storyboard. Later on in the program, I want to change the barButtonItem to have text, and not an image. Here's the code:
self.menuBarButton.setBackgroundImage(nil, forState: .Normal, barMetrics: .Default)
self.menuBarButton.title = "Some Text"
When I run the app, the barButton shows the image, and 3 dots. "...". What can I do to remove the image, and have text instead?
Just set the .image-Property nil:
self.menuBarButton.image = nil;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With