How to bring a Table View Cell's content view above all other Table View subviews? - ios

Scenario -
I have a table view on which I have added custom views by tableView.addSubView(myView).
Now I have a certain cell whose contentView needs to be shown above tableView.
Methods Tried
I tried passing a tag on the cell's contentView and iterating on all table view's subView's. But that didn't help out.
How to move a cell's contentView above any other sub views of table view?

Related

Xcode UI Test cannot access multiple collection views inside a table view

I have a problem with accessing collection view cells inside a table view cell when using app.debugDescription during XCode UI Test runs.
First of all, XCUIApplication proxy do not see any collection views, but there are 4 of them, 2nd it does not see any cells other than the 4 cells of UITableView.
I have tried setting isAccessibilityIdentifier to false on these table view cells, but no use. If I set isAccessibilityIdentifier to true for each collection view, then I can see 4 collection views, but still no cells. I have put accessibilityIdentifier values to each cell in collection view and on elements inside a collection view, like UILabel and UIImageView.
If I set isAccessibilityIdentifier to true for collection view cells, then I can see accessibilityIdentifiers for each cell when printing out app.debugDescription, but as other element, not as of cell type.
Can anyone assist me here, here is my screenshot of view hierarchy in the storyboard.

Two self sizing view inside one table view cell

Good evening! I want to put one table view inside cell of another table view. And inside main table view cell self sized collection view and below should be another self sized table view. But XCode want to add height constraint to collection view above or to table view below. But I need to set "wrap content" to both of them. How to do it? Please help!

Scroll view can't perform delegate but table view can

I have a scroll view to show image and set inside tableview cell. Scroll view can’t perform scroll view delegate but table view can perform the scroll view delegate.
So, how can I perform delegate only scroll view?
When you scroll in scroll view the scroll view delegate will be called but the table view will get scrolled. You can not access only scroll view delegates inside table view.
If you add image to the scroll view, it will not scroll because you are actually scrolling the Cells and not the scroll view itself.
That's why, you need to add the image to a cell, not to the scroll view.
So in your table View delegate method where you are constructing your cells you should add the image view.

change position and layout of table view and table view cell for iOS app in Swift

I have created a table view controller with a table view cell for my iOS app with storyboard in Xcode 6. In the cell I have an image and a label. At the top of the view controller I want to have a header and at the bottom I have a tab bar. That's my setup.
But now I want to change the position and the layout of the table view and the inherit cells, default they cover the whole screen. The table view should start below the header and should end above the tab bar. At the moment the cell content is displayed under the headline and the tab bar. Is it possible to set the positions of the table view and/or cell? And also I want to change the layout of the cells. I want to have some space between two cells and a corner radius.
THX!
This is an old "problem". If you want to use a UITableViewController, the table view will cover the whole screen. In fact the UIViewController's view property will be the table view.
If you want to have a table view and other views on the screen, you will have to use UIViewController and add two subviews to it's view: the header and the table view.
Do the following (which the UITableViewController would have done for you):
add the table view as an ivar;
have the class conform to UITableViewDelegate and UITableViewDataSource and
set it to the table view's delegate and datasource

Nested table view in ios 6

I am creating nested table view. One table view for vertical scrolling. And another for horizontal scrolling inside the cell of first. I set the delegate of horizontal table view to vertical table view's cell subclass. But the problem is that the horizontal table view's delegate methods aren't calling.
Does any one have an idea why its not calling?
You have to make sure that you are setting the delegate programatically when configuring the cell that contains the second tableview.
Can you post some code...

Resources