Reputation: 16375
I am new to iOS and exploring various facets of this. I am looking to create a UITableView
with each cell of the table view having a horizontal scrolling table view. I am new to iOS.
My custom class inheriting from UITableViewCell
will contain a UITableView
property. What next ?
I have dragged a TableView into the Prototype Cell of my Table View. This table view in my TableView cell will need to horizontal scrolling. I have created a IBOutlet
for the TableView in my class inheriting from UITableViewCell
. How can i tell that this class will be the UITableViewDelegate
,UITableViewDataSource
of this inner table view ?
Am I on the right path ? I am using storyboards and iOS 7
.
Upvotes: 1
Views: 689
Reputation: 130193
You simply specify that the UITableViewCell subclass conforms to the delegate/datasource protocols the same as you would if this was within a view controller. From there, you link the table's delegate/datasource properties to the cell.
However, I recommend you use the UICollectionView class for your horizontal sculling needs, it will make the entire process a lot less painful. My first point applies when using UICollectionView as well.
For example:
@interface MyCell : UITableViewCell <UICollectionViewDelegate, UICollectionViewDatasource>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@end
Upvotes: 1