Change UIMenu position to bottom right corner of UIButton (UIMenu with UIButton)

1.3k Views Asked by At

I added UIMenu to the UIButton.menu. UIMenu displayed at (x: 0, y:0) of the button.

let items = (1...9).reversed().map {
            UIAction(title: "\($0.description) \(self.yearString(text: $0.description))") { [unowned self] action in
            }
        }

self.button.menu = UIMenu(title: "", children: items)
self.button.showsMenuAsPrimaryAction = true

Is there any way I could change the menu's location/position? I want to display the menu at bottom right corner of the button.

enter image description here

Is there any way I could change the menu's location/position? I want to display the menu at bottom right corner of the button.

0

There are 0 best solutions below