'Need data to initialize a StateObject

I have a StateObject which I need to initialize with properties from Settings:

@State private var settingsStore = SettingsStore()
@StateObject var matrix = Matrix(d: settingsStore.d)

How do I do this? I can't make it a computed property because it's a state object



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source