Software & Data
When App Configuration Balloons: Lessons from LINE's AttributedString Architecture
Ever feel like changing one small setting forces you to touch a dozen files? LINE shared a similar story on 16 September 2026 and how they reorganised their setup.

Picture this: you're getting an app release ready. One feature should only be active in certain regions during the holiday season. You don't want to ship a whole new version just for that. So how do you turn a feature on or off without pushing an update?
That's the question dynamic configuration systems try to answer. LINE has one called Service Configuration. Operators can change values in an admin panel, and the server tells the app. The app asks for the latest values, and the server sends them based on region, device, and OS version. Values come through as a string-to-string dictionary. For example, "1280,70" means a maximum image resolution of 1280 x 1280 pixels with a compression ratio of 0.7.
On 16 September 2026, LINE shared how they rebuilt their iOS configuration system using an approach inspired by AttributedString. Their write-up covered the old problems and the new solution. This article won't dive deep into their technical details; instead, it sums up lessons you can apply to your own projects.
When One File Balloons to 7,000 Lines
At first, all configuration keys were declared in one big file. As the number of keys grew, that file swelled to 7,000 lines. Every module had to add its keys there, even if those keys were only used by that module. As a result, a small change could ripple across many parts of the codebase.
Another issue surfaced: values were sent as raw strings. The photo module, for instance, had to parse the string "1280,70" every time it needed to use that value. If a custom type were declared in the configuration module, other modules that shouldn't care would see it anyway. If it were declared in the photo module, the configuration module couldn't return it because it would then depend on the photo module. This is the classic circular dependency dilemma.
Three Confusing Defaults
There was also a decoding problem. The server sent Boolean values as the strings "Y" and "N". Standard Swift methods don't recognise that format, so a custom method was needed. Unfortunately, that custom method looked similar to the standard one, making it easy to mix up. As a result, mistakes slipped through code reviews.
On top of that, developers had to write default values in three places, each serving a slightly different purpose. Yet there was no real need to distinguish them. This made onboarding new team members trickier, as they had to memorise rules that weren't actually necessary.
Hidden Dangers: Concurrency and Test Doubles
The old system didn't account for concurrency. Decoding happened lazily, old instances were discarded whenever new values arrived, and some services read from different threads. This led to use-after-free errors that caused hundreds of crashes every day. Clearly, this hurt app stability.
Another problem: each module created its own test double because LineConfigurationManager was a singleton. Dozens of protocols and test doubles were scattered around, each needing updates as configuration keys changed. Since they were in separate compilation targets, mistakes only surfaced during CI builds after a pull request. The quality of test doubles varied too, so bugs could appear only in production or only in tests.
Learning from AttributedString
LINE looked for a proven design. Their needs: type-safe access to many key-value pairs, the ability for each module to define its own keys, and safety in a concurrent environment. They found that AttributedString in Foundation met those requirements. AttributedString is a type for text where each range can have attributes like font, colour, or link. It manages many attributes in a type-safe way and lets frameworks like UIKit, AppKit, and SwiftUI define their own attributes.
The type structure they used involves four things. First, AttributedStringKey, a protocol that defines a single attribute with a name and value type. Second, AttributeScope, a protocol that groups related keys. Third, AttributeDynamicLookup, an empty enum that acts as a routing target for dynamic member lookup. Fourth, AttributeContainer, a value type that stores the actual values and supports safe read-write. The key point: the subscript containing a fatalError is never called at runtime. Once the compiler extracts type information from the key path, the role of AttributeDynamicLookup is done. This enables type-level routing without runtime cost.
This approach solves many problems: it's type-safe, keys can be defined in their own modules, and concurrency is better controlled. LINE also added an override feature for QA, so testers can temporarily change configuration values without modifying code.
Is your current configuration system type-safe and ready for team growth? If not, maybe it's time to review its architecture.
Facing something similar in your business?
Let’s talk about it