-
-
Notifications
You must be signed in to change notification settings - Fork 76
IQActionSheetPickerView 2.0.0 Migration Guide
IQActionSheetPickerView 2.0.0 is the major release. To keep this library clean and less painful, 2.0.0 come with newer API's to handle indexes selection in more easy way.
This guide is provided in order to ease the transition of existing applications using lower version then 2.0.0, as well as explain the design and structure of new and changed functionality.
-
selectedTitles
has been changed withselectedIndexes
.selectedTitles
were accepting Array of Strings, butselectedIndexes
accept Array of NSNumber(Index).selectedIndexes
will provide indexes of all selected rows.
If you were doing something like this:-
pickerView.selectedTitles = @[@"5", @"PM"];
Then please replace this like this:-
pickerView.selectedIndexes = @[@(4), @(1)];
-
didSelectTitles:
delegate method is replaced bydidSelectTitlesAtIndexes:
. If you are using this delegate method:-
- (void)actionSheetPickerView:(nonnull IQActionSheetPickerView *)pickerView didSelectTitles:(nonnull NSArray<NSString*>*)titles
Then please replace by this:-
- (void)actionSheetPickerView:(nonnull IQActionSheetPickerView *)pickerView didSelectTitlesAtIndexes:(nonnull NSArray<NSNumber*>*)indexes
- These methods were replaced/renamed
Old methods:-
-(void)setSelectedTitles:(nonnull NSArray<NSString*> *)selectedTitles animated:(BOOL)animated;
-(void)setSelectedTitles:(nonnull NSArray<NSString*> *)selectedTitles animated:(BOOL)animated;
New method:-
-(void)setSelectedIndexes:(nonnull NSArray<NSNumber*> *)selectedIndexes animated:(BOOL)animated;
-
toolbarTintColor
,toolbarButtonColor
,cancelButtonAttributes
,doneButtonAttributes
, properties has been moved to IQActionSheetToolbar class and you can access toolbar object usingpickerView.actionToolbar
-
titleFont
,titleColor
has been moved to IQActionSheetTitleBarButtonItem class and you can access it usingpickerView.actionToolbar.titleButton
.
- These methods have been added to select an specific row in component
-(void)selectRowAtIndexPath:(nonnull NSIndexPath*)indexPath;
-(void)selectRowAtIndexPath:(nonnull NSIndexPath*)indexPath animated:(BOOL)animated;