RORK LABJP
FUNDING — Rork raised a $15M seed led by Left Lane Capital, with Peak XV, True Ventures, Goodwater, and a16z Speedrun joiningENGINE — Rork Max runs on Claude Code and Claude Opus 4.6; it drew 8M+ views on X and doubled annual revenue in two weeksSWIFT — Rork Max is the first web-based Swift app builder, positioned to replace Apple's traditional XcodePRODUCT — Rork Max covers the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageCLASSIC — The original Rork uses React Native (Expo), building iOS/Android apps from a plain-English descriptionPRICING — Start free; paid plans begin at $25/mo, and Rork Max is $200/moFUNDING — Rork raised a $15M seed led by Left Lane Capital, with Peak XV, True Ventures, Goodwater, and a16z Speedrun joiningENGINE — Rork Max runs on Claude Code and Claude Opus 4.6; it drew 8M+ views on X and doubled annual revenue in two weeksSWIFT — Rork Max is the first web-based Swift app builder, positioned to replace Apple's traditional XcodePRODUCT — Rork Max covers the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageCLASSIC — The original Rork uses React Native (Expo), building iOS/Android apps from a plain-English descriptionPRICING — Start free; paid plans begin at $25/mo, and Rork Max is $200/mo
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 Max184SwiftUI53Performance18BatteryOn-Device AI4

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-05-10
Adding Swift Charts to a Rork Max App: Setup, and Why It Stutters Past a Few Hundred Points
How to drop Swift Charts into the SwiftUI code Rork Max generates, where the framework starts choking once your dataset grows past a thousand points, and the downsampling and animation patterns that keep things at 60 fps on real devices.
Dev Tools2026-06-24
Audio Apps That Survive Calls, Unplugged Headphones, and Other Apps Taking Over
How to handle AVAudioSession interruption and route-change notifications correctly so playback survives calls and headphone unplugs, with working Swift code.
Dev Tools2026-06-19
Trimming App Size for Rork Max Apps: App Thinning and On-Demand Resources
Rork Max ships images and fonts straight into the bundle, so a generated SwiftUI app quietly grows heavy. Here is how I use App Thinning and On-Demand Resources to shrink the first download, with the device numbers I measured and a size budget you can run.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →