UITableView with right/left swipable cells perform slow and struck?

35 views Asked by At

I need to list set of products in swipe(slide functionality) based on different category, I have used table view to do this, Table view cell count will be number of categories and Single category products in single cell with swipe, center part needs to load based on products in slide(you can check attachment) by clicking left/right arrows or swipe.

Please check below code(added in custom cell implementation file), We believe , struck is due to again and again load of xib. Please suggest some good solution to do this slide functionality inside tableview cell other than using xib or any other suggestion on reuse xib , how to do that?

int xOffset = 0;
self.scrollView.contentSize = CGSizeMake(scrollWidth * noOfImages, scrollHeight);
for(int index=0; index < articleDetails.count; index++) {
    UIView *menuOverlay = [[UIView alloc]initWithFrame:CGRectMake(xOffset, 0, scrollWidth, self.scrollView.frame.size.height)];
    menuOverlay.backgroundColor = [UIColor clearColor];

    SampleXIBView *xibView = [[[NSBundle mainBundle]loadNibNamed:@"SampleXIBView" owner:self options:nil]objectAtIndex:0];
   xibView.frame = CGRectMake(35 , 0, scrollWidth-70, scrollHeight);

    [menuOverlay xibView];

    [self.scrollView addSubview:menuOverlay];
    xOffset += scrollWidth;
}

Please check layout here

Thanks in Advance.

0

There are 0 answers