I am trying to achieve the right to the iCarousel object from right to left on both sides.
So, I imported the GtiHub project into My application, assigned the UIView iCarousel ... Associated this with IBOutLet on my MainViewController and passed the delegate as well as the DataSource as a UITableViewController.
Although it will not appear, and I'm not sure what might cause this problem.
My iCarousel DataSource are NSMutableArray * elements; Designed like this:
for (int i = 0; i < 100; i++)
{
[_items addObject:@(i)];
}
I initialize iCarousel in ViewDidLoad as shown below
- (void)viewDidLoad
{
[super viewDidLoad];
_carousel = [[iCarousel alloc] init];
_carousel.delegate = self;
_carousel.dataSource = self;
for (int i = 0; i < 100; i++)
{
[_items addObject:@(i)];
}
_carousel.type = iCarouselTypeRotary;
}
My methods for carousel are below:
#pragma mark -
#pragma mark iCarousel methods
- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
return [_items count];
}
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
UILabel *label = nil;
if (view == nil)
{
view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200.0f, 200.0f)];
((UIImageView *)view).image = [UIImage imageNamed:@"page.png"];
view.contentMode = UIViewContentModeCenter;
label = [[UILabel alloc] initWithFrame:view.bounds];
label.backgroundColor = [UIColor clearColor];
label.font = [label.font fontWithSize:50];
label.tag = 1;
[view addSubview:label];
}
else
{
label = (UILabel *)[view viewWithTag:1];
}
label.text = [_items[index] stringValue];
return view;
}
- (CGFloat)carousel:(iCarousel *)carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value
{
switch (option)
{
case iCarouselOptionFadeMin:
return -0.2;
case iCarouselOptionFadeMax:
return 0.2;
case iCarouselOptionFadeRange:
return 2.0;
default:
return value;
}
}
Everything related to the storyboard seems to be related and the data should represent itself, what is wrong and how can I fix this problem?