Post

Replies

Boosts

Views

Activity

SwiftUI MenuBarExtra not updating when State changes
hi is there any way to UPDATE dropdown content Text or do anything when "@State" changes ? cuz in normal SwiftUI views everything rerenders when "@State" changes expect this new "MenuBarExtra" code in "label:" part will update when "@State" change but where I added "ControlView()" it does not :/ example code: @State var secounds = 0     @State var timerRunning = false     let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()     var body: some Scene {         MenuBarExtra {             ControlView()         } label: {             Text("\(hours):\(minutes):\(secounds)")                 .onReceive(timer) { _ in                     }                 }         }         .menuBarExtraStyle(.window)     }          @ViewBuilder     func ControlView()->some View {         Grid(horizontalSpacing: 12, verticalSpacing: 12) {             GridRow {                 ZStack {                     RoundedRectangle(cornerRadius: 12, style: .continuous)                         .fill(.red)                         .frame(height: 75)                                          Text("\(timerRunning ? "Pause" : "Play")")                         .padding()                         .onTapGesture {                             timerRunning.toggle()                         }                 }             }         }         .padding(10)     }
4
3
1.8k
Oct ’23
SwiftUI MenuBarExtra not updating when State changes
hi is there any way to UPDATE dropdown content Text or do anything when "@State" changes ? cuz in normal SwiftUI views everything rerenders when "@State" changes expect this new "MenuBarExtra" code in "label:" part will update when "@State" change but where I added "ControlView()" it does not :/ example code: @State var secounds = 0     @State var timerRunning = false     let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()     var body: some Scene {         MenuBarExtra {             ControlView()         } label: {             Text("\(hours):\(minutes):\(secounds)")                 .onReceive(timer) { _ in                     }                 }         }         .menuBarExtraStyle(.window)     }          @ViewBuilder     func ControlView()->some View {         Grid(horizontalSpacing: 12, verticalSpacing: 12) {             GridRow {                 ZStack {                     RoundedRectangle(cornerRadius: 12, style: .continuous)                         .fill(.red)                         .frame(height: 75)                                          Text("\(timerRunning ? "Pause" : "Play")")                         .padding()                         .onTapGesture {                             timerRunning.toggle()                         }                 }             }         }         .padding(10)     }
Replies
4
Boosts
3
Views
1.8k
Activity
Oct ’23
Use old renamed app name in new app
Hi we want to change app bundle name, Yup its not passible so if we rename our old app to some random name then we uplod same app With different bundle and remove old app can we use old name from old app ? ( after we rename it ) thanks
Replies
0
Boosts
0
Views
423
Activity
Feb ’22