UICollectionView list of visible cells wrong under VoiceOver mode - ios

I have a vertically scrolling UICollectionView.
Nested into this list is another horizontally paging UICollectonView, which takes up the whole width of the screen.
On top of it I layered a UIPageControl element to show num of pages / current page and so on.
I am updating the page control index in the UICollectionViews willDisplay cell: UICollectionViewCell delegate.
It all works perfectly well until however I turn on the Voice Over mode in the phone settings.
The pagination still works without problems using the right gestures (three finger swipe), but the PageControl does not show the correct current page. Its most of the time off by +1. But when skimming a bit through the list there can appear all kinds of strange current page indices (off by 2 or 3)
What is interesting: The screenreader internally knows the right index. Because it reads it before entering a new page. But I don't know where it got this information and how to read out.
I tried to find out what is going on and found, that the UICollectionViews visible cells array is not maintained correctly. Instead of containing the real cell on screen it contains the next cell that is upcoming.
Is there anything I can do about it. Is seems to be a system issue as it is working in non voice over mode. I was wondering that I couldn't find anything related to this topic already on the web.

Related

Swipe to delete on entire section in UITableView

I have a UITableView which has a variable amount of sections and every section has a variable amount of rows. Every section contains a section header, a section footer and the rows for that section. They are shown and displayed inside a container. Everything up until now works as expected. To demonstrate what my UITableView currently looks like:
I am now trying to implement the possibility to swipe left on the entire section, so that the header of the section, the rows inside this section and the footer of this section move to the left and display another UIView. I am capable of swiping the cells separately, but enabling this feature on the entire sections have caused headaches for the past two days. This is what I would like to achieve:
I have thought about implementing UIGestureRecognizers but I am afraid they might conflict with my UITableView. Also, I started implementing it, but I would not know how to move solely the section on which was swiped to the left.
Then I thought I could maybe implement a UIScrollView as container for each section. How I would accomplish this is still a mystery to me, but it seems like a possible solution if this could be done.
Furthermore I am out of ideas and stuck on how this should be done. It's something I have not found on the Internet so far - at least no working examples of some kind so I have zero inspiration on how to achieve the effect.
I therefor would like to ask if somebody has an idea of how this could work and what I have to keep in mind when implementing this. Every clue pointing me towards a working solution is gratefully appreciated!
EDIT: I have already seen the possible duplicate this afternoon. However, the suggestion there shows touchesBegan() on the header, which does not work in my case as I need the entire section to be "draggable".
I think one way you can implement this is with a vertical stackview containing views that contains a tableview and the trash icon. When a user swipes left on the tableview header, it will show the hidden trash icon in the view. I would think that each tableview only has one section so it will be easier to keep track of which "section" the user has swiped.
I have currently managed to arrange a similar solution. I take the rectangle of the section with rect(forSection:int), add a UIPanGestureRecognizer in which I add a UIView on top of the UITableView if touches began, I calculate the location of the finger and let the cudtom UIView follow. When a certain point (100 from left edge of the UITableView) is reached, the section gets removed with deleteSections(indexSet:with:).
This works. It does the job, but it adds an overlay to the section rather than pushing it to the left.
Therefor I am asking of someone knows if there is any way of setting the offset for one specific section or for an area of a UIView, so I can offset the rectangle of the section. I have been able to setContentOffset on the entire UITableView but this is not the desired result.
If there is no way to do this, I would consider keeping the solution I have now or maybe implement a snapshot feature which takes a screenshot and crops the rect of the frame, adding this UIImage to the custom view to simulate the section. But that would be tricky. Any ideas for this idea are also welcome.

WatchKit – Two tables in two pages, second page has first couple of rows super-narrow

I have the following setup in my WatchKit app:
Two horizontal pages, which are configured programmatically via reloadRootControllersWithNames:contexts:
Each page contains a WKInterfaceTable which loads some separate data.
What I’m noticing is that the second page’s table has its content pushed down so that the first row in the right table is positioned somewhere in-between the second and third rows of the left table.
If I load a single table and a single page, everything is fine with either set of content, this issue only occurs when I have two pages, and both pages have a table – the second page has its table positioned low.
Both pages are using the same WKInterfaceController and pretty much identical logic (they’re just loading two sets of data), so I’m not sure why this might be happening.
It’s also worth noting that if I set up the two pages inside the storyboard and link them by dragging and using the “next page” segue, the problem still happens, so it’s not being caused by using reload.
This image shows mid-pan between the left and right page, and shows the gap on the right one (and that weird red stripe occurs twice, and my gut is telling me that it’s setting the width of my first two rows to like, 1 pixel or something).
Any idea what’s going on here?
I had the same problem. I was doing the table config in AwakeWithContent(). When I moved it to WillAppear() it worked fine. I think the problem is that as you are swiping to the scene it is trying to position the table.
WillAppear() seems to occur once the scene has slid in.

What type of view is the Twitter profile on iOS? UITableView?

Is the twitter profile view in iOS just ONE very dynamic table view? What's in the header and what's in the cells? I've just started developing for iOS and I'm trying to look at the big players and identify what they use and how they use it.
I've made a similar view, but it's a view comprised of carefully placed subviews, and I'm wondering if something like this would be a better route.
If it is a UITableView, how do they have such dynamic cells with different spacing between them etc? I know you can vary cell sizes, layouts, and insets, but to this degree, in one tableview?
Please don't jump me with downvotes for asking a non-technical question only twitter devs know for sure, I'm just really curious and don't know where else to ask. I'm only looking for a professional opinion.
It looks like it could be a very dynamic UITableView to me. Or at least, it could probably be recreated as a UITableView if it isn't already.
I'm looking at a twitter profile page now, and I would say there's probably 5 sections:
Header (everything from the profile picture to the "follow" button)
Recent Tweets (including the "view more" button)
Photos
"Special" items (Following, Followers, Favorites and Lists)
Who to Follow
The only component of this view that strikes me as particularly unique and special is the banner image that blurs and zooms when you pull down too far. I'm not quite sure how they pulled that off. It's possible that they track the offset of the scroll view, and if the offset is positive (i.e. it was pulled down), then zoom and blur the banner (and use the offset value as a scaling factor somehow).
All the other components could be probably be recreated by (carefully) designing custom UITableViewCells for each unique purpose (e.g. tweets, image carousel, other profiles), and then populating those cells with data from the tweet or profile.

UITableView with large static cells doesn't scroll to where it should

So I have a unique iOS project (read as clients accepted a design before I started working here and the design contains checkboxes, dropdowns, tabular data (rows+columns,etc.) which requires a long tableview which contains 3 sections, the sections themselves vary from 50-700pt.
It appears this wasn't something Apple took into account as the table view does not scroll properly to all cells, specifically, when the keyboard is not yet open and I click on a textfield at the bottom of a long section it scrolls to entirely the wrong section.
I'm curious if there is something obvious I'm missing, I've tried using the library TPKeyboardAvoiding to no avail, it sounds very promising but also doesn't handle my situation.
I'd prefer to stick with a table view instead of a scrollview as I've already built out and handled headers, certain events, etc.
ALSO, after reading other posts it may be pertinent that I'm in landscape mode only on iPads and this tableview + controller is inside a container controller so it's size is fixed at 984x543

UITableView tableHeaderView user interaction not working

I'm using a table view with a very large header view (not section header) in order to take advantage of the various advantages of table views (performance on long lists, pull to refresh, etc).
The header is ~700 points tall and contains various interactive items - a map, two buttons & a horizontal collection view.
Currently, none of the touch events are being passed through to the controls. I have tried building my own UITableView subclass, overriding the touch events & sending them to the next responder, but this doesn't help.
Strangely, the table still scrolls fine, so I'm not sure why that's happening. I have confirmed that the events are firing through debugging.
As extra details - I'm using iOS 7, Xcode 5, autolayout is on & I'm using a lot of constraints. None of them are listed as conflicting though.
Any idea how I should resolve this?
Thanks
Okay, so I managed to get this working & to be honest it's difficult to tell exactly what it was I did which fixed the issue.
Basically, I had wrapped all my controls inside a main view in order to be able to apply a total height constraint to it. That view did have user interaction enabled, but it seems like it wasn't passing the events through for some reason.
In any case, I removed that wrapping view & everything is now working.
shrug
I actually embedded all my header.xib controls into a View. After that, I was able to click on the buttons.

Resources