◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SDK 58 — Beta since 09/15 with no stable date yet; running projects in Expo Go has required login since 09/03●WIDGET — A write-up traces an iOS widget that renders black only in production builds●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SDK 58 — Beta since 09/15 with no stable date yet; running projects in Expo Go has required login since 09/03●WIDGET — A write-up traces an iOS widget that renders black only in production builds●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
Articles/App Dev
◇ App Dev/2026-05-30Intermediate

Killing Thumbnail Scroll Jank in an iOS Wallpaper App — Notes on ImageIO Downsampling

Lay out a lot of thumbnails and scrolling stutters while memory balloons. The culprit was full-size image decoding on the main thread. Here is how ImageIO downsampling and prefetching cut measured memory dramatically.

iOS116Swift48Performance25UICollectionViewImageIO

✦ Premium Article

Scrolling stalls the moment thumbnails appear

I have been building apps on my own since 2014, and my wallpaper apps have now passed 50 million downloads in total. When you run something for that long, early code inevitably survives in a corner somewhere. That is exactly where this problem was hiding.

On the thumbnail grid, once the image count passed a few dozen, scrolling visibly stuttered. The inertial scroll after lifting your finger snagged in small jerks, and on some devices it even triggered memory warnings. Measuring on a real device, simply opening the grid once pushed the app's memory use up to about 480MB. Wallpapers are large by nature, so I expected some cost — but not that much just to show thumbnails. Something was clearly wrong.

The cause was full-size decoding on the main thread

Tracing the code, two problems were stacked on top of each other.

The first was decoding images synchronously inside cellForItemAt. UIImage(contentsOfFile:) looks lightweight, but the actual expansion into pixels (decoding) happens at draw time. So every time scrolling surfaced a new cell, a heavy decode ran on the main thread. That was the direct cause of the dropped frames.

The second was loading full-size images even though these were thumbnails. The display area was maybe 200 points per side, yet the original images — several thousand pixels across — were being expanded into memory in full. A decoded bitmap costs roughly "width × height × 4 bytes," so holding several large ones balloons into hundreds of megabytes fast. That was the source of the memory growth.

Official samples lean on UIImage(named:) and contentsOfFile: constantly, but in a grid that handles many images at once, this approach falls apart. You have to shrink to the size you actually need at the moment you load.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Why decoding synchronously inside cellForItemAt chokes scrolling, explained alongside memory
✦The actual downsampling code using CGImageSourceCreateThumbnailAtIndex and what each option means
✦The full setup I run in production: prefetching, NSCache, and cancellation on cell reuse
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◇ App Dev2026-10-15
When adjustsFontSizeToFit Shrinks Just One Row, Suspect the Box Height, Not the String
Only the 10th row of a list drops to 4pt on iOS, though the data and strings are fine. I read the Yoga rounding and font-fit sources, then counted how often the box comes up short in Node.
◇ App Dev2026-04-26
Native iOS Apps with Rork: SwiftUI to TestFlight
New iPhone projects in Rork are generated in Swift and SwiftUI, and Rork Pro carries them all the way to the App Store. How to tell an old Expo project from a new one, costs in credits, the skeleton prompt, device testing, when to drop into Xcode, and TestFlight submission.
⬡ Dev Tools2026-05-01
Adding a Notification Service Extension to a Rork App — Rich Push, Encrypted Payloads, and Dynamic Rewriting
Wiring a Notification Service Extension into a Rork-built iOS app — image attachments, end-to-end encrypted payloads, and dynamic APNs payload rewriting — with working Swift code and the production pitfalls that bit me along the way.