/** * add a normal action * * @param title title * @param eventBlock event */ - (void)addButtonTitle:(NSString*)title eventBlock:(EventBlock)eventBlock;
/** * add a destructive action * * @param title title * @param eventBlock event */ - (void)addDestructiveButtonTitle:(NSString*)title eventBlock:(EventBlock)eventBlock;
/** * add a cancel action * * @param title title * @param eventBlock event */ - (void)addCancelButtonTitle:(NSString*)title eventBlock:(EventBlock)eventBlock;
/** * show actionsheet with title * * @param title title */ - (void)showWithTitle:(NSString*)title;
e.g. Add 4 actions: include one destructive action, two normal actions, and one cancel action
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
SCActionSheetWrap *aWrap = [[SCActionSheetWrap alloc] init]; [aWrap addDestructiveButtonTitle:@"Reset text" eventBlock:^(id anything) { [SVProgressHUD showSuccessWithStatus:@"Reset text"]; }]; [aWrap addButtonTitle:@"change text to \"Merry\"" eventBlock:^(id anything) { [SVProgressHUD showSuccessWithStatus:@"Merry"]; }]; [aWrap addButtonTitle:@"change text to \"Christmas\"" eventBlock:^(id anything) { [SVProgressHUD showSuccessWithStatus:@"Christmas"]; }]; [aWrap addCancelButtonTitle:@"Cancel" eventBlock:^(id anything) { [SVProgressHUD showSuccessWithStatus:@"if you did not add the cancel action, the wrap will auto add the cancel action."]; }]; [aWrap showWithTitle:@"Please Choose"]; self.asWrap = aWrap;
/** * for multi select photos * * @param anything anything */ typedef void(^PickMultiImagesBlock)(id anything);
/** * the delegate of the imagePickerController */ @property (nonatomic, unsafe_unretained) id<UINavigationControllerDelegate,UIImagePickerControllerDelegate, UIActionSheetDelegate> parent;
/** * if set to YES, will show a square crop. Default is NO. */ @property (nonatomic, assign) BOOL allowsEditing;
/** * if you want to select multi photos, call this method to present a controller for user to multi select photos */ @property (nonatomic, copy) PickMultiImagesBlock pickMultiImagesBlock;
/** * init * * @param parent the delegate of the imagePickerController * * @return self */ - (id)initWithParent:(id)parent;
/** * if you want to select multi photos, call this method to present a controller for user to multi select photos * * @param block present a controller for multi select photos */ - (void)buildPickMultiPhotosBlock:(PickMultiImagesBlock)block;
/** * show system camera and album,will show three actions: camera, local album and cancel */ - (void)showMenuWithSystemCameraAndAlbum;
/** * show imagePicker with UIImagePickerControllerSourceType * * @param sourceTye UIImagePickerControllerSourceType */ - (void)showImagePicker:(UIImagePickerControllerSourceType)sourceTye;
e.g. Add 3 actions: include one camera action, one local album action, and one cancel action
/** * add a normal action * * @param title title * @param eventBlock event */ - (void)addButtonTitle:(NSString*)title eventBlock:(EventBlock)eventBlock;
/** * add a cancel action * * @param title title * @param eventBlock event */ - (void)addCancelButtonTitle:(NSString*)title eventBlock:(EventBlock)eventBlock;
/** * add a destructive action (for iOS8) * * @param title title * @param eventBlock event */ - (void)addDestructiveButtonTitle:(NSString*)title eventBlock:(EventBlock)eventBlock;
/** * show the alert * * @param style style * @param title title * @param messag message */ - (void)showWithStyle:(UIAlertViewStyle)style title:(NSString*)title message:(NSString*)message;
/** * show the alert for iOS8 * * @param title title * @param message message */ - (void)showForiOS8WithTitle:(NSString*)title message:(NSString*)message;
e.g. Add one Sure button, and one Cancel button. For iOS7: show a random UIAlertType. For iOS8: add a username textField, a password textField and a destructive button