Search code examples
iosswiftuinavigationcontrolleruinavigationbarback

How to have back button of style being displayed in Apple App Store, on banner images?


I need to have back button which looks like the one displayed on any App's page in Apple App Store, having banner image. See image below:

back button with filled like style of other System buttons

I have tried finding any possible system icon image name as guided here:

https://stackoverflow.com/a/58900114/1152014

But couldn't find any appropriate one. Please guide.


Solution

  • The system icon image name is chevron.left.circle.fill (the one with fill color) and chevron.left.circle (the one without fill color)

    By default the fill color is black, which you can change using the foreground color option.

    import SwiftUI
    
    struct ContentView: View {
        var body: some View {
            List {
                Image(systemName: "chevron.left.circle.fill")
                    .resizable()
                    .frame(width: 50, height: 50, alignment: .center)
                    .listRowBackground(Color.green)
                Text("")
                Image(systemName: "chevron.left.circle")
                    .resizable()
                    .frame(width: 50, height: 50, alignment: .center)
                    .listRowBackground(Color.green)
            }
            .foregroundColor(.white)
        }
    }
    

    enter image description here