Search code examples
iphoneuiwebviewuibarbuttonitemuitoolbar

Inverting UIBarButtonItem "Play" for use as a Back Button?


Okay, simple enough.

I'm coding up a simple web view, and I'm providing a few Safari-like controls for navigation.

Play seems to be the obvious choice for the forward button, but I'd like to have a Back Button as well, as seen in several Apple and third party apps.

Is there a way to invert the icon, so that it points backwards, or are all the apps using this setup using images to replicate this functionality?


Solution

  • Unicode is your friend here.

    Create a UIBarButtonItem (in Interface Builder or in code) and set it to "Custom" where you can enter text for the button.

    Now use these Unicode characters to simulate the back & forward buttons:

    ◄ and ►

    I use it in my apps and it looks great.