Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

- (void)pickerView:(AKPickerView *)pickerView willSelectItem:(NSInteg… #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AKPickerViewSample/AKPickerView/AKPickerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ typedef NS_ENUM(NSInteger, AKPickerViewStyle) {
@protocol AKPickerViewDelegate <UIScrollViewDelegate>
@optional
- (void)pickerView:(AKPickerView *)pickerView didSelectItem:(NSInteger)item;
- (void)pickerView:(AKPickerView *)pickerView willSelectItem:(NSInteger)item;
- (CGSize)pickerView:(AKPickerView *)pickerView marginForItem:(NSInteger)item;
- (void)pickerView:(AKPickerView *)pickerView configureLabel:(UILabel * const)label forItem:(NSInteger)item;
@end
Expand Down
3 changes: 3 additions & 0 deletions AKPickerViewSample/AKPickerView/AKPickerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UIColl

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if ([self.delegate respondsToSelector:@selector(pickerView:willSelectItem:)])
[self.delegate pickerView:self willSelectItem:indexPath.item];

[self selectItem:indexPath.item animated:YES];
}

Expand Down