YHActionSheet.h 958 B

123456789101112131415161718192021222324252627
  1. //
  2. // YHActionSheet.h
  3. // github: https://github.com/samuelandkevin
  4. //
  5. // Created by samuelandkevin on 16/4/28.
  6. // Copyright © 2016年 HKP. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. /**
  10. * 操作回调,如果用户点击空白处,不选中任何button,则 clickedIndex = NSNotFound, isCancel = YES
  11. * clickedIndex 从0开始, cancelButton是最后一个, titleButton不能点击
  12. */
  13. typedef void(^YHSheetCompletionHanlde)(NSInteger clickedIndex, BOOL isCancel);
  14. @interface YHActionSheet : UIView
  15. @property (nullable, nonatomic, copy) NSString *cancelTitle;//
  16. @property (nullable, nonatomic, copy) NSArray *otherTitles;
  17. @property (copy,nonatomic,nonnull)YHSheetCompletionHanlde handle;
  18. - (nonnull instancetype)initWithCancelTitle:(nonnull NSString*)cancelTitle otherTitles:(nonnull NSArray *)otherTitles;
  19. - (void)show;
  20. - (void)dismissForCompletionHandle:(nullable YHSheetCompletionHanlde)handle;
  21. @end