Hi everyone I'm using the "Menu" structure to display the possible choices to the user
public struct Menu <Label, Content>: Display where Label: Display, Content: Display
Everything seems to work with SwiftUI but I continue to receive alerts in the console that tell me this:
2021-09-30 20:55:40.032369+0200 [UILog] Called -[UIContextMenuInteraction updateVisibleMenuWithBlock:] while no context menu is visible. This won't do anything.
2021-09-30 20:55:41.344436+0200 [UILog] Called -[UIContextMenuInteraction updateVisibleMenuWithBlock:] while no context menu is visible. This won't do anything.
2021-09-30 20:55:41.414976+0200 [UICollectionViewRecursion] cv == 0x10401dc00 Disabling recursion trigger logging
2021-09-30 20:55:41.417708+0200 [UICollectionViewRecursion] cv == 0x10401dc00 Disabling recursion trigger logging
Where am I doing wrong ?
This is my code for the Menu
private var months: [Date] {
calendar.createDate(
interval: calendar.dateInterval(of: .year, for: Date())
matching: DateComponents(day: 1, hour: 0, minute: 0, second: 0)
)
}
var body: some View {
Menu("Options") {
ForEach(months, id:\.self) { month
Button("\(DateFormatter(format: "MMMM").string(from: month))"){
selectedDate = month }
}
}
}