SwipeView is a class designed to simplify the implementation of horizontal, paged scrolling views on iOS. It is based on a UIScrollView, but adds convenient functionality such as a UITableView-style dataSource/delegate interface for loading views dynamically, and efficient view loading, unloading and recycling.
When i click arrowdown button in view (index 0) call function pressedButton: but self.SWdescriptionView animation in view(index1),view(index2) (not current)
(UIView )swipeView:(SwipeView )swipeView viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view
{
//load new item view instance from nib
//control events are bound to view controller in nib file
//note that it is only safe to use the reusingView if we return the same nib for each
//item view, if different items have different contents, ignore the reusingView value
Example error
When i click arrowdown button in view (index 0) call function pressedButton: but self.SWdescriptionView animation in view(index1),view(index2) (not current)
Before click arrowdown
After click arrowdown
//configure swipe view _followView.alignment = SwipeViewAlignmentEdge; _followView.pagingEnabled = NO; _followView.itemsPerPage = 1; _followView.truncateFinalPage = YES; _followView.defersItemViewLoading = NO;
(IBAction)pressedButton:(id)sender { NSLog(@"%ld",(long)[_followView indexOfItemViewOrSubview:sender]);
[UIView animateWithDuration:0.5 delay:0 options: UIViewAnimationCurveEaseOut animations:^{
[RFRotate rotate180:self.SWbtArrowUpDown withDuration:0.5];
}
(UIView )swipeView:(SwipeView )swipeView viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view { //load new item view instance from nib //control events are bound to view controller in nib file //note that it is only safe to use the reusingView if we return the same nib for each //item view, if different items have different contents, ignore the reusingView value
view = [[NSBundle mainBundle] loadNibNamed:@"customFollowView" owner:self options:nil][0]; [view setFrame:CGRectMake(0, 0, 300, 170)];
[self.contentView setClipsToBounds:YES];
recommendDataModel *data = _feedRecommend.data[(NSUInteger)index];
NSString *imgUrl = [NSString stringWithFormat:@"http://cms.tvbento.com/uploads/contents/%@/thumb.jpg",data.content_id];
// NSString imgUrl = [NSString stringWithFormat:@"http://cms.tvbento.com/uploads/contents/%@/2x_%@",data.content_id,data.content_cover_program]; NSURL url = [NSURL URLWithString:imgUrl];
}
Please advice for fix issue