UIMenuController

作者: 絮语时光杨 | 来源:发表于2018-05-14 13:40 被阅读1次

    单例类

    • (UIMenuController *)sharedMenuController;

    @property(nonatomic,getter=isMenuVisible) BOOL menuVisible; // default is NO
    //是否通过动画进行设置显示、隐藏

    • (void)setMenuVisible:(BOOL)menuVisible animated:(BOOL)animated;

    /**

    • 设置menu显示的位置信息
    • @param targetRect menu需要显示的矩形区域
    • @param targetView targetRect会以targetView的左上角为坐标原点进行显示
      */
    • (void)setTargetRect:(CGRect)targetRect inView:(UIView *)targetView;

    @property(nonatomic, copy) NSArray <UIMenuItem *> *menuItems

    @interface UIMenuItem : NSObject
    //创建UIMenuItem对象

    • (instancetype)initWithTitle:(NSString *)title action:(SEL)action ;
      @property(nonatomic,copy) NSString *title;
      @property(nonatomic) SEL action;

    • (void)cut:(nullable id)sender NS_AVAILABLE_IOS(3_0);

    • (void)copy:(nullable id)sender NS_AVAILABLE_IOS(3_0);

    • (void)paste:(nullable id)sender NS_AVAILABLE_IOS(3_0);

    • (void)select:(nullable id)sender NS_AVAILABLE_IOS(3_0);

    • (void)selectAll:(nullable id)sender NS_AVAILABLE_IOS(3_0);

    • (void)delete:(nullable id)sender NS_AVAILABLE_IOS(3_2);

    • (void)makeTextWritingDirectionLeftToRight:(nullable id)sender NS_AVAILABLE_IOS(5_0);

    • (void)makeTextWritingDirectionRightToLeft:(nullable id)sender NS_AVAILABLE_IOS(5_0);

    相关文章

      网友评论

        本文标题:UIMenuController

        本文链接:https://www.haomeiwen.com/subject/hsnddftx.html