Before we move into the main purpose of the question, KASlideShow is a library on github. I am using this library for showing a slide show of images. After many searches on to how to implement a custom cell, I found the following: Is it possible to add UITableView within a UITableViewCell. Here is the code that i am using:
#import "HomeTableViewController.h"
#import "KASlideShow.h"
#import "CustomTableViewCell.h"
@interface HomeTableViewController ()
@property (strong,nonatomic) IBOutlet KASlideShow * slideshow;
@end
@implementation HomeTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"SlideShowCell"];
if(cell == nil)
{
cell = [[CustomTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SlideShowCell"];
}
[_slideshow setDelay:5]; // Delay between transitions
[_slideshow setTransitionDuration:5]; // Transition duration
[_slideshow setTransitionType:KASlideShowTransitionFade]; // Choose a transition type (fade or slide)
[_slideshow setImagesContentMode:UIViewContentModeScaleAspectFill]; // Choose a content mode for images to display
[_slideshow addImagesFromResources:@[@"adidas.jpg",@"adidas_neo.jpeg"]]; // Add images from resources
[_slideshow addGesture:KASlideShowGestureTap]; // Gesture to go previous/next directly on the image
[_slideshow start];
return cell;
}
@end
#import <UIKit/UIKit.h>
#import "KASlideShow.h"
@interface CustomTableViewCell : UITableViewCell
@property (nonatomic) IBOutlet KASlideShow *slideshow;
#import "CustomTableViewCell.h"
#import "KASlideShow.h"
@implementation CustomTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
@end
@end
KASlideShow never appears inside the UITableViewCell
I know there is something wrong but i am not able to know where it is to fix it.