Picker not updating for some reason

Hello. I have a picker that uses an enum to populate itself. There is a class called "user" that has a variable called "defaultTab". This is what's being used as the selection for the picker.

Code Block
enum Tab: String, CaseIterable {
case data = "Data"
case transactions = "Transactions"
case user = "User"
var id: String {self.rawValue}
}

That is the enum.

Code Block import SwiftUI
class User: ObservableObject {
var name: String
var sources: [Source]
var accounts: [Account]
var categories: [Category]
var transactions: [Transaction]
var defaultTab: Tab
init(name: String, sources: [Source], accounts: [Account], categories: [Category], transactions: [Transaction], defaultTab: Tab) {
self.name = name
self.sources = sources
self.accounts = accounts
self.categories = categories
self.transactions = transactions
self.defaultTab = defaultTab
}
}

That is the class, and below is the picker.

Code Block
Picker("Default tab", selection: $user.defaultTab) {
ForEach(Tab.allCases, id: \.self) { kind in
Text(kind.rawValue)
.tag(kind as Tab)
}
}

This picker is inside of a Section that is inside of a List. When I make a selection, it does not change the picker. How can I resolve this issue?

How can I resolve this issue?

If you could show complete code to reproduce the issue, more readers would try to solve it.
Picker not updating for some reason
 
 
Q