Saving the User Selection on a Picker After Pressing a Button

SwiftUI:

struct picker: View {
var cardCarriers = [“Chase”, “Citibank”, “Capitol One”, “Wells Fargo”, “Bank of America”]
@State var pickerSelectedItem = 0

var body: some View {
    VStack {
    Picker(selection: $pickerSelectedItem, label: Text("")) {
        ForEach(0 ..< cardCarriers.count) { index in
            Text(self.cardCarriers[index]).tag(index)
        }
    }
        Text("Selected Card carrier: \(cardCarriers[pickerSelectedItem])")

How do you add the button that saves the user data

Hey @Kelvin_Jou,

Not entirely sure what you mean, but if you are looking to store a value for a user even after the app has been closed/through multiple sessions, try using User Defaults. Check this video out: https://www.youtube.com/watch?v=sUhq1vIrRbo&t=689s

Sincerely,
UrAvgCoder