var menuList = [
UIAction(title: "title1", handler: { (action: UIAction) in self.myAction(action) }),
UIAction(title: "title2", handler: { (action: UIAction) in self.myAction(action) }),
UIAction(title: "title3", handler: { (action: UIAction) in self.myAction(action) }),
]
self.btn.menu = UIMenu(children: menuList)
This is a drop-down button group and I need to populate the button with the title showing the item, and the check mark next to it.
How to click on the 2nd menu item programmatically?