8

Is it possible to configure that my iCarousel carousel will scroll the items with infinite loops?

I haven't found something like that and I need it,

Thanks for helping!

Yhper
  • 183
  • 2
  • 14

2 Answers2

15

Yup, this is easy to do in iCarousel:

- (CGFloat)carousel:(iCarousel *)carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value {
    switch (option) {
        case iCarouselOptionWrap:
            return YES;
    }

    return value;
}
TwoStraws
  • 12,862
  • 3
  • 57
  • 71
  • I apologise – you're absolutely correct! I'll update my answer momentarily. – TwoStraws Dec 17 '15 at 19:42
  • That's works now but I'm getting this issue message: `enumeration values not handled in switch: 'iCarouselOptionShowBackfaces', 'iCarouselOptionOffsetMultiplier', 'iCarouselOptionVisibleItems'...` – Yhper Dec 17 '15 at 19:49
  • You can add a `default` case that returns `value` if you want. – TwoStraws Dec 17 '15 at 19:50
12

If you are looking for solution in swift:

func carousel(carousel: iCarousel, valueForOption option: iCarouselOption, withDefault value: CGFloat) -> CGFloat
{
    switch (option)
    {
    case .Wrap:
        return 1

    default:
        return value
    }
}
Narendra Ojha
  • 673
  • 8
  • 18