Questions tagged [uimenu]

22 questions
8
votes
2 answers

How to modify UIMenu for UIBarButtonItem and UIButton

iOS 14 adds the ability to display menus upon tapping or long pressing a UIBarButtonItem or UIButton, like so: let menu = UIMenu(children: [UIAction(title: "Action", image: nil) { action in //do something }]) button.menu = menu barButtonItem =…
Jordan H
  • 45,794
  • 29
  • 162
  • 306
7
votes
2 answers

buildMenu is called in AppDelegate but not UIViewController

I'm attempting to create a custom menu for each view in my app, however it appears buildMenu is not being called in View Controllers. Here's an example: In my AppDelegate, this code is used, which works 100% as expected. override func buildMenu(with…
Dave
  • 71
  • 3
4
votes
2 answers

iOS 14 setup the UIBarButttonItem menu before it is opened

As iOS14 offers an easy way to setup the menu on the UIBarButtonItem, I wonder do I miss that there is no easy way to setup its items as they may depend on the current context. I see that there is UIDeferredMenuElement, but this doesn't seem to be a…
Ivan Ičin
  • 7,975
  • 5
  • 32
  • 49
4
votes
1 answer

Show UIMenu when single-tapping UIBarButtonItem

in iOS 14, there are new APIs for UIMenu, and it can now be attached to UIBarButtonItem, just like that: This is my code: @IBOutlet weak var addButton: UIBarButtonItem! // The button is from the storyboard. override func viewDidAppear(_ animated:…
אורי orihpt
  • 1,315
  • 1
  • 6
  • 26
3
votes
0 answers

How to programmatically trigger UIMenu from UIViewRepresentable

I tried to create a custom SwiftUI menu (based on UIMenu). However, I'm unable to trigger the primary action. It works when I tap on the CustomMenu but the programmatic action is not triggered. What am I doing wrong? struct CustomMenu:…
pawello2222
  • 23,992
  • 12
  • 59
  • 94
3
votes
0 answers

iOS 14 UIMenu replacingChildren does not work

I want to add an UIMenu with conditional menu children to a UIButton's menu on iOS14, but the replacingChildren does not work. self.button.menu = UIMenu( options: .displayInline, children:[ UIAction(title:"Action 1"){_ in}, …
Des
  • 125
  • 2
  • 8
2
votes
1 answer

Modal dialogs breaking responder chain in mac catalyst scene based app

I have a multi-window scene-based (not SwiftUI) iPad app that I am adapting for Mac using mac catalyst. I am having trouble with the main menu behavior. The menu is built in AppDelegate.swift using func buildMenu(). I have, for example, an Open…
David Mann
  • 31
  • 2
2
votes
1 answer

iOS 14 present UIMenu from UIView

iOS 14's UIMenu seems to be able to be presented from any UIBarButtonItem or UIButton / UIControl, but I how would I present it from a generic UIView?
Joel Fischer
  • 6,351
  • 5
  • 33
  • 45
2
votes
2 answers

How to customize the "about App" menuitem

I've successfully ported my Chord calculus app to Mac Catalyst, with working key commands, context menus and multiple scenes. Can even screen capture the fretboard to the clipboard for developing tutorial content. Still working on saving it to a…
polymerchm
  • 164
  • 5
2
votes
0 answers

How can I use suggestedActions given from UIContextMenuConfiguration?

Other than the a WWDC video - 44:18 a sample project there's not much info online. So the actionProvider, when called, has a list of suggestedActions that are passed to it by the system. This can be a mix of UIMenus and UIActions, so potentially…
Honey
  • 24,125
  • 14
  • 123
  • 212
1
vote
1 answer

Can I make a UIMenu in Xamarin.iOS?

I develop in Xamarin.iOS. I would like to create a Pull-Down Menu, which I saw in the Apple Human Interface Guidelines. But I can not see it the official Microsoft documentation. Is implemented in Xamarin.iOS? If yes, how can I use it?
kistelekig
  • 155
  • 6
1
vote
0 answers

Swift UIMenu visual glitch when opening submenu

I am setting up context menus with UIMenu and UIAction. When pressing "Delete" I am showing a submenu with "confirm" and "cancel" functions. Everything works fine except one visual glitch that appears 70% of the time. The background of the context…
1
vote
0 answers

How can I modify a UIAction of a UIMenu attached to a navigation bar button?

I'm working on an app with a custom file browser, and currently I'm working on implementing copy/paste. I have a button in the navigation bar that I've attached a UIMenu to, to reveal options on adding files, including pasting. I want to have the…
JackMacWindows
  • 327
  • 3
  • 14
0
votes
0 answers

UIMenu title and icon appears backwards

I have issue with UIMenu in IOS. The menu appears in reverse, as the icon and title backwards and here is my code - (UIContextMenuConfiguration*) tableView : (UITableView*)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath*)indexPath…
0
votes
2 answers

UIMenu doesn't pop up

I'm trying to pop up a UIMenu once the user press the correct UIBarButton, but the problem is the UIMenu doesn't pop up and I don't know why, would be cool if you guys can help me with that. I also added the comment code to show you all the…
Aviav Sabag
  • 51
  • 1
  • 6
1
2