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

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.

Related

How to create 2 steps expandable tableview Swift

There is a main table view and inside each of the main table view cell has their own header table view. Then each of the header table view cell has their own sub-header table view. All the table rows don't have fixed counts according to the dynamic data. What I try to achieve is when a cell of the main table view is expanded, I should see the header table view cells unexpanded. After a header table view cell is expended, I should see the sub-header table view. I need a solution without using libraries.
I provided the storyboard UI based on what I want to achieve.
To deal with expandable cells (or cells inside cells effect) I recommend using UIStackView inside UITableViewCell and add inside needed views with data.
For example you can create UIView inside Xib file and load it inside needed UITableViewCell then add to UIStackView and fill with data.
Then you can simply hide/unhide elements inside UIStackView to archive expanding/unxpanding.
This way or other you should use 1 UITableView.
I once made a 1 step expandable Table View.
Here is what I did to achieve that.
Do not make different table views for each hierarchy. That will be difficult to manage. Instead, make one table view but change the type of cell you want to show. If the cell is top level cell or first level cell or the second level cell, change the design of each one that.
The data source will then have list of list of list to denote the 2 level expandable UITableView.
To open and close the table view, you can simply change the data source and reload or use beginUpdates and endUpdates

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!

Passing data in Collection View Cell

I have 1 colleection view with 4 cells which scrolls horizontal just like old youtube ios app. Under these 4 cells, each cell has custom collection view cell with 4 rows scrolls vertically. Under these rows there are customized collection view which scroll horizontally like netflix app with customized collection view cell. How do i pass data from these inner cells to a view controller with naviagation controller. No storyboard are been used. I can not push view controller from collection view cell. Also protocols are not working from inner cells. Any alternative?

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

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?

TableView Controller in Collection View Cell

Problem: I want the user to be able to slide through various tableviews, that will appear in collection view cells. But these tableviews require their own controllers since they will be dynamically sized with different prototype cells. How does one go about doing this in swift 2?
My Failed Approach: Make a storyboard with the tableview controller set up as a scene and then try to instatiate it in code as the collection view cell. I am making the collection view programmatically.

Resources