I am a new in-app ios development. I am trying to get a UI like this: -
Here two types of tables are attached with one table view. This design in andriod.
I tried in IOS and take one table view with custom header and in the header I set another table view. Like this:-
And set code like this : -
override func viewWillLayoutSubviews() {
secondview?.frame.size = CGSize(width: tableViews.frame.width, height: secondtableViews.contentSize.height + 50 + tableViews.contentSize.height)
secondview.layer.masksToBounds = true
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == tableViews {
debugPrint(" first")
return 50
}else{
debugPrint(" second")
return 50
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == tableViews {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell")! as UITableViewCell
cell.textLabel?.text = "skdjfhkjfhjkshfkhsdkfhjsd"
return cell
}else{
let cell = tableView.dequeueReusableCell(withIdentifier: "gcell")! as UITableViewCell
cell.textLabel?.text = "skdjfhkjfh jkshfkhsdkfhjsd"
return cell
}
return UITableViewCell()
}
I change the height of main table view. It workes on some part height do not work according to the content of table view and the data of first table showing on second and second is showing on first. Can any one help me out from this design issue.


you should go with one tableview with TWO sections and TWO different type of cell...!