Skip to content

IQActionSheetPickerView 2.0.0 Migration Guide

Mohd Iftekhar Qurashi edited this page Mar 17, 2018 · 1 revision

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.

Modified API's

  1. selectedTitles has been changed with selectedIndexes. selectedTitles were accepting Array of Strings, but selectedIndexes 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)];
  1. didSelectTitles: delegate method is replaced by didSelectTitlesAtIndexes:. 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
  1. 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;
  1. toolbarTintColor, toolbarButtonColor, cancelButtonAttributes, doneButtonAttributes, properties has been moved to IQActionSheetToolbar class and you can access toolbar object using pickerView.actionToolbar

  2. titleFont, titleColor has been moved to IQActionSheetTitleBarButtonItem class and you can access it using pickerView.actionToolbar.titleButton.

New API's

  1. 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;
Clone this wiki locally