Hello. I've just finished the second challenge and I had a question - the challenge states:
"Try making two new toolbar items with the titles Back and Forward. You should make them use webView.goBack and webView.goForward."
So, I attempted to do what we did with refresh, aka:
let refresh = UIBarButtonItem(barButtonSystemItem: .refresh, target: webView, action: #selector(webView.reload))
but for back and forward, so I did the below:
let back = UIBarButtonItem(barButtonSystemItem: .rewind, target: webView, action: #selector(webView.goBack))
let forward = UIBarButtonItem(barButtonSystemItem: .fastForward, target: webView, action: #selector(webView.goForward))
My main issue was with the barButtonSystemItem. I found a list of all possible system icons here but there are no simple back or forward buttons so, as per above, I've used the fast forward and rewind symbols, which work, but it's obviously not an ideal solution.
What should I have done here, or how did you guys get round it? For context, I displayed the above using:
toolbarItems = [progressButton, spacer, back, forward, refresh]
I wasn't sure if we were meant to have just the words "back" and "forward" appear, but using the method I used above it seemed that a systemitem was required.