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)
}
Post
Replies
Boosts
Views
Activity
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