๐Ÿ”ฐinit State

SwiftUI โŸฉ Data Flow โŸฉ State โŸฉ init

// @State property in content view
@State private var time: Int

// custom initializer in extension
init(time: Int) {
    _time = State(initialValue: time)    // โญ๏ธ init @State
    // init other properties ...
}

Last updated