Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4017532
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:52:21+00:00 2026-05-20T09:52:21+00:00

In continuation to my question asked here , i want to know if the

  • 0

In continuation to my question asked here, i want to know if the method to update the UI in viewDidScroll is correct. As i can observe the method is called many times and probably may be the reason why the ui become jittery and unresponsive.
How can i increase the responsiveness of the UI.
The code is as below:

BOOL isScrollingDown = verticalScrollView.contentOffset.y > _previousContentOffsetY;

_previousContentOffsetY = verticalScrollView.contentOffset.y;

CGFloat pageHeight = verticalScrollView.frame.size.height;

int scrollingToPageNum = isScrollingDown ? (ceil((verticalScrollView.contentOffset.y - pageHeight) / pageHeight) + 1) : (floor((verticalScrollView.contentOffset.y - pageHeight) / pageHeight) + 1);
int page = floor((verticalScrollView.contentOffset.y - pageHeight / 2) / pageHeight) + 1;

[self loadPage:(page-1)];
[self loadPage:(page)];
[self loadPage:(page+1)];

/* Unloading the pages not seen in the view is done here*/
if (!(isScrollingDown) && scrollingToPageNum >1) {
    [self unloadPages:page-2];
}else {
    [self unloadPages:page+2];
}

The lazy loading technique works fine and lot of memory usage is reduced due to it. However the UI is too slow. Also i want to know how to update the UI from a different thread which downloads image from a URL.

TIA,
Praveen

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:52:22+00:00Added an answer on May 20, 2026 at 9:52 am

    I’m not 100% sure about this so double-check. You have to update the screen in the main thread of the application if you using Apple’s classes like UIScrollView. However, you don’t need to download the images in the same thread. Read Apple’s Concurrency Guide and look at there sample program to figure out how.

    In addition it takes longer to draw images that are larger than they need to be. Don’t draw images with more pixel than there is space in the view. For super large images cut them apart so you only draw sections at a time, Apple has sample code for this. When you detect down time draw some images immediately around what’s being displayed to the user. So the user doesn’t see a loading symbol when scrolling around the view. There only so much the pre iPhone 3GS can handle with each iOS release the phone has gotten slower and slower, because it’s doing more stuff you have to manage speed versus fidelity on those phones, drawing a low fidelity image if the user to rapidly moving around then drawing a higher fidelity image if the user stops moving around.

    I’ll update this later if I have the time with some links, but those tips above are what worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In continuation with the question I asked, I want to know the list of
In continuation to my question asked here , i have created a test app
And my confusion with JSF continues. This is a continuation of a question asked
I guess this is a continuation of the last question I asked: bulk insert
This is a continuation of this question from yesterday . Here are my three
This is a continuation of the question here: JBoss - does app have to
This question is a continuation of my previous question here zend models architecture (big
my question is continuation of what i have asked see the link. Load Country/State/City
This question is in continuation to my previous question, in which I asked about
In a continuation from my question here I tried using the solution provided in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.