How MEGA engineered its iOS design tokens module

<h1>Introduction</h1> <p>Here at MEGA, in order to build a consistent UI experience throughout all of our products on different platforms (Android, desktop, iOS, and our websites) it became clear that we needed to create a robust, consistent, and sustainable design system for our codebase.</p> <p>With that goal in mind, we&rsquo;ve decided to adopt an approach where design tokens (the basic building block of any design system: colours, radius, spacing, etc.) are defined in&nbsp;<code>JSON</code>&nbsp;specs given by the design team, in a way they can be used in a platform-agnostic manner.</p> <p>In this article, we&rsquo;ll deep dive into how we built&nbsp;<code><a href="https://github.com/meganz/MEGADesignToken" rel="noopener ugc nofollow" target="_blank">MEGADesignToken</a></code>&nbsp;- the Swift Package Manager (SPM) module responsible for creating and exposing&nbsp;<code>Swift</code>&nbsp;code based on those files, tackling topics such as: SPM Build Tool plugins, parsing strategies, data modeling, algorithms and code generation through&nbsp;<code>SwiftSyntax</code>.</p> <p><a href="https://medium.com/@mega-blog/how-mega-engineered-its-ios-design-tokens-module-8c299b866df7"><strong>Learn More</strong></a></p>
Tags: Tokens module