xcode - Swift- Set Visible menucontroller -


I'm trying to display UimenuController but I can not see it. How can i do

  Give to the menu controller: UIMenuController = UIMenuController.sharedMenuController () menu controller. Menu = Useful = True MenuController.arrowDirection = UIMenuControllerArrowDirection.Down MenuController.setTargetRect (CGRectMake (100, 80, 50, 50), keeping in mind: self.view) Know MenuItem_1: UIMenuItem = UIMenuItem (Title: "Menu", Action: " Delete: ") MenuItems do: NSArray = [Delete] MenuController.menuItems = MenuItems    

To actually display the menu, you need to do the following:

  1. Before calling getFirstResponder () you get your sharedMenuController
  2. call menu.setMenuVisible ( True, animated: true) finally
  3. c anBecomeFirstResponder override override function canPerformAction function

    Write the function for the selector here is an example

      someFunc () {beFirstResponder () Menu menu.menuItems = [deleteItem] menu.setTargetRect (CGRectMake (100, 80, 50, and so on): menu item (select "deleteLine" 50), keeping in mind: menu.setMenuVisible (True Animated: True)} function deleteLine () {// Here are some overrides function canBecomeFirstResponder () -> Bull {Return True} Overcoded Fun Canopperfectation (Action: Selector, Sender Sender: An Object?) - & gt; Bool {// You only need to return true for the actions you need, otherwise you can get the full range of // iOS if you can remove the statement here only. If the action == selector ("deleteline") returns {return true} return false}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -