◉RORK LABJP
●ARCHIVE — Since 11/22 you can archive a Rork project instead of deleting it, and bring it back from Archived●PLAY FIX — Fixed: Expo apps built for Google Play losing their Rork AI key, which broke AI features●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 7 days left. Check which model your app calls●SPLASH — Expo users report apps stuck on the splash screen after rolling back to an earlier update●NEW — New: Three clues to check before replying to a "stuck on the splash screen" review●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 8 days left●ARCHIVE — Since 11/22 you can archive a Rork project instead of deleting it, and bring it back from Archived●PLAY FIX — Fixed: Expo apps built for Google Play losing their Rork AI key, which broke AI features●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 7 days left. Check which model your app calls●SPLASH — Expo users report apps stuck on the splash screen after rolling back to an earlier update●NEW — New: Three clues to check before replying to a "stuck on the splash screen" review●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 8 days left
Articles/Dev Tools
⬡ Dev Tools/2026-06-24Advanced

Quietly Dialing Back Heavy Work When the Device Gets Hot or Enters Low Power Mode

How to watch ProcessInfo's thermalState and Low Power Mode and degrade heavy work in stages when the device is hot or the battery is low, with working Swift code.

Rork Max236SwiftUI66Performance25BatteryOn-Device AI6

✦ Premium Article

After I added an on-device AI feature to an app I have maintained for years as an indie developer, reviews started arriving a few days post-release: "the phone gets hot while I use it," "the battery drains fast." It never reproduced on my test device, and the cause eluded me for a while. What I eventually realized was that my testing always happened in the best possible conditions — a cool room and a full charge.

Real users open the app outdoors in summer, or on a crowded commuter train with the battery in single digits. There, iOS itself has already started capping the CPU and GPU, and my app, by trying to run heavy work at full tilt, was making the heat and the battery drain worse. The app needed to read the device's state and back off on its own.

This article walks through monitoring the two states that ProcessInfo exposes — the thermal stage (thermalState) and Low Power Mode (isLowPowerModeEnabled) — and degrading heavy work in stages, in a form you can drop straight into the native Swift that Rork Max generates.

Treat heat and low power as separate signals

The first thing to settle is that these two have different causes and different remedies. Collapse them into one flag and you will make the wrong call.

Thermal state represents the device physically heating up while the OS starts throttling. It has four stages — .nominal, .fair, .serious, .critical — and from .serious onward the OS throttles aggressively. If the app keeps running heavy work there, the felt experience collapses quickly.

Low Power Mode is a setting the user chooses, or the system enables automatically as charge drops, to conserve battery. It happens independently of heat. Here, remedies that cut power directly — holding off on background refresh, lowering network frequency — are what work.

So heat calls for "make what is running right now lighter," while low power calls for "do less from here on." Answering each from a different drawer is the design that fits.

Monitor thermalState and define stages

ProcessInfo lets you read the current thermal stage synchronously and also posts a notification when it changes. Receive that notification in one place and convert it into state the whole app can read.

import Foundation
import Combine
 
@MainActor
final class DeviceConditionMonitor: ObservableObject {
    @Published private(set) var thermalState: ProcessInfo.ThermalState
    @Published private(set) var isLowPower: Bool
 
    init() {
        let info = ProcessInfo.processInfo
        thermalState = info.thermalState
        isLowPower = info.isLowPowerModeEnabled
 
        NotificationCenter.default.addObserver(
            self, selector: #selector(thermalChanged),
            name: ProcessInfo.thermalStateDidChangeNotification, object: nil)
 
        NotificationCenter.default.addObserver(
            self, selector: #selector(powerChanged),
            name: .NSProcessInfoPowerStateDidChange, object: nil)
    }
 
    @objc private func thermalChanged() {
        let next = ProcessInfo.processInfo.thermalState
        Task { @MainActor in self.thermalState = next }
    }
 
    @objc private func powerChanged() {
        let next = ProcessInfo.processInfo.isLowPowerModeEnabled
        Task { @MainActor in self.isLowPower = next }
    }
}

The notifications can arrive on any thread, so I re-receive them on @MainActor to stay consistent with UI state updates. If the code Rork Max generated does not already subscribe to these notifications, start by placing this single monitor — every later decision can then funnel through it.

✦

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
✦You can monitor ProcessInfo's thermalState and isLowPowerModeEnabled to wind down expensive work in stages as the device heats up or saves power
✦You'll fold animations, background refresh, and on-device inference into a single quality tier, so you soften the experience instead of breaking features
✦You'll learn how to protect battery and thermals without inconveniencing the user, for an app that holds up over the long run
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

⬡ Dev Tools2026-07-18
The Generated Screen That Quietly Jams at AX5 and in German — Putting Layout Resilience Checks on Rork Max SwiftUI
A record of running every Rork Max generated SwiftUI screen through pseudolocalization and the largest text size to find exactly where it jams. Covers when to reach for ViewThatFits, ScaledMetric and layoutPriority, plus the snapshot checks that catch regressions every time you regenerate.
⬡ Dev Tools2026-05-17
Reading Rork Max's SwiftUI Generation Through a Wallpaper App's Requirements — What to Trust, What to Fix, What to Write by Hand
Typical wallpaper-app requirements — grid, pinch-zoom, slideshow, photo-library permission, ads, in-app purchase — handed to Rork Max's SwiftUI generation: where the output tends to hold up and where it tends to break. For the memory failure that bites first, this note includes decode-time downsampling, a bounded cache, and a procedure for measuring on your own device.
⬡ Dev Tools2026-05-12
Building a Shared UI Component Library with Swift Package Manager in Rork Max
A practical guide to building a shared SwiftUI component library with Swift Package Manager for indie developers running multiple apps — eliminate duplicate code across wallpaper, healing, and similar app families.