Skip to content

Commit

Permalink
Merge pull request #8 from NextFaze/feature/7
Browse files Browse the repository at this point in the history
Button area have no response when the views in "stack" status
  • Loading branch information
ricsantos committed Dec 2, 2014
2 parents b9a55c2 + f8a87fd commit 32e8028
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion WKPagesScrollView/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,25 @@ -(void)dealloc{
[super dealloc];
}
-(IBAction)onButtonTitle:(id)sender{
NSLog(@"button");
UIView *thisButton = (UIView *)sender;
if (!_collectionView.isHighLight) {
NSArray* visibleIndexPaths=[_collectionView indexPathsForVisibleItems];
for (NSIndexPath* indexPath in visibleIndexPaths) {
WKPagesCollectionViewCell* cell = (WKPagesCollectionViewCell *)[_collectionView cellForItemAtIndexPath:indexPath];

BOOL doesContain = [cell.cellContentView.subviews containsObject:thisButton];
if (doesContain ) {
[(WKPagesCollectionView*)_collectionView showCellToHighLightAtIndexPath:indexPath completion:^(BOOL finished) {
NSLog(@"highlight completed");
}];
break;
}
}
} else {
[_collectionView dismissFromHightLightWithCompletion:^(BOOL finished) {
NSLog(@"dismiss completed");
}];
}
}
-(IBAction)onButtonAdd:(id)sender{
[_collectionView appendItem];
Expand Down

0 comments on commit 32e8028

Please sign in to comment.