1

I have a button that i want it have the < back icon and also back text to it . This is what i did:

Text("\(Image(systemName: "chevron.left"))Back")

I am getting this error:

Instance method 'appendInterpolation' requires that 'Image' conform to '_FormatSpecifiable'

I tried fixing it as :

Text("\(Image(systemName: "chevron.left"))Back" as String)

But it does not work. How can i fix it .

1
  • maybe the problem is somewhere, not that image, I tried and it works Text("\(Image(systemName: "chevron.left")) Back") Commented Nov 29, 2020 at 5:58

1 Answer 1

1

You can create a back button like this:

Button(action: {
    
}, label: {
    HStack(spacing: 4) {
        Image(systemName: "arrow.left")
        Text("Back")
    }
})
.accentColor(.blue)

However, I would note that if you are using a NavigationView and are segueing with a NavigationLink, the back button will automatically be there and you do not need to recreate it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.