IDN Media Timotius Leonardo Lianoto Mar 24, 2025

Using Remote Config with Property Wrappers in Swift

Article Summary

Timotius Leonardo Lianoto from IDN Engineering just solved a problem most iOS teams don't even realize they have: Remote Config is quietly eating memory and creating testing nightmares.

After shipping his initial Remote Config helper, Timotius discovered critical issues: JSON parsing on every fetch consumed excessive memory, testing relied on fragile string literals, and manual dependency injection across hundreds of classes became unsustainable. His solution? A Swift property wrapper that caches values, enables real-time updates, and makes testing actually pleasant.

Key Takeaways

Critical Insight

The @FirebaseConfig property wrapper transforms Remote Config from a memory-hungry, test-hostile pattern into a cached, type-safe, self-updating system.

The article hints at an even cleaner approach using dependency injection property wrappers to eliminate mutable shared state entirely (coming in the next post).

About This Article

Problem

Timotius Leonardo Lianoto's Remote Config helper was allocating memory for JSON parsing every time data was retrieved. Larger JSON payloads used more memory, and injecting MockRemoteConfig() manually across 1,000+ classes became tedious and wasteful.

Solution

He built a @FirebaseConfig property wrapper that caches parsed values in a shared MediumRemoteConfig instance. This eliminated redundant JSON decoding and let him inject dependencies through a single RemoteConfigProtocol interface.

Impact

The property wrapper's wrappedValue logic now returns cached data on subsequent accesses without re-parsing. A setListenerToUpdatedConfig() function clears specific cache keys when Firebase sends updates, keeping everything in sync without wasting memory.