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

Append custom UIMenuItems at the beginning of UIMenuController iOS

I have implemented a custom UIMenuController with two aditional options besides the ones that are set by default in iOS (cut, copy, look up, share). I want to keep these standard options, but I want them to appear after my two custom items, does…
Marilyn García
  • 105
  • 1
  • 13
0
votes
0 answers

Swift - Facebook chat bubbles: UITextView enable selection of the whole text view at one go, yet enable data detection

Here's what I want to do: Similar to Facebook's chat bubbles: Tap on the whole chat cell, to bring up a UIMenuController displaying custom menu items (For now, just one copyAll item) Preserve data detection and allow pressing on times, links, etc.…
leonardloo
  • 1,753
  • 3
  • 20
  • 31
0
votes
2 answers

How to use More menucontroller in View controller

Can Anyone help me, i'm having problem with UIMenucontroller.In here, i have to use two menucontroller in single viewcontroller. For First menu only "paste",for other menu "copy","select","select all" When i'm using shared menucontroller it affects…
0
votes
1 answer

Customize UIMuenuitem title

I am using the table to display a list of members and when I click a cell in the table I am creating some custom menu items and showing the menu by customizing the cellview class. Now we have total 6 menu items and some of them are long in length,…
0
votes
1 answer

There can only be one UIMenuController instance

I got There can only be one UIMenuController. runtime error when I customized two different menu controller.I need this,how to fix it?Codes in Swift is better. Thanks in advance!
Lumialxk
  • 6,239
  • 6
  • 24
  • 47
0
votes
1 answer

UITableviewController not showing Menu on touch

Please have a look at my code and suggest corrections or any kind of code alterations I need to do in order to get menu displayed on selected table row. Please help, I'm new to iOS. import UIKit class CutomerHomeTab: UITableViewController…
Anand Yadav
  • 479
  • 5
  • 17
0
votes
0 answers

how to make duplicate of message and forward it to different user?

I'm new to iOS, and I'm making a simple chat application. But I have a problem in that I don't know how to make a duplicate of a message and send that message to different user. When I select a message then select the forward button I want to create…
Sourav Mishra
  • 501
  • 4
  • 21
0
votes
1 answer

canPerformAction:with sender method called on tap in ios 9

one thing I observed in iOS 9.0 is that when I tap on button or TableView, canPerformMethod:withSender: method is called with sender as UIButton type. I am using this method to prepare my customized option menu. I did not observed that in previous…
pratik03
  • 651
  • 2
  • 7
  • 23
0
votes
0 answers

UIMenuController's canPerformAction method called on button tap

I have a message view in which user can see conversation and type & send message. Menu (kind of context menu) is displayed when user long taps on message. I have used TableView and Button for chat history and send message button respectively. My…
pratik03
  • 651
  • 2
  • 7
  • 23
0
votes
1 answer

Is it possible to Rotate/Affine Transform UIMenuController

Without going into the 'why' of it all, I have UITextField that is part of a view hierarchy that is forcibly 'upside down' on screen via an affine transform. CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(180)) This works fine for all of the…
quaid
  • 38
  • 1
  • 3
0
votes
1 answer

makeKeyAndVisible for secondary screen stops UIMenuController from appearing

I present a UIMenuController over a view to display a copy and paste menu popup. This works great, but recently I added external screen functionality to my app. When I present a view and add it to the external screen I call ... [extWindow…
davbryn
  • 7,156
  • 2
  • 24
  • 47
0
votes
2 answers

Why isn't my UIMenuController shown in my view?

I can't figure out why my UIMenuController doesn't show up in my view. When I long-press the button, I can see that all instructions are executed, but menu is not shown. public class MySingleArticleView : UIView { private MyArticleViewController…
0
votes
1 answer

Hide keyboard when UIMenuViewController is shown

When i show UIMenuViewController on a UITextFiled, keyboard also pops up. Wondering if there is a way to hide the keyboard when UIMenuViewController is visible. I use the below code to show the menu. NSArray *buttons = items; …
Chirag Jain
  • 2,378
  • 3
  • 21
  • 22
0
votes
0 answers

UIMenuController Has Zero Frame

I really went through every other question on SO related to this topic. But none helped me so far. I am trying to show a UIMenuController on a UIView. I therefore subclassed the UIView and implemented all the required methods already. In the…
Hasib Samad
  • 1,081
  • 1
  • 20
  • 39
0
votes
1 answer

change the title of default Copy in UIMenuController

In the UIMenuController there is a default Copy action, I want to change its title to be in another language (Arabic Language). Any help? Thanks in advance.
Emy Alsabbagh
  • 287
  • 1
  • 3
  • 8