Questions tagged [uimenucontroller]

The singleton UIMenuController instance presents the menu interface for the Cut, Copy, Paste, Select, Select All, and Delete commands. This menu is referred to as the editing menu. When you make this menu visible, UIMenuController positions it relative to a target rectangle on the screen; this rectangle usually defines a selection. The menu appears above the target rectangle or, if there is not enough space for it, below it.

The singleton UIMenuController instance presents an Editing Menu. You can create an instance like this

    UIMenuController *menuController = [UIMenuController sharedMenuController]; 

You can position it relative to a target rectangle on the screen which usually defines a selection.

An example implementation of UIMenuController (assuming you are coding for at least iOS 3.2 ()):

    UIMenuController *menuController = [UIMenuController sharedMenuController];
    UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"title" action:@selector(aMethod:)];
    UIMenuItem *menuItem1 = [[UIMenuItem alloc] initWithTitle:@"title" action:@selector(anotherMethod:)];
    [menuController setMenuItems:[NSArray arrayWithObjects:menuItem, menuItem1, nil]];
    [menuController setTargetRect:CGRectMake(location.x, location.y, 0, 0) inView: someView];
    [menuController setMenuVisible:YES animated:YES];
    menuController.arrowDirection= UIMenuControllerArrowLeft; 
    [resetMenuItem release];

References:

277 questions
0
votes
1 answer

UIMenuController showing wrong items

When i touch a label UIMenuController appears with my custom list of items, and that works well. But when UIMenuController appear in a standard UISearchBar i see all my custom items there too. Why? I need to show only standard (copy, paste) items…
Oleg Sobolev
  • 3,286
  • 2
  • 16
  • 29
0
votes
1 answer

keep UIMenuController visible while typing

I want to use the UIMenuController to display autofill options for a textfield based on data I already have in my app. The code to update the menu items and fill the textfield when one is selected works fine, but I can't seem to find a way to keep…
codemolly
  • 181
  • 6
0
votes
1 answer

UIMenuController tap and hold zoom bubble fails in landscape mode

Supporting iOS 7. (non-AutoLayout) Running iPhone 6 (iOS 8.1) The UIMenuController doesn't show in Landscape mode, in effect breaking the UI for my users. What's causing this to break?
Sebastian Dwornik
  • 2,526
  • 2
  • 34
  • 57
0
votes
1 answer

UIMenucontroller with uitextview on uitableviewcell

I have a UITextView inside my custom UITableViewCell. I am using UITextView basically for providing data detection on cell. I have my own custom UIMenuitems set for different cells. |-------------------------------| | …
Umang
  • 129
  • 1
  • 3
  • 9
0
votes
1 answer

UIMenuItem continuing to show up even after the pointer is set as nil

In the following code when i select a line, a delete menu shows up. Now after this when i start drawing a new line (leaving the delete menu as-is), the delete menu on top of the first one is supposed to disappear. Thats because while i'm starting…
rahulbsb
  • 115
  • 12
0
votes
1 answer

UimenuController-How to remove default menu items

how to remove defaults menu items like copy ,paste and select from UIMenuController
user3608500
  • 835
  • 4
  • 10
0
votes
3 answers

How to programmatically make text selectable and provide popup menus to go to another app

I am trying to implement a feature in iOS project that when you select a piece of text and highlight it you can then choose from the menu options to use another app like the default dictionary. Is it possible to do this? If so where can I find such…
newguy
  • 5,668
  • 12
  • 55
  • 95
0
votes
2 answers

How do Prevent a copy/paste/select popover on a UITextView using UIMenuController iOS5.1

The question: How do I prevent the copy/paste/select popup that occurs over a UITextView from appearing (not using UIwebView and css)? I did not want to go the rout of UIWebView as some posts have gone because I already am using UIViews with…
tony.stack
  • 780
  • 8
  • 21
0
votes
1 answer

How to deselect UITableViewCell after dismissing UIMenuController?

I've implemented a long press gesture recognizer on a table view cell that shows the UIMenuController and when menu shows, the corresponding table view cell is getting selected which is my requirement.But the problem is when I touches out…
Jeff
  • 1,405
  • 3
  • 26
  • 46
0
votes
1 answer

Showing custom UIView when UIMenuItem is clicked

So I've created a custom view which I want to be displayed at the bottom of the screen to when a UIMenuItem is clicked. I have in my ViewController.m : UIMenuController *menuController = [UIMenuController sharedMenuController]; UIMenuItem…
AJ9
  • 1,256
  • 1
  • 17
  • 28
0
votes
3 answers

How to get the tapped table view cell in custom action in UIMenuController

i am trying to use UIMenuController to perform a custom action on the table cell, from which the UIMenuController triggered by long time press. I registered UILongPressGestureRecognizer in the viewDidLoad method in my subclass of…
Hai
  • 74
  • 8
0
votes
1 answer

UIScrollView, UIMenuController, and LongPress Gesture

I have UIButtons added on the fly inside a UIScrollView and I also have a “LongPressGesture” attached to the button so when I tap the button for more than 1 second, a menu pops up (using UIMenuController). The problem is if I keep dragging my…
0
votes
1 answer

How can I detect that a user has tapped a formatting button in a UIMenuController?

My app allows users to format text in a UITextView by using some custom formatting buttons I've created. Now I want to enable the allowsEditingTextAttributes property of the text view so that users can copy and paste formatted text between text…
arlomedia
  • 8,534
  • 5
  • 60
  • 108
0
votes
1 answer

How to trigger UIMenuController in UIWebView on specific HTML element?

I have UIWebView in my application. Inside UIWebView I have some structured text. When user taps on some portion of that text it is being highlighted without being selected. That is I monitor touch events using JQuery and if user just taps the text…
kyurkchyan
  • 2,260
  • 2
  • 23
  • 37
0
votes
1 answer

[UIMenuController locationInView:]: unrecognized selector sent to instance 0x7f41ca0

When longpress on UIWebView I am displaying UIMenuController menuitem for click action. I have a note on UIMenuItem. When I click the note I need to store location coordinates to database. Before I used UILongPressGesture for storing coordinate…
user2967559
  • 97
  • 2
  • 13