Popovers
Popovers copied to clipboard
Possible retain cycle on UIKit menu?
I noticed that if I present a menu, dismiss it and then present it again - the last menu item doesn't working. I tried to debug things and noticed that in Menu.swift the code:
.onValueChange(of: model.selectedItemID) { _, newValue in
I get own itemID's that doesn't exist in the model. Like the old model of dismissed menu is still receiving this closure. Also, if I change onValueChanged to
.onChange(of: model.selectedItemID, do: { selectedID in
if selectedID == itemID {
action()
}
model.selectedItemID = nil
})
everything works correctly. I have a strong suspicion that ChangeObserver may have an unnecessary retain, but couldn't figure out that yet