Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making infinite loop using iCarousel

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!

like image 880
Yhper Avatar asked Dec 17 '15 18:12

Yhper


2 Answers

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;
}
like image 149
TwoStraws Avatar answered Oct 31 '22 11:10

TwoStraws


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
    }
}
like image 24
Narendra Ojha Avatar answered Oct 31 '22 10:10

Narendra Ojha