Reputation: 4580
I have a table view. I want to add some features so when user click on a cell another view opens and show details about that cell. I am trying to follow this part of video to add uiview:
But when I drag and drop it myself, it returns back and is not adding to tableview. Here is my storyboard.
Upvotes: 2
Views: 1217
Reputation: 4329
I see your attached image and as per that i think you have use UITableViewController which has mainview is UITableView.
But the video you are trying to follow , in that they have take a UIViewController which has mainview is "UIView". in that they have have drag an drop UITableview. And then they have added a another UIView in "mainview which is "UIVIEW" " not UITableview.
If you want to learn how to sue UITableview in UIViewController, there here is the tutorial link :
http://www.appcoda.com/ios-programming-tutorial-create-a-simple-table-view-app/
If you follow this steps then also you will be able to create the same tableview which you have currently developed. And then you try to add a view to MAINVIEW. it will allow you to add it.
Upvotes: 3
Reputation: 4047
You shouldn't be adding UIViews to UITableView. The content that UITableView displays should be cells returned by the relevant methods of UITableViewDataSource and UITableViewDelegate.
Specifically for your case, in the YouTube tutorial you referred to, the UIView is dragged on top on the UITableView, and not inside the UITableView. So the parent view isn't the table view, is the View Controller's main view.
Try that and continue with the tutorial to get to the table view's content - the cells. Good Luck!
Upvotes: 1