YCXMenuItem.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // YCXMenuItem.h
  3. // YCXMenuDemo_ObjC
  4. //
  5. // Created by 牛萌 on 15/5/6.
  6. // Copyright (c) 2015年 NiuMeng. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. @interface YCXMenuItem : NSObject
  11. @property (readwrite, nonatomic, strong) UIImage *image;
  12. @property (readwrite, nonatomic, strong) NSString *title;
  13. @property (readwrite, nonatomic, assign) NSInteger tag;
  14. @property (readwrite, nonatomic, strong) NSDictionary *userInfo;
  15. @property (nonatomic, copy) NSString *imageUrl;///<网络图片Url, 如果不为空, 则需要根据这个参数判断, 不根据image去进行界面布局判断
  16. @property (readwrite, nonatomic, strong) UIFont *titleFont;
  17. @property (readwrite, nonatomic) NSTextAlignment alignment;
  18. @property (readwrite, nonatomic, strong) UIColor *foreColor;
  19. @property (readwrite, nonatomic, weak) id target;
  20. @property (readwrite, nonatomic) SEL action;
  21. @property (nonatomic, assign) BOOL showBadge;
  22. + (instancetype)menuTitle:(NSString *)title WithIcon:(UIImage *)icon;
  23. + (instancetype)menuItem:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag userInfo:(NSDictionary *)userInfo;
  24. + (instancetype)menuItem:(NSString *)title image:(UIImage *)image target:(id)target action:(SEL)action;
  25. + (instancetype)menuItme:(NSString *)title ImageUrl:(NSString *)imageUrl target:(id)target action:(SEL)action;///<网络图片兼容模式, 兼容老版本
  26. /// 构造方法(新增)
  27. /// @param title 标题
  28. /// @param image 图片
  29. /// @param target 事件接收者
  30. /// @param action 事件
  31. /// @param userInfo 传参
  32. + (instancetype)menuItem:(NSString *)title image:(UIImage *)image target:(id)target action:(SEL)action userInfo:(NSDictionary *)userInfo;
  33. - (void)performAction;
  34. - (BOOL)enabled;
  35. @end