App freezes while trying to scroll to bottom ios tableview - ios

I need to scroll to bottom in tableview with many rows without freeze.
I have talbeview with infinity scroll (when user scrolls down, app makes request and fetches new part of data). When i'm trying to scroll to bottom by settig table's content offset or by scrollToRow, app freezes and i see cpu usage 100%, and ram up to 100mb (in normal state it is only 10mb).
I guess this is because of cell rendering. I was trying to set async rendering, or rendering with queue, but nothing.
This problem is seems like Scrolling bottom in tableview and performance but there is no answer.

Related

Difficult scrolling

Using Xcode 10.1
I have a tableview inside a scrollview. Even though the table is larger than the scrollview and there are filled cells in those rows, it's very difficult to get the scroll to work in the simulator.
After multiple attempts using the mouse to scroll the table, I get a very thin scroll indicator that works (meaning I am able to scroll to bottom of table) intermittently. I need to keep playing with the table to get it to come back again. I also tried adjusting the inset but that just moves it from the edge, still razor thin.
Any ideas where I can look to solve?

Is there any way to check smooth scroll in UITests

I created an UI test that load thousands of entries in a tableview. I use the next code to scroll the table view:
let table = app.tables.element
table.swipeUp()
table.swipeUp()
table.swipeUp()
Is there any way to check if the scoll is smooth?
There is no way to test if scrolling of a table view is smooth with a UITest.
XCTest offers performance tests but they are meant for UnitTests only. You can test how performant your code is but not your UI.
You can use Instruments to monitor the frame rate in you app. Launch the app with Instruments and scroll your table view. If the frame rate drops significantly you have a performance bottleneck.
BTW the scrolling performance of a UITableView should not be different for 10 cells or 10000 cells, because the cells are reused.

Is react-native animation jittery on frequent updates of redux state?

My list view presents a stack of cards that is scrolled horizontally. At most, three cards are visible in the view with the outer most cards on the left and right fading in and out as a function of the user scrolling horizontally.
I calculate which cards are suppose to fade-in/out as the user scrolls utilizing the internal list view API to check and continually update redux state as a result.
The problem is the scrolling animation experience is inconsistent. It jitters when I scroll sometimes and other times it is smooth. Sometimes the fade in out functionality bugs out or updates a few seconds later after a scroll. What gives?
Is jittery animation normally expected when the redux state is updated frequently?

UITableview Does Not Scroll Up

I am having some scrolling issues with my tableview.
Swiping/panning upwards, the tableview scrolls down.
Swiping/panning down does not work, the tableview stays rigid.
Swiping/panning upwards, and then quickly swiping downwards works
(scrolls up).
Does anyone have any idea why something like this may happen?
Each cell has an image, and a couple of buttons.
I am using SDWebImage, and this issues occurs even once the images are downloaded and cached.
The imageviews' userInteractionEnabled are set to YES, so that should not be a problem either.
I noticed that scrolling, in general, did not work at the top 70% of my screen.
So only when swiping down past the 70% threshold, would the app detect scrolling, hence it would scroll down.
This was because I was using a Dropdown Menu that I found on GitHub (it covered the top 70% of the screen when it was open), that unfortunately interfered with the scrolling, even when hidden.
So basically, for anyone who has the same problem in the future, check for interfering views, that may be affecting the scrolling performance. Especially look for views and other elements from external code/libraries.
If this is not the case, check UIGestureRecognizers as suggested by #RandyJames and #liuyadong in the comments above.

ios scrolling over a large uiview memory problems

I'm making a music app that displays musical notation. Currently the notation is in a very large view that extends horizontally until the music ends. Obviously this isn't a good solution because I quickly run out of memory when display large scores of music.
My question is how I can implement my view such that the view where I do my drawing is only the size of the screen, but the content gets scrolled across it (The view is contained in a scrollview)? I imagine I could just only draw stuff on the screen and redraw the view as it gets scrolled with different x coordinates, but this seems ugly and would be pretty slow.
Thanks for any suggestions. : )
There are a number of solutions around. Usually these involve drawing one-or-two screen widths past the edges, then scrolling as needed, and drawing again into the area that was previously visible. In essence, using the scroll-view as a circular buffer.
Try a Google search for UIScrollView infinite scroll.
Also, see Infinite horizontal scrolling UIScrollView.

Resources