UIMenuController

单例类

  • (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 *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)