Adding a dynamic custom UIMenuItem to Copy & Paste Menu before it shows

前端 未结 2 2001
滥情空心
滥情空心 2021-02-10 17:02

I have successfully been able to add a custom UIMenuItem to the Copy & Paste menu in my iPhone app, and even subclassed UITextView to get r

2条回答
  •  醉话见心
    2021-02-10 17:23

    If the question is still relevant then you could use the UIMenuControllerWillShowMenuNotification or the UIMenuControllerDidShowMenuNotification notification.
    See the documentation here.

    Code sample:

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willShowMenu:) name:UIMenuControllerWillShowMenuNotification object:nil];
    

提交回复
热议问题