Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5812] iOS: Support UIMenuController

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-02-16T15:30:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.2.0
ComponentsiOS
Labelsios, menupopup, notable, qe-5.2.0
ReporterSindre Sorhus
AssigneeHans Knöchel
Created2011-10-19T10:52:21.000+0000
Updated2016-02-19T19:08:31.000+0000

Description

!http://i.stack.imgur.com/yQKL4.png! Would be a useful feature to have. Already need it for so much. This is something that should be built-in.

Comments

  1. Jeevan Takhar 2011-10-24

    Here is the documentation for it: http://developer.apple.com/library/IOS/#documentation/iPhone/Reference/UIMenuController_Class/UIMenuController.html
  2. Ivan Mathy 2011-10-24

    This would be an awesome feature. It's one of the latest feature that is not yet in Ti...
  3. Matej 2014-03-02

    Still nothing?
  4. Ingo Muschenetz 2014-03-02

    Try this: https://github.com/alexshive/TiPopup
  5. Hans Knöchel 2015-11-06

    PR pending: https://github.com/appcelerator/titanium_mobile/pull/7408 Demo:
       var win = Ti.UI.createWindow({
         backgroundColor: "#fff",
       });
       
       var btn = Ti.UI.createButton({
         title: "Show menu"
       });
       
       win.add(btn);
       
       var menu = Ti.UI.iOS.createMenuPopup({
         items: ["Hello", "World"]
       });
       
       menu.addEventListener("click", function(e) {
         alert(e);
       });
       
       btn.addEventListener("click", function() {
         menu.show({
           view: btn
         });
       });
       
       setTimeout(function(){
       	Ti.API.warn("hide");
       	menu.hide();
       },5000);
       
       setInterval(function() {
       	Ti.API.warn("isVisible? " + menu.isVisible());
       },1000)
       
       win.open();
       
  6. Chee Kiat Ng 2015-11-11

    Approved! PR merged.
  7. Harry Bryant 2016-01-19

    Tested new feature and verified as working correctly. Investigated methods & properties are functioning correctly. Compatible with iOS8 & iOS9. iPhone 6s Plus Device (9.2) & iPhone 6 Plus Device (8.4) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.2.0.v20160114021251 Appc NPM: 4.2.2 App CLI: 5.2.0-220 Xcode 7.2 Node v4.2.3 *Closing ticket.*
  8. Fokke Zandbergen 2016-02-16

    [~hansknoechel] nice addition. Just wondering; why did you call it MenuPopup? Why not just Menu since the iOS API doesn't mention popup? It [does say](https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Reference/UIMenuController_Class/index.html) "This menu is referred to as the editing menu" so it could be EditingMenu perhaps.
  9. Fokke Zandbergen 2016-02-16

    [~hansknoechel] The hide() method doesn't work. Please see the [sample](https://github.com/appcelerator-developer-relations/appc-sample-ti520/blob/master/app/controllers/menupopup.js#L63) where I call hide() after a time out. It does not hide. Instead, it freezes and tapping anywhere else no longer hides it as well.
  10. Hans Knöchel 2016-02-16

    Updated to run methods on main thread (same thing like with the LivePhoto): PR (master): https://github.com/appcelerator/titanium_mobile/pull/7735 PR (5_2_X) https://github.com/appcelerator/titanium_mobile/pull/7736
  11. Chee Kiat Ng 2016-02-16

    CR and FT passed. PRs merged.
  12. Harry Bryant 2016-02-19

    Verified as fixed, I was able to reproduce the issue as stated by [~fokkezb] using sdk version 5.2.0.v20160208101502. Using the latest build, The issue is no longer reproducible, the hide method does no longer freezes the app, and correctly hides the menu after a timeout period. Tested on: iPhone 6S device (9.2) & iPhone 6Plus (8.2) Mac OSX El Capitan 10.11.3 (15D21) Ti SDK: 5.2.0.v20160216202526 Appc Studio: 4.5.0.201602170821 Appc NPM: 4.2.3-2 App CLI: 5.2.0-269 Xcode 7.2 Node v4.2.6 production *Closing ticket.*

JSON Source