<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Valerii Nikolaev on Medium]]></title>
        <description><![CDATA[Stories by Valerii Nikolaev on Medium]]></description>
        <link>https://medium.com/@valnikodeveloper?source=rss-e0a31c4c1aad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_4Qwmktn9hm1faPBNq2kPQ.jpeg</url>
            <title>Stories by Valerii Nikolaev on Medium</title>
            <link>https://medium.com/@valnikodeveloper?source=rss-e0a31c4c1aad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:56:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@valnikodeveloper/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Monetization Model — How to Change from Paid to Freemium on iOS — Using AppTransaction, No…]]></title>
            <link>https://medium.com/@valnikodeveloper/apptransaction-how-i-moved-my-ios-app-from-paid-to-freemium-and-passed-app-review-in-under-an-hour-f82225769732?source=rss-e0a31c4c1aad------2</link>
            <guid isPermaLink="false">https://medium.com/p/f82225769732</guid>
            <category><![CDATA[indie-app-development]]></category>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[storekit]]></category>
            <category><![CDATA[ios-development]]></category>
            <dc:creator><![CDATA[Valerii Nikolaev]]></dc:creator>
            <pubDate>Sat, 02 May 2026 09:06:04 GMT</pubDate>
            <atom:updated>2026-07-16T02:11:50.505Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Monetization Model — How to Change from Paid to Freemium on iOS — Using AppTransaction, No Third-Party Libraries &amp; Smooth App Review</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyY-oHbJUkcJNB5PHEEeFA.png" /></figure><p>I decided to move my app, <strong>RepChime (formerly FitReps)</strong>, from a paid model to freemium.</p><p>The main goal was simple: improve install conversion. It is much easier for a user to download an app for free, try it, and only then decide whether Pro is worth it.</p><p>At the same time, I did not want to break access for existing users. If someone had already paid for the app, they should not suddenly see a paywall after an update for features they had already paid for.</p><p>At first, some people suggested different workarounds, including third-party libraries. But I am not a big fan of making an app grow without a clear reason. So I started looking for a native Apple solution and found <a href="https://developer.apple.com/documentation/storekit/apptransaction">AppTransaction</a>.</p><p>Apple’s idea looks reasonable: the app has a signed app transaction, and you can read `<a href="https://developer.apple.com/documentation/storekit/apptransaction/originalappversion">originalAppVersion</a>`, the version or build where the user first got the app.</p><p>At the first step, the code looked roughly like this:</p><pre>import StoreKit<br><br>func checkLegacyAccess() async {<br>    do {<br>        let result = try await AppTransaction.shared<br><br>        switch result {<br>        case .verified(let appTransaction):<br>            let originalVersion = appTransaction.originalAppVersion<br>            let environment = appTransaction.environment<br><br>            print(&quot;Original version:&quot;, originalVersion)<br>            print(&quot;Environment:&quot;, environment)<br><br>        case .unverified(_, let error):<br>            print(&quot;Unverified AppTransaction:&quot;, error.localizedDescription)<br>        }<br>    } catch {<br>        print(&quot;AppTransaction failed:&quot;, error.localizedDescription)<br>    }<br>}</pre><blockquote>The business rule seemed simple:</blockquote><pre>if the user bought the app before the freemium transition:<br> unlock Legacy Pro<br>else:<br> show freemium and paywall</pre><p>And then StoreKit greeted me with my first surprise: `Unable to Complete Request`. 😳</p><h3>1. Unable to Complete Request</h3><p>I reread the documentation several times, rewatched the <a href="https://developer.apple.com/videos/play/wwdc2022/10007/">WWDC session</a>, and tried to implement it.</p><p>In practice, I immediately got this error:</p><pre>Unable to Complete Request</pre><p>It happened when calling `<a href="https://developer.apple.com/documentation/storekit/apptransaction/shared">AppTransaction.shared</a>`, and my `catch` block was catching it with painful consistency.</p><p>My first thought was: maybe I am calling this API incorrectly. Which, to be fair, was probably true in some way.</p><p>So I tried to verify the behavior outside of a local Xcode run. I uploaded the build to TestFlight, installed it on a device, and tested the same flow again.</p><p>And the result was the same.</p><pre>Unable to Complete Request</pre><p>At that point, things became much less clear. If the issue happened both in Xcode and TestFlight, I could not confidently say, “This is only a local testing problem.”</p><p>I searched the documentation, watched the WWDC material again, looked through the internet, and even tried using LLM deep research to find similar cases. But I still could not find a clear explanation for why this error was happening.</p><p>At that point, I did not want to take the risk. If I shipped this logic to production and it failed for old paid users, I could break access for people who had already paid.</p><p>So I stepped away from the idea for a while.</p><p>To be honest, I even started thinking that maybe I should just keep the app paid forever, because there seemed to be no safe way out. It was frustrating. I had a clear business reason to move to freemium, but I did not want to do it by breaking trust with existing users.</p><h3>2. The Second Attempt</h3><p>For a while, I went back to improving the app itself and tried to convince myself that maybe I could make it attractive enough that people would still download it despite the upfront price.</p><p>But the idea did not leave me alone. Maybe because I like things to work optimally, including the monetization of my own app.</p><p>If Apple introduced this mechanism specifically to support business model changes, then it should work. So I returned to the problem, but more carefully. In one of the upcoming versions, I decided to add a separate Purchases section where a user could tap a row and see the current `AppTransaction` data directly on the device: current build, original version, environment, and status.</p><p>No hidden taps, no hidden feature flags, no analytics sending anything somewhere in the background. The idea was simple and transparent: the user taps a visible row and sees their own transaction information locally.</p><p>My hypothesis was simple: maybe I was getting `Unable to Complete Request` because the environment I was testing in was not production. Maybe the API itself was fine, but my testing setup was not close enough to the real App Store environment.</p><p>Before shipping that version to production, I decided to test the flow through TestFlight one more time.</p><p>And I was very surprised.</p><p>In the next TestFlight build, when I tapped the row that called `AppTransaction`, instead of the familiar `Unable to Complete Request`, I saw a valid transaction and the app version.</p><p>This time, it was the good kind of surprise. 😮</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qbFgpiK29s3HrZpLPwfZjg.png" /></figure><p>Example: AppTransaction finally returned an original version.</p><p>For the first time, it felt like the whole migration might actually work. I finally had a real signal from StoreKit, and it gave me hope that the rest of the transition could go smoothly too.</p><p>After that, I started investigating what had changed.</p><p>It looked like the issue was related to the sandbox account state on the device. When I logged out of the sandbox tester account, `AppTransaction.shared` returned the error again. When I logged back in, the transaction loaded normally.</p><p>I do not want to claim this is the only possible reason for `Unable to Complete Request`. But in my case, the behavior looked like this:</p><pre>Sandbox tester logged out -&gt; Unable to Complete Request<br>Sandbox tester logged in -&gt; AppTransaction returns data</pre><h3>3. Avoiding App Review Rejection: environment and cutoff build</h3><p>While investigating `Unable to Complete Request`, I found another important trap in other developers’ stories online.</p><p>Luckily, I did not hit it myself. Reading other developers’ pain helped me avoid creating the same problem in my own release.</p><h4>3.1 The Environment Issue</h4><p>If you use `<a href="https://developer.apple.com/documentation/storekit/apptransaction/originalappversion">originalAppVersion</a>` without checking `<a href="https://developer.apple.com/documentation/storekit/apptransaction/environment">environment</a>`, sandbox users may be treated as legacy paid users. In sandbox, the original version can look like `1.0`. If your freemium cutoff is higher than that, the reviewer may never see your paywall.</p><p>And App Review needs to see the paywall and test the IAP flow.</p><p>If the reviewer is automatically recognized as a legacy paid user because of a sandbox value, the paywall may never appear. I found real stories online where developers received App Review rejection because of exactly this.</p><p>For myself, I reduced the possible `AppTransaction` environments to three cases:</p><pre>production<br>sandbox<br>xcode</pre><p>I did not treat `xcode` as a source of legacy access. If the app is running through Xcode StoreKit Testing, that is definitely not a real production purchase from an old user.</p><p>Before release, the only case I trusted for legacy unlock was:</p><pre>environment == production</pre><p>Only in that case was I willing to trust `originalAppVersion`.</p><p>Below is a simplified snippet that shows the key idea without project-specific details:</p><pre>import StoreKit<br><br>enum AccessStatus {<br>  case legacyPro<br>  case freemium<br>}<br><br>func resolveAccess(from transaction: AppTransaction, cutoffBuild: String) -&gt; AccessStatus {<br>    guard transaction.environment == .production else {<br>      return .freemium<br>    }<br>    let isLegacyUser = transaction.originalAppVersion.compare(<br>      cutoffBuild,<br>      options: .numeric<br>      ) == .orderedAscending<br>  return isLegacyUser ? .legacyPro : .freemium<br>}</pre><p>The important part is not the enum or the function name. The important part is the first condition.</p><p>If `environment` is not `production`, I do not enable legacy access, even if `originalAppVersion` looks old. For sandbox, Xcode, and App Review, the app should show the freemium flow and the paywall.</p><p><strong>3.2 The Cutoff Build</strong></p><p>Later, after testing the intermediate production version with people I knew who had bought the app, I discovered another detail.</p><p>The `originalAppVersion` I expected to see was not the marketing version I had in mind. The screenshots showed values that did not match my expectation. After checking Apple’s documentation again, I realized why: on iOS, this value is based on the build number, not the marketing version.</p><p>That made the cutoff build especially important.</p><p>For example, if the paid version ended at build `12`, and freemium starts at build `13`, the rule should be roughly:</p><pre>originalAppVersion &lt; 13 -&gt; old paid user<br>originalAppVersion &gt;= 13 -&gt; new freemium user</pre><p>The main conclusion of this chapter:</p><pre>Know exactly which build is your first freemium build.<br>Enable legacy unlock only for production environment.</pre><p>Otherwise, you may accidentally hide the paywall from App Review.</p><h3>4. Release and AppTransaction.refresh()</h3><p>After successfully testing the intermediate version and confirming that `AppTransaction` worked in production, I decided to finish the monetization and submit the version with the new model.</p><p>But I still did not want to assume that `AppTransaction.shared` would always succeed.</p><p>And that caution turned out to be useful. In one of the later builds, while testing on my own device, I saw the same error again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrVKDwLT6esBSLjvJwJ4-w.png" /></figure><pre>Unable to Complete Request</pre><p>At first, I got nervous. But this time I was prepared.</p><p>Before release, I reread Apple’s documentation and noticed an important point: if `AppTransaction.shared` cannot get the transaction, you can provide an explicit user action and call `AppTransaction.refresh()`.</p><p>The important part is that `AppTransaction.refresh()` is not called automatically. It is triggered only after an explicit user action, for example when the user taps a `Refresh Legacy Access` button or row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*qXBeEUn_PxBfULvwjSm8BA.png" /></figure><p>Below is a simplified snippet that reflects the key idea without project-specific details:</p><pre>import StoreKit<br><br>func resolveLegacyAccess() async {<br>    do {<br>        let result = try await AppTransaction.refresh()<br><br>        guard case .verified(let transaction) = result else {<br>            return<br>        }<br><br>        guard transaction.environment == .production else {<br>            showFreemiumFlow()<br>            return<br>        }<br><br>        if transaction.originalAppVersion.compare(&quot;13&quot;, options: .numeric) == .orderedAscending {<br>            unlockLegacyPro()<br>        } else {<br>            showFreemiumFlow()<br>        }<br>    } catch {<br>        showRefreshLegacyAccessError(error)<br>    }<br>}</pre><p>From the user’s perspective, this feels similar to Restore Purchases: the system may show an App Store sign-in prompt, and then the app tries to fetch the signed app transaction again.</p><p>This is also why I do not call `AppTransaction.refresh()` automatically. Apple explicitly describes it as an API that can show a system authentication prompt and should be called only after an explicit user action, such as tapping a button.</p><p>Apple docs: <a href="https://developer.apple.com/documentation/storekit/apptransaction/refresh()">AppTransaction.refresh()</a></p><p>And it worked.</p><p>After refresh, the transaction loaded. I saw the expected `originalAppVersion`, `environment`, and the app was able to correctly resolve legacy access.</p><p>For myself, I ended up with this rule:</p><pre>AppTransaction.shared -&gt; normal soft check<br>AppTransaction.refresh -&gt; explicit user action if shared cannot get the transaction</pre><p>This gave me two practical rules:</p><pre>1. If transaction loading fails, `refresh()` is my recovery path, but only after an explicit user action.<br>2. `originalAppVersion` is useful for legacy access only when `environment == production`.</pre><p>Everything else should fall back to the normal freemium flow.</p><p>The main point: do not call `refresh()` automatically on app launch. It should be a user action, for example a `Refresh Legacy Access` button or row in Settings / Purchases.</p><p>One more pleasant surprise: App Review took less than an hour from submission to `Pending Developer Release`.</p><p>Honestly, it was one of the fastest reviews I have ever had. I expected this release to be more stressful because it changed the business model and touched StoreKit logic. But because the paywall was visible in the review environment, and legacy access was limited to production, the review passed without drama.</p><h3>Key Takeaways</h3><p><strong>1. `Unable to Complete Request` is a real scenario</strong><br> If `AppTransaction.shared` fails, it does not mean the migration is impossible. But you should not build your flow as if this call always succeeds.</p><p><strong>2. Sandbox/App Review and production must be handled differently.</strong><br> Legacy access should be enabled only for `production`. If `environment` is `sandbox`, `xcode`, or anything else, the app should show freemium and paywall.</p><p><strong>3. Otherwise, you can accidentally hide the paywall from App Review.</strong><br> In sandbox, `originalAppVersion` may look like an old version. Without an `environment` check, the reviewer may be treated as a legacy paid user and never see IAP.</p><p><strong>4. The app should have an explicit Refresh Legacy Access action. </strong><br> If `AppTransaction.shared` fails, the user needs a clear action that calls `AppTransaction.refresh()`.</p><p><strong>5. Treat `AppTransaction.shared` as a soft automatic check.</strong><br> It is useful for normal status resolution, but it should not be the only recovery path for legacy access.</p><p><strong>6. Call `AppTransaction.refresh()` only after user action.</strong><br> It may show a system App Store prompt, so it should not run automatically at launch.</p><p><strong>7. On iOS, be careful with the cutoff build.</strong><br> If freemium starts at build `13`, old paid users are users with `originalAppVersion &lt; 13`.</p><p><strong>8. An intermediate release can reduce risk.</strong><br> A simple Purchases section helped me verify production behavior on real accounts before enabling the full monetization change.</p><p><strong>9. After that, `AppTransaction` becomes a good tool for paid-to-freemium migration. </strong><br> It can preserve access for old paid users, but only if you handle errors, `environment`, cutoff build, and refresh flow correctly.</p><h3><strong>Try It in the App</strong></h3><p>The app is now called <strong>RepChime</strong> (formerly <strong>FitReps</strong>), and yes, this is the same app from the story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLvwEYwfR-5hfX5WlW3wyw.png" /></figure><p>App Store link: <a href="https://apps.apple.com/app/apple-store/id1441675623?pt=119355156&amp;ct=medium_business_model&amp;mt=8">RepChime</a></p><p>If you want to see this behavior not only in an article but in a real app, you can install <strong>RepChime</strong> and check the AppTransaction status in Settings: which `environment` is returned, which original version you get, and how legacy refresh behaves.</p><p>And if you work out, <strong>RepChime</strong> may be useful for its main purpose too: it is a HIIT timer and rep counter with workout presets, sound countdown, motion-based exercise counting, and Pro features for more flexible training.</p><h3>Useful Apple Links</h3><ul><li><a href="https://developer.apple.com/documentation/storekit/apptransaction">AppTransaction</a></li><li><a href="https://developer.apple.com/documentation/storekit/apptransaction/shared">AppTransaction.shared</a></li><li><a href="https://developer.apple.com/documentation/storekit/apptransaction/refresh()">AppTransaction.refresh()</a></li><li><a href="https://developer.apple.com/documentation/storekit/apptransaction/originalappversion">AppTransaction.originalAppVersion</a></li><li><a href="https://developer.apple.com/documentation/storekit/apptransaction/environment">AppTransaction.environment</a></li><li><a href="https://developer.apple.com/videos/play/wwdc2022/10007">WWDC 2022: What’s new with in-app purchase</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f82225769732" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PriceFuse is now available on the App Store]]></title>
            <link>https://medium.com/@valnikodeveloper/pricefuse-is-now-available-on-the-app-store-8f7003a92e18?source=rss-e0a31c4c1aad------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f7003a92e18</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[indie-developer]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[ios-development]]></category>
            <dc:creator><![CDATA[Valerii Nikolaev]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 18:50:57 GMT</pubDate>
            <atom:updated>2026-03-06T18:50:57.920Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzWnB1ViWzlpOdOTXaAc4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hB_-Ce1WG1SqZYBadOT_Jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3CBRAd0YtYbMgygKi9yAg.png" /></figure><p>After months of development, <strong>PriceFuse is now available on the App Store.</strong></p><p>PriceFuse is an iOS app designed to make price conversion between currencies quick and effortless.</p><p>The app supports multiple input methods — <strong>camera OCR, voice input, photos, or manual entry</strong> — making it easy to convert prices in real-world situations like traveling or shopping abroad.</p><p>PriceFuse is built using <strong>Swift and SwiftUI</strong>, and leverages Apple technologies such as <strong>Vision for OCR</strong> and <strong>Speech Recognition for voice input</strong>.</p><p>My goal was to create a simple and practical tool that helps people quickly understand prices in different currencies.</p><p>You can check it out here:</p><p><a href="https://apps.apple.com/us/app/pricefuse/id6751553511">https://apps.apple.com/us/app/pricefuse/id6751553511</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f7003a92e18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do You Track the Weight of Your App?]]></title>
            <link>https://medium.com/@valnikodeveloper/do-you-track-the-weight-of-your-app-cbf13ceda862?source=rss-e0a31c4c1aad------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbf13ceda862</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[app-thinning]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[app-size-reduce]]></category>
            <dc:creator><![CDATA[Valerii Nikolaev]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 04:58:18 GMT</pubDate>
            <atom:updated>2026-02-18T16:41:00.284Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OaOnCPdXsqfsNjriq-ardg.png" /></figure><h3>Why is a banking app sometimes larger than a game?</h3><p>I’ve often noticed something that doesn’t quite add up.</p><p>A banking app.</p><p>A food delivery app.</p><p>Sometimes larger than a fully featured mobile game — with graphics, animations, sound, and real-time logic.</p><p>And yet the banking app weighs more.</p><p>Every time I see:</p><p>Update size: 180 MB</p><p>for an app that mostly renders forms and network responses, I pause.</p><p>What exactly am I downloading?</p><p>Inside development teams, internet feels unlimited.</p><p>Fast Wi-Fi. Stable connections. No friction.</p><p>But outside that bubble, reality is different.</p><p>Roaming costs money.</p><p>International eSIM plans aren’t cheap.</p><p>Mobile data in many countries is limited.</p><p>After paying for traffic you didn’t expect to consume, the question becomes practical — not theoretical.</p><p>Storage is another constraint.</p><p>128 GB devices are still common.</p><p>A few heavy everyday apps — banking, delivery, shopping, social — and space disappears quickly.</p><p>When that happens, users don’t complain.</p><p>They postpone.</p><p>“I’ll download it later.”</p><p>And later often means never.</p><p>As users, we can’t control this.</p><p>As engineers, we can.</p><p>App size is not accidental.</p><p>It is the result of decisions.</p><p>And that is where this discussion begins.</p><h3>1. What “App Size” Actually Means</h3><p>When we talk about “app size,” we often refer to different numbers without realizing it.</p><p>There is no single app size — there are multiple metrics produced at different stages of build and distribution.</p><p>Understanding which one you are measuring is the first step toward meaningful optimization.</p><h4>• Download Size</h4><p>Download size is the compressed package transferred over the network when a user installs or updates the app.</p><p>Through App Thinning and slicing, users receive a device-specific variant of the app — only the architectures and resources required for their device.</p><p>Because the package is compressed and tailored to a specific device, download size is typically smaller than the installed size.</p><h4>• Installed Size</h4><p>Installed size is the space the app occupies on the device after installation.</p><p>It represents the unpacked app bundle written to disk and includes:</p><ul><li>the executable</li><li>bundled resources</li><li>embedded frameworks</li><li>assets</li></ul><p>This is the number that affects storage constraints — especially on 64 GB and 128 GB devices.</p><h4>• Build artifacts (.app, .ipa, .xcarchive)</h4><p>During development, Xcode generates:</p><ul><li>a compiled .app bundle</li><li>an .xcarchive</li><li>optionally, an exported .ipa</li></ul><p>These are local build artifacts used for debugging, signing, and upload.</p><p>They are convenient to measure — but they are not identical to what users ultimately receive from the App Store.</p><h4>• From Local Build to App Store Delivery</h4><p>After upload, the App Store processes the build before distribution.</p><p>Device-specific variants are generated, and users receive a compressed package tailored to their device.</p><p>They do not download your original exported .ipa.</p><p>After installation, that package is unpacked and written to storage as the app bundle.</p><h4>• Why This Matters</h4><p>App size is the result of multiple stages:</p><p>Build</p><p>→ App Store processing</p><p>→ Device-specific delivery</p><p>→ Download (compressed)</p><p>→ Installation (unpacked)</p><p>If you measure only local build artifacts, you risk optimizing the wrong metric.</p><p>Without understanding which stage you are measuring, optimization becomes guesswork.</p><h3>2. Measuring App Size Correctly</h3><p>Talking about app size without measuring it properly leads to wrong conclusions.</p><p>There isn’t a single “app size.”</p><p>There are multiple metrics — and they describe different stages of distribution.</p><h4>• Local Build Artifacts</h4><p>You can check:</p><ul><li>.app</li><li>.ipa</li><li>.xcarchive</li></ul><p>These are developer-facing build outputs.</p><p>They are useful for debugging and packaging, but they do <strong>not</strong> represent what users actually download from the App Store.</p><p>Optimizing only these numbers can be misleading.</p><h4>• Xcode App Thinning Size Report</h4><p>During development, you can generate an App Thinning Size Report in Xcode by exporting an archive with thinning enabled.</p><p>Xcode produces a device-variant breakdown in plain text format, showing how the app would be packaged for different configurations.</p><p>It provides:</p><ul><li>estimated device-specific download size</li><li>estimated install size</li></ul><p>This simulates how slicing affects different device variants before distribution.</p><p>When analyzing AirHorizon, this report was the first place where I could clearly observe how different device variants affect both download size and installed footprint — even before uploading the build to App Store Connect.</p><h4>• <strong>Example (device-specific export):</strong></h4><p>App Thinning configuration:</p><ul><li>Device variant: iPhone 17 Pro</li><li>Thinning mode: device-specific</li></ul><p>The excerpt below is part of the App Thinning Size Report generated during archive export in Xcode:</p><pre>Supported variant descriptors: [device: iPhone11,4, os-version: 17.4], [device: iPhone11,4, os-version: 17.0], [device: iPhone16,1, os-version: 17.4], [device: iPhone16,2, os-version: 26.0], [device: iPhone11,2, os-version: 16.0], [device: iPhone11,2, os-version: 17.0], [device: iPhone16,2, os-version: 17.4], [device: iPhone11,6, os-version: 15.0], [device: iPhone13,1, os-version: 15.0], [device: iPhone9,4, os-version: 15.0], [device: iPhone14,2, os-version: 26.0], [device: iPhone10,6, os-version: 16.0], [device: iPhone12,3, os-version: 17.0], [device: iPhone11,6, os-version: 17.0], [device: iPhone16,1, os-version: 17.0], [device: iPhone13,4, os-version: 26.0], [device: iPhone12,5, os-version: 26.0], [device: iPhone11,4, os-version: 18.0], [device: iPhone13,2, os-version: 18.0], [device: iPhone14,3, os-version: 18.0], [device: iPhone9,2, os-version: 15.0], [device: iPhone13,2, os-version: 26.0], [device: iPhone14,5, os-version: 17.0], [device: iPhone15,4, os-version: 17.0], [device: iPhone14,8, os-version: 17.4], [device: iPhone10,3, os-version: 16.0], [device: iPhone14,2, os-version: 16.0], [device: iPhone12,5, os-version: 18.0], [device: iPhone14,2, os-version: 17.4], [device: iPhone14,8, os-version: 17.0], [device: iPhone14,5, os-version: 16.0], [device: iPhone12,3, os-version: 26.0], [device: iPhone12,5, os-version: 17.0], [device: iPhone10,6, os-version: 15.0], [device: iPhone14,2, os-version: 18.0], [device: iPhone18,4, os-version: 26.0], [device: iPhone10,3, os-version: 15.0], [device: iPhone12,3, os-version: 17.4], [device: iPhone17,2, os-version: 26.0], [device: iPhone14,7, os-version: 26.0], [device: iPhone14,3, os-version: 17.4], [device: iPhone11,2, os-version: 18.0], [device: iPhone17,4, os-version: 26.0], [device: iPhone14,4, os-version: 18.0], [device: iPhone8,2, os-version: 15.0], [device: iPhone13,1, os-version: 26.0], [device: iPhone13,3, os-version: 18.0], [device: iPhone17,5, os-version: 18.0], [device: iPhone14,4, os-version: 16.0], [device: iPhone17,2, os-version: 18.0], [device: iPhone18,2, os-version: 26.0], [device: iPhone18,3, os-version: 26.0], [device: iPhone13,1, os-version: 17.0], [device: iPhone14,7, os-version: 16.0], [device: iPhone15,3, os-version: 17.4], [device: iPhone14,8, os-version: 26.0], [device: iPhone14,4, os-version: 15.0], [device: iPhone14,3, os-version: 16.0], [device: iPhone13,1, os-version: 18.0], [device: iPhone13,3, os-version: 26.0], [device: iPhone13,2, os-version: 16.0], [device: iPhone13,3, os-version: 16.0], [device: iPhone13,2, os-version: 17.0], [device: iPhone14,5, os-version: 17.4], [device: iPhone14,2, os-version: 17.0], [device: iPhone10,5, os-version: 15.0], [device: iPhone14,3, os-version: 17.0], [device: iPhone15,3, os-version: 17.0], [device: iPhone14,5, os-version: 26.0], [device: iPhone12,5, os-version: 16.0], [device: iPhone15,3, os-version: 26.0], [device: iPhone14,5, os-version: 15.0], [device: iPhone10,2, os-version: 16.0], [device: iPhone16,2, os-version: 17.0], [device: iPhone17,1, os-version: 18.0], [device: iPhone11,2, os-version: 15.0], [device: iPhone12,3, os-version: 15.0], [device: iPhone13,2, os-version: 15.0], [device: iPhone14,4, os-version: 26.0], [device: iPhone13,4, os-version: 17.0], [device: iPhone14,3, os-version: 26.0], [device: iPhone10,5, os-version: 16.0], [device: iPhone14,7, os-version: 17.0], [device: iPhone11,6, os-version: 18.0], [device: iPhone15,5, os-version: 17.0], [device: iPhone15,3, os-version: 16.0], [device: iPhone15,5, os-version: 17.4], [device: iPhone14,3, os-version: 15.0], [device: iPhone10,2, os-version: 15.0], [device: iPhone15,4, os-version: 18.0], [device: iPhone13,4, os-version: 18.0], [device: iPhone15,3, os-version: 18.0], [device: iPhone17,1, os-version: 26.0], [device: iPhone14,7, os-version: 18.0], [device: iPhone18,1, os-version: 26.0], [device: iPhone11,2, os-version: 17.4], [device: iPhone13,3, os-version: 15.0], [device: iPhone13,4, os-version: 16.0], [device: iPhone15,2, os-version: 16.0], [device: iPhone15,5, os-version: 18.0], [device: iPhone13,1, os-version: 16.0], [device: iPhone15,2, os-version: 18.0], [device: iPhone17,5, os-version: 26.0], [device: iPhone14,8, os-version: 18.0], [device: iPhone12,5, os-version: 15.0], [device: iPhone14,5, os-version: 18.0], [device: iPhone11,4, os-version: 15.0], [device: iPhone13,4, os-version: 15.0], [device: iPhone13,3, os-version: 17.4], [device: iPhone15,2, os-version: 26.0], [device: iPhone11,6, os-version: 16.0], [device: iPhone15,5, os-version: 26.0], [device: iPhone14,8, os-version: 16.0], [device: iPhone11,6, os-version: 17.4], [device: iPhone17,4, os-version: 18.0], [device: iPhone16,2, os-version: 18.0], [device: iPhone16,1, os-version: 26.0], [device: iPhone12,3, os-version: 18.0], [device: iPhone17,3, os-version: 26.0], [device: iPhone13,2, os-version: 17.4], [device: iPhone15,2, os-version: 17.4], [device: iPhone14,2, os-version: 15.0], [device: iPhone12,5, os-version: 17.4], [device: iPhone14,4, os-version: 17.4], [device: iPhone15,4, os-version: 26.0], [device: iPhone15,4, os-version: 17.4], [device: iPhone17,3, os-version: 18.0], [device: iPhone11,4, os-version: 16.0], [device: iPhone13,4, os-version: 17.4], [device: iPhone15,2, os-version: 17.0], [device: iPhone13,1, os-version: 17.4], [device: iPhone14,4, os-version: 17.0], [device: iPhone12,3, os-version: 16.0], [device: iPhone13,3, os-version: 17.0], [device: iPhone16,1, os-version: 18.0], and [device: iPhone14,7, os-version: 17.4]<br>App + On Demand Resources size: 154 KB compressed, 421 KB uncompressed<br>App size: 154 KB compressed, 421 KB uncompressed<br>On Demand Resources size: Zero KB compressed, Zero KB uncompressed</pre><ul><li>comparing builds</li><li>tracking regressions</li><li>evaluating the impact of added assets or dependencies before distribution</li></ul><p>However, it remains an estimate and may differ slightly from the final processed values shown in App Store Connect.</p><h4>• App Store Connect (After Upload)</h4><p>Once the build is uploaded and processed, App Store Connect provides size information based on the App Store’s distribution configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jrNJU2-MuEA5KH_QrWuIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GnPhb_O0Rn0t1zWvnrijRQ.png" /></figure><p>At this stage, you can see:</p><ul><li>device-specific download size</li><li>install size</li></ul><p>These numbers are closer to real-world distribution than local estimates.</p><h4>• App Store Public Display</h4><p>The App Store displays the app’s installed size on device, not including user-generated or cached data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2FrGl3sYwSY_GxzJCirJg.png" /></figure><p>This value:</p><ul><li>may differ slightly from internal reports</li><li>does not necessarily equal the exact network payload</li></ul><p>It represents the installed size shown to users, not the actual network payload.</p><h4>• Installed Size on Device</h4><p>Finally, you can verify the real footprint directly on a device:</p><p>Settings → General → iPhone Storage</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYdpjiz-pX2MVmXhq9qGHQ.png" /></figure><p>Here you see:</p><ul><li>App Size</li><li>Documents &amp; Data</li></ul><p>This reflects the actual storage used after installation and unpacking.<br>In this example, the App Store value was very close to the estimated installed size from the App Thinning report, with only a small difference of a few kilobytes.</p><p>The download size was smaller, but this does not mean large apps become “lightweight” over the network.</p><p>If an app installs as 400 MB, you should not expect a 150 KB download simply because of compression.</p><h4>• A Simple Size Impact Example</h4><p>Here’s what happens when you add a single ~8 MB PNG file to your project.</p><p>No additional code.</p><p>No new frameworks.</p><p>Just one bundled image.</p><p>After processing in App Store Connect, the following sizes were reported for iPhone 17 Pro:</p><p><strong>Before adding the PNG:</strong></p><p>Download size: 157 KB</p><p>Install size: 541 KB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-DqiHqsTgpi9N7f3Sg2Wg.png" /></figure><p><strong>After adding the PNG:</strong></p><p>Download size: 8.16 MB</p><p>Install size: 8.53 MB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCt7PQANnnOoSUP6NRXerg.png" /></figure><p>A single asset dramatically changed the download and installed size of the app.</p><p>Bundled resources directly affect both network transfer and on-device storage.</p><h4>• Summary</h4><p>Different tools show different size values because they measure different stages:</p><ul><li>Local build artifacts</li><li>Estimated sliced size</li><li>App Store processed size</li><li>Public display value</li><li>Installed storage footprint</li></ul><p>If you don’t clearly define which metric you’re optimizing, you risk optimizing the wrong one.</p><p>App size is not a single number. It’s a layered result of build, processing, distribution, and installation.</p><h3>3. How to Reduce App Size (Apple’s Checklist)</h3><p>Reducing app size is not about one trick.</p><p>It is a series of practical decisions that compound over time.</p><h4>• Basic Optimization (Do This First)</h4><p>These steps apply to almost every iOS app.</p><h4>• Optimize and compress assets</h4><p>Images are often the largest contributor to size.</p><ul><li>Use optimized PNGs</li><li>Avoid shipping oversized images</li><li>Resize assets to actual display dimensions</li><li>Prefer vector assets (PDF / SF Symbols) where appropriate</li></ul><p>A single high-resolution image can outweigh your entire binary.</p><h4>• Remove unused resources</h4><p>Audit your bundle carefully.</p><p>Check for:</p><ul><li>test files accidentally included</li><li>unused JSON or sample data</li><li>outdated PDFs</li><li>demo media</li><li>development leftovers</li></ul><p>Verify the Copy Bundle Resources phase.</p><p>What is in your project is not always what ships.</p><h4>• Review Embedded Frameworks and SDKs</h4><p>Every dependency adds weight.</p><p>Ask:</p><ul><li>Is this SDK necessary?</li><li>Is there a lighter alternative?</li><li>Can it be modularized?</li><li>Do I really need the entire library for this feature?</li></ul><p>In many cases, a small portion of functionality is required, but the full framework is linked into the app.</p><p>Sometimes it is more efficient to implement a focused solution instead of importing a large dependency.</p><p>Third-party libraries often dominate size in small apps.</p><h4>• Make Sure Dead Code Stripping Is Enabled</h4><p>For Release builds:</p><ul><li>Dead Code Stripping = YES</li><li>Strip Debug Symbols During Copy = YES</li></ul><p>Unused code and symbols should not be included in the production binary.</p><h4>• Make Sure the Release Configuration Is Optimized</h4><p>Ensure that:</p><ul><li>Optimization Level is set to -O or -Osize</li><li>Debug logging is removed</li><li>No debug flags remain enabled</li></ul><p>Debug builds are not representative of production size and should not be used to estimate distribution footprint.</p><h4>• Advanced Optimization (When Basic Is Not Enough)</h4><p>These steps matter when size becomes a real constraint.</p><h4>• Move large assets to On-Demand Resources</h4><p>If your app includes:</p><ul><li>large media files</li><li>optional feature packs</li><li>tutorials</li><li>downloadable content</li></ul><p>Load them on demand instead of bundling everything upfront.</p><p>This reduces initial download size.</p><h4>• Re-evaluate heavy dependencies</h4><p>Measure the size impact of each SDK.</p><p>Sometimes removing a single library reduces size more than micro-optimizing assets.</p><h4>• Use App Thinning strategically</h4><p>Structure your project so slicing works in your favor.</p><ul><li>Avoid bundling assets for all device classes unnecessarily</li><li>Use asset catalogs correctly</li><li>Separate optional content</li></ul><p>App Store slicing reduces per-device download size, but your bundle structure determines the outcome.</p><h3>4. Pre-Release Size Checklist (Practical Workflow)</h3><p>The simplest and fastest workflow looks like this:</p><ol><li>Generate a local App Thinning Size Report in Xcode.</li><li>Check both download size and installed size for representative devices.</li><li>If the numbers are acceptable — proceed with upload.</li><li>If not — optimize before shipping.</li><li>When optimizing, review:</li></ol><ul><li>Large bundled resources</li><li>Embedded frameworks and SDKs</li><li>Release build flags and optimization settings</li><li>Unused assets in Copy Bundle Resources</li></ul><ol><li>Generate the App Thinning report again.</li><li>Compare the new numbers with the previous build.</li></ol><p>Repeat until the size is within acceptable limits.</p><p>This keeps the process simple:</p><p>Measure → Optimize → Measure again.</p><p>App size should be validated locally before distribution, not discovered after release.</p><h3>5. Conclusion</h3><p>App size reflects different stages of the app lifecycle — build, distribution, and installation.</p><p>Personally, I don’t want my app to get “out of shape” and grow unnecessarily heavy.</p><p>During development, I regularly review the resources I add to the bundle.</p><p>If I’m tempted to include a trendy new library, the first question I ask is simple:</p><p><em>Does Apple already provide a native solution?</em></p><p>Optimize intentionally, not blindly.</p><p>App size should be observed, understood, and verified — not guessed.</p><p>It is a discipline.</p><p>And a form of respect — for the user’s device, storage, network constraints, and time.</p><h3>References</h3><p>Apple Documentation:</p><ul><li>App Thinning Overview</li><li><a href="https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html">https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html</a></li><li>Reducing Your App’s Size</li><li><a href="https://developer.apple.com/documentation/xcode/reducing-your-app-s-size">https://developer.apple.com/documentation/xcode/reducing-your-app-s-size</a></li><li>Building Your App for App Store Distribution</li><li><a href="https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases">https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbf13ceda862" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Double or Decimal — What’s Your Choice?]]></title>
            <link>https://medium.com/@valnikodeveloper/double-or-decimal-whats-your-choice-9fe2034106c3?source=rss-e0a31c4c1aad------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fe2034106c3</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Valerii Nikolaev]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 20:24:22 GMT</pubDate>
            <atom:updated>2025-11-16T20:24:22.828Z</atom:updated>
            <content:encoded><![CDATA[<h3>Double or Decimal — What’s Your Choice?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QKT2r0LiYxFJCsH3X_s-w.png" /></figure><p>Working across different types of projects — from CoreMotion-heavy prototypes to finance-focused features — I’ve learned that choosing the right numeric type in Swift is not just a small implementation detail. It affects how your app behaves, what your users see, and how trustworthy your calculations feel.</p><p>And the most common question here is simple:</p><p><strong>Should you use </strong><strong>Double or </strong><strong>Decimal?</strong></p><p>This isn’t theory. It shows up the moment precision becomes part of the requirements.</p><h3>1. How Double and Decimal behave in real life</h3><p>Let’s start with an example many iOS engineers have bumped into:</p><pre>  let price = 1.10<br>  let tax = 2.20<br>  print(price + tax) // 3.3000000000000003</pre><p>Nothing is broken — this is how binary floating-point numbers behave.<br>Some decimal fractions simply cannot be represented exactly, so you get small rounding artifacts.</p><p>The classic case:</p><pre>print(0.1 + 0.2 == 0.3) // false</pre><p>And for anything involving:</p><ul><li>money</li><li>totals</li><li>exchange rates</li><li>tax calculations</li><li>any user-visible numeric value</li></ul><p>…these inaccuracies can become visible, annoying, and misleading.</p><p>This is where Decimal behaves differently:</p><pre>let decPrice = Decimal(string: &quot;1.10&quot;) ?? 0<br>let decTax   = Decimal(string: &quot;2.20&quot;) ?? 0<br>print(decPrice + decTax) // 3.30</pre><p>Even the classic failing case becomes correct:</p><pre>let a = Decimal(string: &quot;0.1&quot;) ?? 0<br>let b = Decimal(string: &quot;0.2&quot;) ?? 0<br>print(a + b == 0.3) // true</pre><p>Why?<br>Because:</p><ul><li><strong>Double is binary.</strong></li><li><strong>Decimal is base-10</strong>, the same format humans write numbers in.</li></ul><h4>Large and small numbers: the gap grows</h4><pre>// Large Double → scientific notation.<br>// Familiar situation? 🤔<br>let hugeDouble: Double = 123_456_789_012_345_89.0<br>print(hugeDouble) // 1.2345678901234588e+16<br><br>// Small Double → again scientific notation.<br>let tinyDouble: Double = 0.000000289898<br>print(tinyDouble) // 2.89898e-07</pre><p>Now compare Decimal:</p><pre>// Same numbers in Decimal → no scientific notation, no precision loss.<br>let hugeDecimal = Decimal(string: &quot;12345678901234589&quot;) ?? 0<br>print(hugeDecimal) // 12345678901234589<br><br>let tinyDecimal = Decimal(string: &quot;0.000000289898&quot;) ?? 0<br>print(tinyDecimal) // 0.000000289898</pre><p>Decimal keeps numbers exactly as written:</p><ul><li>no scientific notation</li><li>no binary rounding</li><li>no surprises</li></ul><p>In finance or anything user-facing, this predictability is priceless.</p><h3>2. Pros and cons of each type</h3><h3>Double</h3><p><strong>Pros:</strong></p><ul><li>Extremely fast</li><li>Lightweight (pure Swift struct)</li><li>Ideal for math-heavy or sensor-driven logic</li><li>Used across many Apple APIs</li></ul><p><strong>Cons:</strong></p><ul><li>Cannot represent many decimal fractions exactly</li><li>Scientific notation appears easily</li><li>Not suitable for financial workflows</li></ul><h3>Decimal</h3><p><strong>Pros:</strong></p><ul><li>Predictable and precise</li><li>Ideal for pricing, totals, taxes, financial flows</li><li>No binary rounding artifacts</li><li>Preserves human-expected decimal digits</li></ul><p><strong>Cons:</strong></p><ul><li>Slower (no hardware acceleration)</li><li>More verbose to work with</li><li>Base-10 arithmetic is more expensive</li></ul><h3>3. The rule I follow</h3><p>After using both across different contexts, the pattern is clear:</p><ul><li><strong>For currency, billing, user-visible values → use Decimal.</strong></li><li><strong>For sensors, geometry, CoreMotion, ML, math → use Double.</strong></li></ul><p>A simple principle ties it together:</p><p><strong>Use Double when you need speed.<br>Use Decimal when you need accuracy.</strong></p><p>And in financial features, accuracy <em>always</em> wins.</p><h3>4. Fun and useful facts</h3><p>It’s easy to assume that all currencies use two decimal places.<br>In practice — absolutely not.</p><p>Examples:</p><ul><li><strong>KWD (Kuwaiti Dinar)</strong> — 3 decimals</li><li><strong>BHD (Bahraini Dinar)</strong> — 3 decimals</li><li><strong>JOD (Jordanian Dinar)</strong> — 3 decimals</li><li><strong>JPY (Japanese Yen)</strong> — 0 decimals</li><li><strong>CLP (Chilean Peso)</strong> — 0 decimals</li><li><strong>USD, EUR, MXN</strong> — 2 decimals</li></ul><p>Decimal naturally preserves the number of fractional digits you give it — much safer for currency rules.</p><p><strong>Disclaimer:</strong><br>This article is based on practical engineering experience and commonly observed behavior of numeric types in Swift. It is intended to provide clarity and share professional insights, and does not replace official documentation or project-specific technical requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fe2034106c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are You an iOS Developer or an iOS Engineer?]]></title>
            <link>https://medium.com/@valnikodeveloper/are-you-an-ios-developer-or-an-ios-engineer-81de51fb71ba?source=rss-e0a31c4c1aad------2</link>
            <guid isPermaLink="false">https://medium.com/p/81de51fb71ba</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[developer-mindset]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Valerii Nikolaev]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 03:08:23 GMT</pubDate>
            <atom:updated>2025-11-10T03:08:23.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LqMQlR3vbikUqiHpYZlxCA.png" /></figure><p>Every engineer eventually hits a point where code stops being just about syntax — and starts being about what the code is actually doing in the real world.<br>That’s the moment you stop seeing yourself only as a developer and start thinking like an engineer.</p><p><strong>1. The Developer Mindset — Clean, Correct Code</strong><br>Early on I cared more about <em>how</em> I wrote the code: are the names clear, will this pass review, how many comments will I get on the PR, does it match the team’s style.<br>That’s a normal stage — you learn not to get in the way of the codebase and the team.<br>But that’s still an inward view: the code as text.</p><p>An <strong>engineer</strong> looks outward: <em>how does this piece of code interact with the device, the network, sensors, the user, the environment?</em> What happens if the user rotates the phone, the sensor is noisy, the network drops, or the user does things “out of order”?<br>That’s where engineering starts.</p><p><strong>2. The Engineer Mindset — Systems, Not Screens</strong><br>You start becoming an engineer when you see the invisible structure behind the UI: data flow, memory behavior, edge cases, how it will behave in production.<br>Engineering is about ownership — stability, performance, design, even the user’s trust.<br>At that point you’re designing systems, not just views.</p><p><strong>3. From APIs to Physics</strong><br>For me the shift became real when I started building standalone apps that talk directly to sensors.<br>Working with motion data — accelerometer, gyroscope, device attitude — makes you realize: engineering begins where code meets physics.<br>It’s no longer “I called an API and got a value.” It’s “how does the device actually move, how does orientation change, and how do I keep this experience stable and natural?”<br>That’s where software becomes something you can feel.<br>For example:</p><p><strong>Developer Version (works, just straightforward):</strong></p><pre>import SwiftUI<br>import CoreMotion<br>import Combine<br><br>final class MotionViewModel: ObservableObject {<br>    private let manager = CMMotionManager()<br>    @Published var pitch: Double = 0<br><br>    func start() {<br>        // no availability check<br>        manager.deviceMotionUpdateInterval = 1.0 / 60.0<br><br>        // update right on main<br>        manager.startDeviceMotionUpdates(to: .main) { [weak self] motion, _ in<br>            guard let self, let motion else { return }<br><br>            let g = motion.gravity<br>            // quick tilt from gravity<br>            let value = atan2(g.x, g.z)<br><br>            self.pitch = value<br>        }<br>    }<br>}<br><br>struct ContentView: View {<br>    @StateObject private var vm = MotionViewModel()<br><br>    var body: some View {<br>        Text(&quot;Pitch: \(vm.pitch)&quot;)<br>            .onAppear { vm.start() } // no stop<br>    }<br>}</pre><p><strong>Engineer Version (stable, thoughtful, complete):</strong></p><pre>import SwiftUI<br>import CoreMotion<br>import Combine<br><br>/// Engineer-level ViewModel:<br>/// built for stability, safety, and clear lifecycle management.<br>final class MotionViewModel: ObservableObject {<br>    private let manager = CMMotionManager()<br>    private let motionQueue = OperationQueue()<br><br>    @Published var pitch: Double = 0<br>    @Published var motionUnavailable = false<br><br>    private var isRunning = false<br><br>    func start() {<br>        // Engineer thinking: never assume hardware is available or stable<br>        guard !isRunning else { return }<br>        guard manager.isDeviceMotionAvailable else {<br>            // Inform the user instead of silently failing — UX matters too<br>            Task { @MainActor in self.motionUnavailable = true }<br>            return<br>        }<br><br>        isRunning = true<br>        manager.deviceMotionUpdateInterval = 1.0 / 60.0 // 60Hz — smooth but battery-aware<br><br>        // Engineer choice: process motion off the main thread to protect UI responsiveness<br>        manager.startDeviceMotionUpdates(using: .xArbitraryZVertical,<br>                                         to: motionQueue) { [weak self] motion, _ in<br>            guard let self, let motion else { return }<br><br>            // Engineer reasoning: gravity is more stable than raw attitude for pitch tracking<br>            let g = motion.gravity<br>            let pitch = atan2(g.x, g.z)<br><br>            // Engineer habit: never touch @Published from a background thread<br>            Task { @MainActor in self.pitch = pitch }<br>        }<br>    }<br><br>    func stop() {<br>        // Clean shutdown — part of being an engineer, not just a coder<br>        guard isRunning else { return }<br>        isRunning = false<br>        manager.stopDeviceMotionUpdates()<br>    }<br>}<br><br>struct ContentView: View {<br>    @StateObject private var vm = MotionViewModel()<br><br>    var body: some View {<br>        Text(String(format: &quot;Pitch: %.1f°&quot;, vm.pitch * 180 / .pi))<br>            .font(.system(size: 20, weight: .medium, design: .rounded))<br>            .padding()<br>            .onAppear { vm.start() }<br>            .onDisappear { vm.stop() }<br>            .alert(&quot;Motion sensor unavailable&quot;,<br>                   isPresented: $vm.motionUnavailable) {<br>                Button(&quot;OK&quot;, role: .cancel) {}<br>            } message: {<br>                Text(&quot;Your device doesn’t support motion detection or permission was denied.&quot;)<br>            }<br>    }<br>}</pre><p>Same task, same platform — but the engineer version thinks about the device, the lifecycle and the user experience, not just the feature.</p><p><strong>4. Craftsmanship and Responsibility</strong><br>When you build independently, there’s no other team to hide behind. That kind of full responsibility changes how you write. Code becomes craftsmanship — something you refine and are willing to put your name under.<br><strong>And if you zoom out, the difference between “I just ship features” and “I own the system” looks like this:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKZwNG9QpdQeWvhbopa1KA.jpeg" /></figure><p><strong>5. The Moment You Realize You’ve Changed</strong><br>You open your terminal, type one simple command…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_S6INkdpG9jekPnKjcUlA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81de51fb71ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>