<?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 Charu Gupta on Medium]]></title>
        <description><![CDATA[Stories by Charu Gupta on Medium]]></description>
        <link>https://medium.com/@charu.dev?source=rss-766e7ff07fee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*E_r82sMuKU-ijYoq.jpg</url>
            <title>Stories by Charu Gupta on Medium</title>
            <link>https://medium.com/@charu.dev?source=rss-766e7ff07fee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:00:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@charu.dev/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[The CocoaPods Clock Is Ticking: What Happens to Flutter on December 2nd?]]></title>
            <link>https://medium.com/@charu.dev/the-cocoapods-clock-is-ticking-what-happens-to-flutter-on-december-2nd-efe7eb3ba82a?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/efe7eb3ba82a</guid>
            <category><![CDATA[cocoapods]]></category>
            <category><![CDATA[swift-package-manager]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 18:37:37 GMT</pubDate>
            <atom:updated>2026-10-20T18:37:37.004Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YkYmXqnkYiO_TJkzJtkxxA.png" /></figure><blockquote><strong>Native iOS developers moved to Swift Package Manager years ago. For Flutter developers, our reckoning is happening right now.</strong></blockquote><p>If you have been doing iOS development for any length of time, you probably have a complicated relationship with CocoaPods.</p><p>On one hand, it carried the entire iOS ecosystem on its back for over a decade. On the other hand, how many hours of your life have you lost troubleshooting pod install failures, fixing broken Ruby gem paths on Apple Silicon Macs, or resolving merge conflicts inside Podfile.lock?</p><p>Back in late 2024, the CocoaPods core team dropped the announcement that signaled the end of an era: <strong>CocoaPods Trunk will permanently become read-only on December 2, 2026.</strong></p><p>They gave the entire software industry a two-year warning runway. When native iOS developers heard the news, most of them just shrugged. They migrated to Apple’s native Swift Package Manager (SPM) back in 2019 or 2020.</p><p><strong>For Flutter developers, however, this is a massive deal.</strong></p><p>Because while native teams have spent the last five years enjoying native Xcode package management, Flutter was completely married to CocoaPods for nearly seven years.</p><p>Every single flutter build ios you ever ran secretly relied on CocoaPods under the hood.</p><p>And despite Flutter recently adding Swift Package Manager support, there is a quiet reality nobody seems to be talking about: <strong>the vast majority of production Flutter apps are still running on CocoaPods today.</strong></p><h3>The Silent “Hybrid Fallback” Trap</h3><p>“Wait,” you might be thinking, “didn’t Flutter already make Swift Package Manager the default?”</p><p>Yes, in recent Flutter releases, SPM is the default package manager. But here is the catch that is catching teams off guard: <strong>Flutter uses a silent hybrid fallback mechanism.</strong></p><p>Think about your app’s pubspec.yaml. You probably have twenty, thirty, or forty plugins for authentication, camera, local storage, analytics, and permissions.</p><p>For a plugin to compile through Swift Package Manager, the plugin maintainer must explicitly add a Package.swift file to their repository.</p><p>Here is what happens right now when you build your Flutter app:</p><ol><li>Flutter checks your plugins for Package.swift.</li><li>If nineteen of your plugins support SPM, but <strong>just one</strong> unmaintained plugin only has a .podspec file, Flutter does not throw an error.</li><li>Instead, Flutter silently falls back to running CocoaPods in the background to handle that single dependency.</li></ol><p>Your build passes. Your CI pipeline is green. You think your app is running purely on modern Apple infrastructure.</p><p>In reality, your codebase is still tethered to CocoaPods, and the clock is ticking down to December 2nd.</p><h3>What Actually Happens on December 2?</h3><p>Let us clear up the panic first: your app will not magically stop compiling on December 3rd.</p><p>The CocoaPods CDN and existing Specs repository will remain accessible online. Historical pods will still download, which means your existing build scripts will still technically fetch old code.</p><p><strong>What changes is that CocoaPods Trunk becomes permanently read-only.</strong></p><p>That means:</p><ul><li>No library author can ever publish a new version of a pod again.</li><li>If Apple releases an iOS update that breaks a plugin, the maintainer cannot publish a patch to CocoaPods.</li><li>Major ecosystem players are already walking away. Google already announced that Firebase would stop publishing new SDK versions to CocoaPods ahead of the deadline.</li></ul><p>If your Flutter app relies on active libraries that receive bug fixes, security patches, or OS compatibility updates, staying on CocoaPods is a dead end.</p><h3>How to Check if Your App Is Secretly Still Using CocoaPods</h3><p>Do not guess whether your app has migrated. You can check in about thirty seconds.</p><p>Open your Flutter project in your code editor and look inside the ios/ folder:</p><ol><li><strong>Do you still see a </strong><strong>Podfile and </strong><strong>Podfile.lock?</strong><br>If those files are still present and actively updating when you run flutter pub get, CocoaPods is still running.</li><li><strong>Open </strong><strong>ios/Runner.xcworkspace in Xcode.</strong><br>Look at your target dependencies. If you still see the Pods-Runner framework linked into your build phases, your project has not completed the transition.</li></ol><h3>The 3-Step Migration Plan for Flutter Teams</h3><p>If you want to get ahead of the December cutoff without scrambling during a critical release sprint, here is what you need to do.</p><h4>Step 1: Audit Your Plugins for Package.swift</h4><p>Look through the plugins in your pubspec.yaml and visit their GitHub repositories. Check if they have a Package.swiftfile in their root or ios/ folder.</p><p>If you find an abandoned plugin that has not been updated in two years and lacks a Package.swift, you have two choices:</p><ul><li>Find a modern, actively maintained replacement.</li><li>Fork the plugin and submit a Package.swift file yourself.</li></ul><h4>Step 2: Ensure Swift Package Manager is Active in Flutter</h4><p>Make sure your team is on a modern version of the Flutter SDK (Flutter 3.44 or later). If you want to force Flutter to use SPM explicitly, you can verify your configuration from the terminal:</p><pre>flutter config --enable-swift-package-manager</pre><p>When you trigger flutter run -d ios, the Flutter CLI will automatically configure your Xcode project to use SwiftPM for compatible plugins.</p><h4>Step 3: De-integrate CocoaPods Once You Are Ready</h4><p>Once all your plugins support Package.swift, you can completely purge CocoaPods from your repository:</p><ol><li>Navigate to your iOS directory and de-integrate the pods:</li></ol><pre>cd ios<br>pod deintegrate</pre><p>2. Delete Podfile, Podfile.lock, and the Pods/ folder.</p><p>3. Open ios/Flutter/Debug.xcconfig and Release.xcconfig. Check if there are any lingering #include lines pointing to Pods/Target Support Files/... and remove them.</p><p>4. Clean your build cache and run:</p><pre>flutter clean<br>flutter pub get<br>flutter run -d ios</pre><h3>The Silver Lining</h3><p>Migrating build infrastructure is rarely fun, but in this case, the destination is so much better than where we started.</p><p>Getting rid of CocoaPods means:</p><ul><li>No more managing Ruby environments or rbenv versions on development machines.</li><li>Significantly faster, cleaner CI/CD runs because Xcode resolves Swift packages natively.</li><li>No more corrupted CocoaPods cache folders or cyclic dependency errors during archive steps.</li></ul><p>CocoaPods served our industry well for over a decade, but its time is up. Take an afternoon this week, audit your ios/directory, and make sure your Flutter app is ready before the Trunk goes dark for good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efe7eb3ba82a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iPhone Duo Is Coming, and Your Flutter App Is Probably Going to Break]]></title>
            <link>https://medium.com/@charu.dev/iphone-duo-is-coming-and-your-flutter-app-is-probably-going-to-break-b34211eb81ae?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/b34211eb81ae</guid>
            <category><![CDATA[iphone-duo]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 06:35:58 GMT</pubDate>
            <atom:updated>2026-10-08T06:35:58.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1y7ynnp7Bjxyhc4GJ4KU_w.png" /></figure><p>In iOS, Apple tells you to ditch UIScreen.main. In Flutter, we have our own traps to worry about.</p><p>If you checked Apple Developer recently, you probably saw the new guide: <strong>“Three steps to make your app shine on iPhone Duo.”</strong></p><p>Apple’s foldable dual-screen hardware is officially on the horizon, and Apple wants apps ready on day one. Their documentation is clear about what native iOS developers need to do: run their Xcode agent skill, stop using UIScreen.main, and test resizing.</p><p><strong>But what if your app is built in Flutter?</strong></p><p>Apple will never write a guide for Flutter developers. If you assume your app will automatically handle a foldable screen just because Flutter is reactive, you are in for a rough surprise.</p><p>Here is what iPhone Duo actually means for Flutter apps, the bad habits waiting in our codebases, and how to fix them.</p><h3>The Big Shift: Mid-Session Resizing</h3><p>The most important detail about iPhone Duo is that <strong>it resizes dynamically while the user is actively using the app</strong>.</p><p>This is not an iPad where someone launches your app in a fixed landscape window. A user might start filling out a form on the compact outer screen, unfold the device to the wide inner display, and expect your app to expand smoothly without losing their place, resetting state, or stuttering.</p><p>Apple also outlined three SDK tiers:</p><ul><li><strong>iOS 26 SDK or earlier:</strong> Apps run in a letterboxed compatibility container with empty space around the window.</li><li><strong>iOS 27 SDK:</strong> Apps resize to fill most of the screen, but avoid the status bar area on the right.</li><li><strong>iOS 27.1 SDK or later:</strong> Full edge-to-edge layout, where toolbars and tab bars dynamically rearrange <strong>vertically</strong>below the status bar.</li></ul><p>If you want your Flutter app to feel native on this hardware, here are four traps you need to clean up right now.</p><h3>1. The Screen Size Trap: Stop Caching Dimensions</h3><p>Apple’s primary rule for native code is to stop reading UIScreen.main.</p><p>In Flutter, we make a similar mistake by reading or caching screen dimensions early in the widget lifecycle:</p><pre>// ❌ Caching screen size in initState<br>class _ProductViewState extends State&lt;ProductView&gt; {<br>  late double screenWidth;<br>@override<br>  void initState() {<br>    super.initState();<br>    // This only runs ONCE. When the user unfolds the phone, this value is completely wrong.<br>    screenWidth = WidgetsBinding.instance.window.physicalSize.width;<br>  }<br>}</pre><p>If you calculate layout dimensions inside initState() or store them in a static variable, your UI will break the second the hinge opens.</p><h4>The Fix:</h4><p>Derive size dynamically inside build() using LayoutBuilder or MediaQuery.sizeOf(context):</p><pre>// ✅ Updates reactively whenever the window resizes<br>@override<br>Widget build(BuildContext context) {<br>  return LayoutBuilder(<br>    builder: (context, constraints) {<br>      if (constraints.maxWidth &gt; 600) {<br>        return DualPaneProductLayout();<br>      }<br>      return SingleColumnProductLayout();<br>    },<br>  );<br>}</pre><p>MediaQuery.sizeOf(context) ensures your widget only rebuilds when the actual dimensions change, avoiding unnecessary rebuilds.</p><h3>2. The flutter_screenutil Problem</h3><p>A lot of Flutter apps rely heavily on packages like flutter_screenutil to scale designs:</p><pre>// Common setup based on a standard phone<br>ScreenUtil.init(context, designSize: const Size(375, 812));<br>// In widgets<br>Container(<br>  width: 150.w,<br>  height: 50.h,<br>  child: Text(&quot;Checkout&quot;, style: TextStyle(fontSize: 16.sp)),<br>)</pre><p>This works reasonably well on standard phones. On iPhone Duo, it creates a mess.</p><p>When a user unfolds to the inner display, width jumps from roughly 390pt to over 800pt. If your code scales widths and font sizes against a fixed 375pt base, buttons stretch across the entire screen, icons balloon in size, and text looks cartoonishly large.</p><p><strong>What to do instead:</strong><br>Stop scaling UI elements proportionally to screen width. Use fixed spacing tokens (8pt, 16pt, 24pt padding), flexible Rowand Column widgets, and LayoutBuilder breakpoints. An unfolded screen needs <strong>more visible content</strong>, not larger buttons.</p><h3>3. Orientation is Deceptive on Foldables</h3><p>Apple specifically tells native devs to remove UIDevice.current.orientation. Physical device rotation no longer tells you what shape the window is.</p><p>In Flutter, many of us still do this:</p><pre>// ❌ Wrong assumption<br>if (MediaQuery.orientationOf(context) == Orientation.landscape) {<br>  return ShowTwoColumns();<br>}</pre><p>When an iPhone Duo is unfolded in normal portrait mode, the display is almost a square. It is plenty wide enough for two columns of content, yet orientationOf(context) will still report Orientation.portrait.</p><p>If your app waits for landscape mode to reveal tablet layouts, it will waste half the display on an unfolded device.</p><p><strong>Base your layout decisions on aspect ratio and available width instead:</strong></p><pre>// ✅ Check width and aspect ratio<br>final size = MediaQuery.sizeOf(context);<br>final isWide = size.width &gt; 600;<br>final isLandscapeShape = (size.width / size.height) &gt; 1.2;</pre><h3>4. The Hinge and Tabletop Mode: Use displayFeatures</h3><p>Apple highlighted <strong>Tabletop (propped) mode</strong>: resting the phone half-folded at a 90-degree angle like a mini laptop.</p><p>For a media app, that means video on the top half and playback controls or comments on the bottom half.</p><p>Flutter actually has native support for this through <strong>MediaQuery.displayFeaturesOf(context)</strong>:</p><pre>final displayFeatures = MediaQuery.displayFeaturesOf(context);<br>for (final feature in displayFeatures) {<br>  if (feature.type == DisplayFeatureType.hinge || <br>      feature.type == DisplayFeatureType.fold) {<br>    <br>    // Check if the user has propped the phone half-open<br>    if (feature.state == DisplayFeatureState.postureHalfOpened) {<br>      return TabletopLayout(hingeBounds: feature.bounds);<br>    }<br>  }<br>}</pre><p>The bounds property gives you the exact pixel rectangle of the physical crease, so you can prevent important buttons or text inputs from sitting directly across the fold.</p><h3>5. Watch Out for Vertical Bars in iOS 27.1</h3><p>On the inner screen in iOS 27.1, toolbars and tab bars shift to a <strong>vertical column below the status bar</strong> on the side.</p><p>Standard Flutter widgets wrapped in SafeArea will adapt automatically through MediaQuery.paddingOf(context).</p><p>However, if your app uses custom floating navigation bars or overrides safe areas with extendBody: true, your content will collide with the side rail. Always inspect horizontal safe area insets (padding.left and padding.right) in addition to top and bottom padding.</p><h3>Quick Testing in Xcode</h3><p>You do not need physical hardware to verify this.</p><p>In Xcode 27.1, launch the <strong>iPhone Duo Simulator</strong> and run your app (flutter run -d &quot;iPhone Duo&quot;). Use the simulator inspector to switch between postures: <strong>Folded</strong>, <strong>Flat</strong>, and <strong>Tabletop</strong>.</p><p>Watch how your app handles the transition. Does the layout adjust cleanly, or do forms reset and text overflow?</p><h3>Final Thoughts</h3><p>Whenever Apple introduces a new hardware form factor, there is an initial scramble.</p><p>The encouraging news is that <strong>Flutter’s declarative widget tree is naturally suited for foldables</strong>. We do not have to fight storyboard constraints or complex view controller lifecycles.</p><p>If your app uses clean LayoutBuilder boundaries, flexible layouts, and dynamic media queries, it will handle iPhone Duo without friction.</p><p>Now is the time to audit your codebase for static pixel multipliers and orientation checks, before users unfold their phones and find those bugs for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b34211eb81ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Tried Device Hub in Xcode 27 and I’m Not Going Back to Simulator]]></title>
            <link>https://medium.com/@charu.dev/i-tried-device-hub-in-xcode-27-and-im-not-going-back-to-simulator-76ee91c54ada?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/76ee91c54ada</guid>
            <category><![CDATA[wwdc]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ios-development]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 09:07:39 GMT</pubDate>
            <atom:updated>2026-09-16T09:07:39.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMq4dpd3YESD5r7W64nj3Q.png" /></figure><p>You know that feeling when Apple drops something at WWDC and you’re like “okay, cool, but will I actually use this?” That was me with Device Hub. A standalone app for managing simulators and devices? Sounded like a fancy wrapper around what we already had.</p><p>Then I actually used it.</p><h3>The moment it clicked</h3><p>I was working on a Flutter app — a food delivery app with a pretty detailed order tracking screen. Maps, status updates, ETAs, the whole thing. I’d been testing it on a single iPhone 16 Pro simulator and everything looked great. Ship it, right?</p><p>Wrong.</p><p>A friend tested the build on her iPhone SE (3rd gen) and texted me a screenshot. The order status card was overlapping the map. The delivery ETA was literally sitting behind the “Track Order” button. It looked broken.</p><p>The problem? I’d never actually tested at a smaller screen size with larger Dynamic Type. Classic.</p><p>Now normally, this is where I’d start the painful dance -&gt; open Simulator, boot an SE, manually go into Settings &gt; Accessibility &gt; Display &amp; Text Size, bump it up, relaunch the app, check it, go back, change something else. You know the drill.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*lzRy47zdvrpIRxHYD6OiKQ.png" /></figure><p>With Device Hub, I did all of this without leaving one window.</p><h3>Instant Dynamic Type and Dark Mode toggling</h3><p>This is honestly the feature that sold me. You can change the text size with a slider and it takes effect <em>instantly</em>. No navigating through three levels of Settings menus on the simulator. No relaunching.</p><p>I bumped the Dynamic Type to the largest accessibility size and immediately saw my Text widgets overflowing their containers. Then I toggled dark mode in just one click and spotted that my status badge was using a hardcoded color that became invisible against the dark background.</p><p>Two bugs found in about 30 seconds. Previously that would’ve been a 5-minute round trip each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*96Nf6QELBUropXsHGB45-w.png" /></figure><h3>My actual debugging workflow</h3><p>Here’s what happened step by step. I’m sharing this because I genuinely think this workflow is faster than anything I’ve done before.</p><p><strong>1. Open multiple simulators at once</strong></p><p>I selected iPhone SE, iPhone 16, and iPhone 16 Pro Max from the device list, opened them all as compact windows side by side. Three screen sizes, one glance.</p><p><strong>2. Spot the bug</strong></p><p>The SE was clearly broken at large text. The 16 Pro Max looked fine. The regular 16 was borderline; the text was fitting, but just barely. So this was a constraint issue that only showed up at smaller widths + larger type.</p><p><strong>3. Simulate the exact conditions</strong></p><p>I set the SE simulator’s location to a specific coordinate (I needed the map to show a real delivery route to test the full layout). Changed Dynamic Type to XXL. Rotated to landscape. All without touching the simulator’s Settings app.</p><p>That’s when I saw the <em>real</em> problem i.e in landscape with large text, the bottom sheet was pushing the map off screen entirely. The SafeArea wasn&#39;t accounting for the Dynamic Type changes to the bottom sheet height.</p><p><strong>4. Grab the app data</strong></p><p>Device Hub lets you download the app’s data container. I grabbed the container with the specific order state that was causing the layout issue, so I could restore it later for regression testing after my fix.</p><p>This is underrated. Before this, I’d have to set up a specific app state every time I wanted to test a particular scenario. Now I just snapshot it and restore whenever.</p><h3>The little things that matter</h3><p>Some features don’t sound exciting until you’ve needed them:</p><ul><li><strong>Capture Keyboard</strong>: routes your Mac keyboard input directly to the simulator. I use this to test search flows without clicking into the simulator first. Small thing, but less friction.</li><li><strong>1:1 physical size</strong>: snaps the simulator to the exact real-world dimensions of the device. I used this to check if my tap targets were actually thumb-friendly on the SE. (Spoiler: they weren’t.)</li><li><strong>Contextual hardware controls</strong>: when I switched to testing on an Apple Watch simulator, the controls changed to show the Digital Crown and side button. No more hunting for the right menu items.</li></ul><h3>devicectl for CI</h3><p>This one’s for the automation nerds. Device Hub has a command-line companion called devicectl. Same underlying tech, but scriptable.</p><p>I’m already thinking about adding it to my CI pipeline:</p><pre># Switch to dark mode before running screenshot tests<br>devicectl modify device --device &lt;id&gt; appearance dark<br># List all available devices as JSON<br>devicectl list devices --json-output</pre><p>The --json-output flag makes it dead simple to parse in scripts. Imagine running your screenshot tests across light/dark mode automatically, or validating layout at different text sizes in CI. That&#39;s the real power here.</p><h3>What I’d still like to see</h3><p>It’s not perfect. A few things on my wishlist:</p><ul><li><strong>Side-by-side diff view</strong>: I want to see two simulators overlaid or diffed pixel-by-pixel. Would make responsive testing even faster.</li><li><strong>Preset configurations</strong>: let me save “SE + Large Type + Dark Mode + Landscape” as a preset I can load with one click.</li><li><strong>Flutter hot reload integration</strong>: right now I still need Xcode or VS Code running alongside it. Would be cool if Device Hub could trigger a reload.</li></ul><h3>Bottom line</h3><p>Device Hub isn’t just a fancier Simulator window. It’s a workflow shift. The fact that I can configure appearance, simulate locations, manage app data, and control multiple devices, all without opening a single Settings menu on the simulator, has genuinely changed how I test.</p><p>If you’re still manually navigating to Settings &gt; Developer &gt; Dark Mode every time you need to test appearance… just try Device Hub once. You’ll get it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76ee91c54ada" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Nested Cards Look “Off” in SwiftUI (And How to Fix It with Concentric Math)]]></title>
            <link>https://medium.com/@charu.dev/why-your-nested-cards-look-off-in-swiftui-and-how-to-fix-it-with-concentric-math-2517e4394017?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/2517e4394017</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 20:24:51 GMT</pubDate>
            <atom:updated>2026-08-18T20:24:51.420Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUOxoal-eWrtDg1SYuisuw.png" /></figure><p>A few days ago, I was working on a custom floating overlay card in one of my SwiftUI projects.</p><p>You know the pattern: a draggable card that users can flick around the screen (like a Picture-in-Picture video or an interactive mini-player).</p><p>Everything worked fine functionally, but visually, it was driving me crazy.</p><p>Whenever I dragged the card into the corners of the iPhone screen, it looked completely mismatched. If I gave the card a fixed corner radius of 16pt, it looked sharp and awkward sitting inside the iPhone&#39;s massive 55pt screen curves. But if I gave it a large radius like 40pt, it looked like a bloated pill whenever it was floating in the center of the screen.</p><pre>The Goal: <br>Center of screen  -&gt; Square-ish / Subtle corners (0 - 12pt)<br>Dragged to corner -&gt; Seamlessly morphs to match the device curve (40 - 50pt)</pre><p>In the past, I’ve seen (and honestly, written) some pretty cursed workarounds for this. But now I decided to stop hacking it and figure out the actual math behind how Apple’s UI achieves those buttery, concentric nested curves.</p><p>Here is what I learned, how the math works, and how I built a real-time morphing prototype in SwiftUI.</p><h3>The Optical Problem (Why Fixed Radii Look “Off”)</h3><p>The reason nested corners look weird isn’t just about matching the outer number.</p><p>If you put a card with radius: 40 inside a container with radius: 40 with 16pt padding, the corner curves don&#39;t share the same center point. The inner curve finishes too early, creating a cramped, uneven gap at the diagonal.</p><p>To make curves look truly concentric (sharing the exact same center origin), the formula is surprisingly straightforward:</p><pre>Inner Radius = Container Radius - Distance from Corner</pre><p>If your container corner is 52pt and your view is inset by 16pt:</p><pre>InnerRadius = 52 - 16 = 36</pre><p>The tricky part? When a view is <strong>moving</strong>, all four corners are at different distances from the container edges at any given moment.</p><ul><li>Near the top-left corner? Only <strong>Top-Leading</strong> should morph up to ~42pt.</li><li>The other three corners? They should stay at 0pt (square).</li><li>In the center? All four corners decay to 0pt.</li></ul><h3>Building the Calculation Engine</h3><p>To handle this dynamically on every frame of a drag gesture, I wrote a small calculation helper.</p><p>It measures the euclidean distance from each corner of the card to its corresponding corner on the parent container, and clamps the result so it never goes negative or exceeds what the card’s dimensions can physically render:</p><pre>import SwiftUI<br>public struct ConcentricRadiiCalculator {<br>    public static func calculate(<br>        innerFrame: CGRect,<br>        containerBounds: CGRect,<br>        containerRadius: CGFloat<br>    ) -&gt; RectangleCornerRadii {<br>        // Measure distance from each corner to outer container corner<br>        let distTL = hypot(<br>            innerFrame.minX - containerBounds.minX,<br>            innerFrame.minY - containerBounds.minY<br>        )<br>        let distTR = hypot(<br>            containerBounds.maxX - innerFrame.maxX,<br>            innerFrame.minY - containerBounds.minY<br>        )<br>        let distBL = hypot(<br>            innerFrame.minX - containerBounds.minX,<br>            containerBounds.maxY - innerFrame.maxY<br>        )<br>        let distBR = hypot(<br>            containerBounds.maxX - innerFrame.maxX,<br>            containerBounds.maxY - innerFrame.maxY<br>        )<br>        <br>        let maxRadius = min(innerFrame.width, innerFrame.height) / 2.0<br>        <br>        func radius(for distance: CGFloat) -&gt; CGFloat {<br>            let calculated = containerRadius - distance<br>            return max(0, min(maxRadius, calculated))<br>        }<br>        <br>        return RectangleCornerRadii(<br>            topLeading: radius(for: distTL),<br>            bottomLeading: radius(for: distBL),<br>            bottomTrailing: radius(for: distBR),<br>            topTrailing: radius(for: distTR)<br>        )<br>    }<br>}</pre><h3>Hooking It Up to UnevenRoundedRectangle</h3><p>To make this completely modular and reusable, we can encapsulate the calculations, clipping, and drag gestures inside a custom ViewModifier and expose it via a clean View extension:</p><pre>import SwiftUI<br><br>// 1. Define the custom ViewModifier<br>struct ConcentricCornerRadiusModifier: ViewModifier {<br>    let containerRadius: CGFloat<br>    @State private var position: CGPoint?<br>    @State private var dragStart: CGPoint?<br>    let cardSize = CGSize(width: 190, height: 130) // Customizable card dimensions<br>    <br>    func body(content: Content) -&gt; some View {<br>        GeometryReader { geometry in<br>            let bounds = geometry.frame(in: .local)<br>            let currentPos = position ?? CGPoint(x: bounds.midX, y: bounds.midY)<br>            <br>            let cardFrame = CGRect(<br>                x: currentPos.x - cardSize.width / 2,<br>                y: currentPos.y - cardSize.height / 2,<br>                width: cardSize.width,<br>                height: cardSize.height<br>            )<br>            <br>            // Compute live concentric corner radii<br>            let radii = ConcentricRadiiCalculator.calculate(<br>                innerFrame: cardFrame,<br>                containerBounds: bounds,<br>                containerRadius: containerRadius<br>            )<br>            <br>            content<br>                .frame(width: cardSize.width, height: cardSize.height)<br>                // Clip content using Apple&#39;s smooth continuous squircle style<br>                .clipShape(UnevenRoundedRectangle(cornerRadii: radii, style: .continuous))<br>                .position(currentPos)<br>                .gesture(<br>                    DragGesture()<br>                        .onChanged { value in<br>                            if dragStart == nil { dragStart = currentPos }<br>                            guard let start = dragStart else { return }<br>                            <br>                            let proposed = CGPoint(<br>                                x: start.x + value.translation.width,<br>                                y: start.y + value.translation.height<br>                            )<br>                            position = clamp(proposed, to: bounds)<br>                        }<br>                        .onEnded { _ in<br>                            dragStart = nil<br>                        }<br>                )<br>        }<br>    }<br>    <br>    private func clamp(_ point: CGPoint, to bounds: CGRect) -&gt; CGPoint {<br>        let halfW = cardSize.width / 2<br>        let halfH = cardSize.height / 2<br>        return CGPoint(<br>            x: min(max(point.x, bounds.minX + halfW), bounds.maxX - halfW),<br>            y: min(max(point.y, bounds.minY + halfH), bounds.maxY - halfH)<br>        )<br>    }<br>}<br><br>// 2. Expose the modifier via a clean View extension<br>extension View {<br>    func concentricCornerRadius(containerRadius: CGFloat) -&gt; some View {<br>        self.modifier(ConcentricCornerRadiusModifier(containerRadius: containerRadius))<br>    }<br>}</pre><h4>How you use it in production:</h4><p>Now, any view can become a morphing, draggable floating card with just a single line of code:</p><pre>struct FloatingOverlayView: View {<br>    var body: some View {<br>        ZStack {<br>            // Your custom card design<br>            RoundedRectangle(cornerRadius: 0)<br>                .fill(Color.blue.gradient)<br>                .overlay(Text(&quot;Drag Me!&quot;).foregroundColor(.white).bold())<br>        }<br>        .concentricCornerRadius(containerRadius: 54.0) // 👈 Simple concentric wrapping!<br>    }<br>}</pre><h3>What I Discovered While Building This</h3><ol><li><strong>You don’t need private APIs for screen corners anymore:</strong> By letting your root container pass down its geometry, child components naturally align with whatever container they are in — whether it’s an iPhone screen, an iPad floating sheet, or a custom modal.</li><li><strong>Always use </strong><strong>.continuous:</strong> Standard circular corners look slightly pinched where the curve meets the straight edge. Squircle (.continuous) makes the morphing feel organic.</li><li><strong>The tactile feel is night and day:</strong> Playing with this in the simulator, dragging the card toward a corner and watching just that single corner flare up to hug the bezel makes the app feel like a first-party Apple experience.</li></ol><p>I ended up packaging this into a small demo project with debug badges to inspect the exact numbers in real-time as I drag the view around.</p><p>How are you currently handling container-aware corner radii or nested cards in your SwiftUI apps? Let me know in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2517e4394017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escaping the SwiftUI Performance Trap: 4 Hard Lessons from Production]]></title>
            <link>https://medium.com/@charu.dev/escaping-the-swiftui-performance-trap-4-hard-lessons-from-production-77f59476c2d7?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/77f59476c2d7</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Fri, 14 Aug 2026 19:10:22 GMT</pubDate>
            <atom:updated>2026-08-14T19:10:22.620Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HizNOlK8ZVVdEMLEFby23Q.png" /></figure><p>When you first start building with SwiftUI, everything feels deceptively simple. You chain a few modifiers, watch the preview canvas render in real-time, and ship screens twice as fast as UIKit.</p><p>Then the app grows. You plug in a real REST API, nested lists, and paginated data.</p><p>Suddenly, scrolling drops to 30 fps, your iPhone 15 heats up like a pocket warmer, and you’re stuck looking at Instruments wondering why toggling a dark mode toggle triggers 40 view updates.</p><p>SwiftUI abstracts away the rendering pipeline, making it easy to introduce subtle performance traps. Here are four architectural mistakes I’ve run into — and how to fix them.</p><h3>1. The Monolithic body Trap</h3><p>When moving quickly, dumping an entire screen’s layout into a single, massive body property is tempting.</p><pre>// ❌ Avoid: Any minor state update recalculates the entire dashboard<br>struct DashboardView: View {<br>    @State private var isBookmarked = false<br>    <br>    var body: some View {<br>        VStack {<br>            HeaderSection()<br>            UserProfileSummary()<br>            HeavyActivityFeed(isBookmarked: isBookmarked)<br>        }<br>    }<br>}</pre><p>SwiftUI calculates UI changes by diffing view hierarchies. When a 1,000-line monolithic struct depends on state, <em>any</em>update forces the framework to evaluate that entire tree. While instantiating a Swift struct is cheap, evaluating complex view trees and dependency graphs is not.</p><blockquote><strong><em>Tip:</em></strong><em> Stick </em><em>let _ = Self._printChanges() inside your </em><em>body during debugging. It will print the exact property causing SwiftUI to re-evaluate the view.</em></blockquote><p><strong>The Fix:</strong> Split screens into small, isolated subviews with targeted state dependencies.</p><h3>2. State Invalidation &amp; The @Observable Migration</h3><p>State over-scoping is one of the quickest ways to cause cascading view redraws.</p><p>In older SwiftUI codebases (iOS 14–16), putting reference types in @ObservedObject instead of @StateObject caused view models to get recreated on parent re-evaluations. In modern SwiftUI (iOS 17+), using the new @Observable macro solves many of these pitfalls because SwiftUI tracks property access down to individual fields rather than invalidating the entire view on any @Published change.</p><pre>// Modern iOS 17+ Observation ensures only views reading specific properties re-render<br>@Observable<br>final class FeedViewModel {<br>    var items: [Item] = []<br>    var isRefreshing = false<br>}</pre><p><strong>The Fix:</strong> Keep state as local as possible. If you’re on iOS 17+, migrate from ObservableObject to @Observable to prevent unnecessary view invalidations.</p><h3>3. The GeometryReader Trap</h3><p>GeometryReader is a powerful tool, but it&#39;s often misused as a general layout helper.</p><p>Because GeometryReader greedily expands to occupy all available parent space, it can easily break flex layouts. Even worse, feeding geometry data back up into an ancestor’s @State via preferences can trigger infinite render loops and dropped frames.</p><p><strong>The Fix:</strong></p><ul><li>For iOS 16+, look into the Layout protocol for custom layout logic.</li><li>For iOS 17+, use modern modifiers like .onGeometryChange(for:of:action:) or .visualEffect instead of wrapping entire views in GeometryReader.</li></ul><h3>4. Eager Stacks in ScrollViews</h3><p>The standard VStack and HStack are eager containers—they instantiate and layout every single child view upfront, whether visible on screen or not.</p><p>I saw this firsthand on a financial dashboard transaction history. With 10 mock items, ScrollView { VStack { ... } } ran at 120Hz. But when loaded with 3 years of transaction history, memory spiked past 400MB and scrolling stuttered heavily.</p><pre>// ❌ Eager: Allocates 5,000 rows into memory immediately<br>ScrollView {<br>    VStack {<br>        ForEach(transactions) { TransactionRow(item: $0) }<br>    }<br>}</pre><pre>// ✅ Lazy: Only allocates and renders visible rows<br>ScrollView {<br>    LazyVStack(spacing: 12) {<br>        ForEach(transactions) { TransactionRow(item: $0) }<br>    }<br>}</pre><p><strong>The Fix:</strong> Default to LazyVStack / LazyHStack (or List, which leverages UIKit cell recycling) whenever dealing with dynamic or unbounded datasets.</p><h3>Key Takeaways</h3><ol><li>Keep your view structs tiny and isolated.</li><li>Debug render triggers using Self._printChanges().</li><li>Prefer modern iOS 17 @Observable and .visualEffect over heavy legacy workarounds.</li><li>Never put an unbounded eager VStack inside a ScrollView.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77f59476c2d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apple Intelligence is Magic. Building it is Dark Magic.]]></title>
            <link>https://medium.com/@charu.dev/apple-intelligence-is-magic-building-it-is-dark-magic-27e98ffa19d8?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/27e98ffa19d8</guid>
            <category><![CDATA[siri]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple-intelligence]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 17:36:41 GMT</pubDate>
            <atom:updated>2026-08-13T16:09:28.876Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8mLGk-pH20NDEpJXsMLHpQ.png" /></figure><p>I’ve been spending my late nights lately working on a side project called Brew Sixty. It’s a coffee brewing companion for the iPhone. Because as a software engineer, over-engineering my morning caffeine routine is practically a legal requirement.</p><p>The app helps you build recipes, save presets, and run step-by-step brew timers. But if you’ve ever manually brewed a Pour-over, you know the struggle: you are usually elbow-deep in coffee grounds, holding a kettle of boiling water, and desperately trying not to drop a ₹1.5 lakh glass rectangle into a V60 dripper. It’s the absolute worst time to be tapping on a screen with wet hands.</p><p>So, naturally, I took this as a personal challenge to dive headfirst into Apple’s new App Intents API.</p><p>For those not wrestling with iOS every day, App Intents are basically the underlying plumbing for Apple Intelligence. They let you expose your app’s internal brain to the OS so Siri can run actions without the user ever opening the app.</p><p>My goal was simple: I wanted to shout at my phone from across the kitchen like a typical Indian dad asking for his morning chai. <em>“Hey Siri, start my V60 brew timer.”</em></p><p>I even pushed it a step further with screen awareness. If I have a recipe open, I can just say, <em>“Adjust my coffee ratio to 1:15,”</em> and Siri reads the context off the screen, executes the intent, and recalculates the water math in real time.</p><p>The first time it worked on a real device, I felt like I had just built my own desi JARVIS. The screen flashed, the timer started ticking, and the recipe updated. I leaned back, took a sip of coffee, and thought: <em>Okay, we are officially living in the future.</em></p><p>And then… I tried to debug it.</p><p>That’s when the WWDC magic trick wore off, and the reality of early-adopter pain set in.</p><p>Building and debugging App Intents right now feels less like modern software engineering and more like performing dark magic rituals. For starters, the iOS simulator has the memory retention of a goldfish. You’ll rewrite your Swift code, hit compile, ask Siri to execute the action, and… absolute radio silence. The system completely ignores your update. You spend the next 45 minutes questioning your life choices, only to realize the simulator just felt like caching an intent from three days ago. <em>(Pro tip: Your only real cure is deleting the app, restarting Xcode, and hanging a nimbu-mirchi on your Mac).</em></p><p>Worse, when a multi-step Siri conversation fails, there are no error logs. No stack traces. Siri just blinks her pretty glowing orb at you and gives you the silent treatment. It is passive-aggressive software engineering at its finest.</p><p>Don’t get me wrong, I’m completely hooked. When it works, controlling your app with hands-free, contextual voice commands feels incredible. It really <em>is</em> the future of mobile UI.</p><p>But right now? Apple is selling us the polished dream of Apple Intelligence, while the underlying developer tools feel like they are held together by duct tape, hope, and a lot of caffeine.</p><p>I’m keeping the Siri integrations in Brew Sixty because the payoff is worth the headache, but the tax on my sanity is real.</p><p>Are any of you actually shipping complex App Intents in production right now, or are we all just hiding them in side projects and screaming at the simulator in private? What’s the one Siri feature you’re trying to build that’s currently testing your patience?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27e98ffa19d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Managed Not to Get Tangled Between Swift and Flutter]]></title>
            <link>https://medium.com/@charu.dev/how-i-managed-not-to-get-tangled-between-swift-and-flutter-2dae8c513844?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dae8c513844</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 18:55:40 GMT</pubDate>
            <atom:updated>2026-07-26T18:55:40.853Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRUx8NWMKJox4S9R5BUs6A.png" /></figure><p>Eight years ago, I passed a basic data structures test, landed a job at IBM, and was thrown into an iOS training program.</p><p>I instantly fell in love. I was so fascinated by how mobile apps actually worked. Back then, I knew exactly how everything functioned under the hood.</p><p>Over the years, the tech landscape shifted. Clients started wanting different things. I picked up Angular, React Native, and eventually Flutter. The transitions happened so smoothly that I barely even noticed when my primary tech stack completely flipped from native iOS to cross-platform. To the user, an app is an app. As long as it looks the same on the screen, who cares?</p><p>But fast forward to my fourth year as a developer. I was sitting in a technical interview, and the interviewer asked me a straightforward question about handling state and UI updates under the hood.</p><p>I paused.</p><p>In my head, two different answers started fighting each other. One was how Swift handles state updates in memory. The other was how Flutter’s element tree rebuilds widgets. For three agonising seconds, my brain just sat there context-switching between two completely different ecosystems.</p><p>I gave a decent answer, but as I walked away from that interview, the realisation hit me hard: I was losing my edge.</p><h3>The Horizontal Drift</h3><p>I was successfully juggling two or three ecosystems at once. I was delivering fast, clean features. But I had quietly fallen into a trap: <strong>I knew exactly <em>how</em> to build things, but I was forgetting <em>why</em>.</strong></p><p>When you work across multiple frameworks, you become incredibly good at horizontal problem-solving. You know that to make a list in iOS, you drag and drop a UITableView, and in Flutter, you write a ListView. You know which tool to reach for to hit your Friday deadline.</p><p>But my vertical depth had stalled. My mental models had turned into a messy, tangled soup of Swift and Dart. I had years of experience on paper, but I was operating entirely on surface-level muscle memory.</p><h3>The Hard Reset: Going Vertical And Untangling the Mess</h3><p>Before taking my next career step, I realised I needed a hard reset. I couldn’t just keep piling new frameworks on top of a shaky foundation. I had to step back, untangle my brain, and rebuild my fundamentals from first principles.</p><p>But I didn’t have the time to open ten different massive textbooks and cross-reference thousands of tabs on Stack Overflow.</p><p>So, I took a different approach. I used AI to build a personalized engineering curriculum.</p><p>Instead of using AI tools to write code for me, I used them to author custom “comparison books” tailored perfectly to my broken mental models. I gave the AI a prompt like:</p><p><em>“Write me a deep-dive chapter comparing exactly how Swift (a multi-threaded language) handles background tasks versus Dart (a single-threaded language with an Event Loop). Start from the absolute basics, like ‘what is a class,’ and scale up to advanced architecture.”</em></p><p>Seeing the differences mapped out side-by-side about how Swift uses protocols while Dart uses mixins, finally untangled the mess in my head.</p><h3>Year 8: Building Small to Think Deep</h3><p>Today, at the eight-year mark of my career, I am fully confident moving between tech stacks because that “hard reset” wasn’t just a one-time event; it became my permanent way of working.</p><p>I completely stopped building massive, sprawling apps. Instead, I started creating tiny, highly focused Git repositories. I built small projects specifically designed to test the newest WWDC features, integrate modern AI APIs, and set up proper App Store publishing pipelines.</p><p>Every time I wrote a line of code, I forced myself to pause and answer one simple question: <em>“Why am I writing this specific line, and how is the framework actually executing it?”</em></p><h3>The Best Thing You Can Do For Your Career</h3><p>If there is one thing this journey has taught me, it’s that it is incredibly easy to let the industry pull you horizontally. We are expected to learn a new framework every six months just to stay relevant.</p><p>But eventually, you have to hit pause.</p><p>It is completely fine to step back and admit your mental models have blurred. At the end of the day, no one cares how many frameworks you can glue together if you don’t know how they actually work. Sometimes, you just have to swallow your pride, open a blank project, and start over from page one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dae8c513844" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Illusion of Speed: The Psychology of Making Slow Software Feel Magical]]></title>
            <link>https://medium.com/@charu.dev/the-illusion-of-speed-the-psychology-of-making-slow-software-feel-magical-64b1be001592?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/64b1be001592</guid>
            <category><![CDATA[psychology]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ui-design]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 08:50:42 GMT</pubDate>
            <atom:updated>2026-07-23T12:37:18.263Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4pydG-0u0RTecCy_n-p8A.png" /></figure><p>Have you ever pressed the button calling for an elevator, only to realise the ring around the button didn’t light up? What did you do?</p><p>If you are like most human beings, you probably pressed it again. Harder. Maybe three or four times in rapid succession.</p><p>You didn’t press it again because you thought the elevator was broken; you pressed it because your brain received <strong>zero visual feedback</strong>. Without that instant confirmation that your request was heard, two seconds of waiting suddenly feels like an eternity.</p><p>In software engineering, we spend years obsessing over raw, mathematical speed. We upgrade servers, refactor databases, and boast about animations that render at a silky-smooth 60 frames per second. But here is the uncomfortable truth: <strong>You can write the fastest code in the world, but if you don’t understand human psychology, your app will still feel like garbage.</strong></p><p>Today, the line between a mediocre app and a world-class app is about the art of using design and psychology to trick the human brain into thinking software is instantaneous, even when it’s not.</p><h3>The Engineer’s Trap: Raw Speed vs. Perceived Speed</h3><p>Early in my engineering career, I fell into a common trap. I was tasked with making a sluggish user profile screen load faster. I spent days refactoring the underlying code, optimizing data models, and shaving a massive 500 milliseconds off the processing time. I was thrilled.</p><p>When we showed it to users, their feedback was crushing: <em>“It still feels really slow.”</em></p><p>Why? Because while my code was fast, the user was still sitting on a subway with a terrible mobile connection, waiting three seconds for the server to reply. During those three seconds, the app just sat there staring blankly at them.</p><p>To the computer, the app was 500 milliseconds faster. To the human being holding the phone, nothing had changed.</p><p>That was the day I learned that <strong>actual speed is an engineering problem, but perceived speed is a psychological problem.</strong> To build products that feel magical, you have to stop trying to beat the laws of physics and start learning how to politely lie to your users.</p><h3>Three “White Lies” We Tell to Make Software Feel Instant</h3><p>When you use your favorite apps today, whether it’s Instagram, WhatsApp, or Airbnb, you are experiencing a masterclass in psychological sleight of hand. Here are three architectural tricks we use to make apps feel lightning fast, even when the internet is crawling.</p><h3>1. The Skeleton Screen (The Psychology of Waiting)</h3><p>For years, the standard way to tell a user “please wait” was a spinning circle (the dreaded loading spinner).</p><p>Psychologically, a spinning circle is the worst thing you can put on a screen. It acts like a ticking clock. It draws the user’s eye to a single point of failure and reminds them that they are waiting for something out of their control.</p><p>Today, modern apps use <strong>Skeleton Loaders</strong>. Instead of a spinner, the app instantly renders gray, pulsing placeholder blocks where the text and pictures will eventually appear.</p><ul><li><strong>Why it tricks the brain:</strong> A skeleton screen gives the illusion of <em>progress</em>. It tells the user’s brain, <em>“Look, the page is already built! We’re just dropping the final paint on the walls.”</em> Studies show that users consistently rate screens with skeleton loaders as being faster than screens with spinners, even when the actual loading time is identical.</li></ul><h3>2. Optimistic UI (The Confident Lie)</h3><p>Imagine you are sitting in a coffee shop with a patchy Wi-Fi connection. You open a social media app, double-tap a photo to like it, and the red heart instantly pops onto the screen. You close the app and walk away, feeling satisfied.</p><p>Here is what actually happened behind the scenes: when you tapped that heart, the app <strong>did not wait</strong> to hear back from the server. It knew the internet was slow, so it told a confident lie. It immediately painted the red heart on your screen and said, <em>“Done!”</em></p><p>In the background, while you were putting your phone away, the app quietly kept trying to contact the server to register your like.</p><ul><li><strong>Why it tricks the brain:</strong> This technique is called <strong>Optimistic UI</strong>. Instead of making the user wait for the internet to confirm an action, the app assumes success and updates the screen instantly. If the background network request eventually fails, the app will quietly revert the red heart and show a subtle error. But 99% of the time, it succeeds, and the user experiences zero latency.</li></ul><h3>3. Interactive Distractions (Buying Time)</h3><p>Have you ever pulled down on a list to refresh your feed, and noticed a playful little animation, maybe a logo spinning, a little character bouncing, or a rubber-band stretching effect?</p><p>That animation isn’t just there to look pretty. It is deliberately designed to <strong>buy time</strong>.</p><ul><li><strong>Why it tricks the brain:</strong> Human beings are visual creatures. When an animation is delightful and interactive, it occupies our working memory. By giving the user’s thumb something responsive to play with for half a second, we distract them just long enough for the background code to finish fetching the latest data. We turn a frustrating delay into a micro-moment of entertainment.</li></ul><h3>Software is an Experience, Not Just Math</h3><p>As developers, it is easy to get tunnel vision. We fall in love with our clean architectures, our compiled binary sizes, and our millisecond execution benchmarks. But code is never run in a vacuum; it is run in the hands of impatient, distracted human beings trying to get on with their day.</p><p>The next time you find yourself trying to optimise a slow feature, don’t just ask, <em>“How can I make this algorithm run faster?”</em></p><p>Step back and ask, <em>“What is the user’s brain doing right now? How can I give them immediate feedback? How can I make this wait feel like an instant?”</em></p><p>Because at the end of the day, users don’t care about your CPU cycles. They don’t care about your 60 frames per second. They only care about how your software makes them feel — and sometimes, a polite, well-timed visual lie is the most empathetic engineering decision you can make.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64b1be001592" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Great iOS Migration: Escaping the Loading Bar]]></title>
            <link>https://medium.com/@charu.dev/the-great-ios-migration-escaping-the-loading-bar-9d425b4a7742?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d425b4a7742</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[evolution]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 05:54:51 GMT</pubDate>
            <atom:updated>2026-07-21T05:54:51.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cl8GvPbvCxxuz7yviZfd2w.png" /></figure><p>If you were writing iOS apps a few years ago, you know the exact sound.</p><p>You changed single character of code, hit Cmd + R to run the app, and your MacBook instantly sounded like a jet engine preparing for takeoff. You’d stare at that tiny loading bar reading <em>&quot;Building 1 of 4,321 tasks...&quot;</em> and realize you had enough time to go grab a coffee, chat with a coworker, and maybe contemplate your life choices before the app finally opened in the simulator.</p><p>I officially stepped into the iOS battlefield in 2018. If you’re a seasoned veteran who survived the dark ages of Objective-C and manual memory management, feel free to laugh at my innocence! But for my timeline, 2018 was the absolute peak of the <strong>Monolith</strong> era.</p><p>Over the last eight years, the way we build Apple software has completely flipped. We went from wrestling with massive, tangled webs of code to snapping together clean, independent pieces like Lego blocks.</p><h3>2018: The “Everything, Everywhere, All at Once” Era</h3><p>Imagine a warehouse where the plumbing, furniture, and electrical wiring are all hopelessly tangled together in a single giant room. That was our codebase. We relied on a third-party dependency manager called CocoaPods. It got the job done, but it essentially duct-taped everyone’s code together, leaving us with a giant, fragile monolith.</p><ul><li><strong>The Developer Pain:</strong> Because everything was connected, changing a simple color on a button often forced the computer to rebuild the <em>entire</em> app from scratch.</li><li><strong>The Team Pain:</strong> Our automated testing systems (the robots in the cloud that check our code before it goes live) took 30 to 40 minutes just to say, “Yep, it works.”</li></ul><p>We knew this was unsustainable. We had to break the warehouse down into separate rooms.</p><h3>2020: The “Box Inside a Box” Illusion</h3><p>By 2020, teams realised we needed boundaries. The big trend was breaking the app into separate “Frameworks” (think of them as isolated boxes of code, like one box just for the Login screen, and one just for Payments).</p><p>To keep things organized, teams started using something called <strong>Umbrella Frameworks</strong>. The idea was to take all those little boxes and put them inside one giant master box, so the main app only had to open one thing.</p><ul><li><strong>The Developer Pain:</strong> While our local computers built the code a little faster, we created a new monster. Apple’s systems actually hate Umbrella Frameworks. When a user tapped the app icon on their iPhone, the phone had to unpack the giant box, then unpack all the smaller boxes inside it before the app could start. It made the app launch noticeably slower for the user.</li><li><strong>The Team Pain:</strong> Getting all these boxes to talk to each other required incredibly fragile, custom scripts. If one script broke, nobody was releasing an app that week.</li></ul><p>We had better organization, but we had accidentally made the app heavier.</p><h3>2022: Apple Throws a Lifeline</h3><p>Eventually, Apple realized the community was struggling and gave us the ultimate escape hatch: <strong>Swift Package Manager (SPM)</strong>.</p><p>If the 2018 era was duct tape, SPM was native, interlocking Lego blocks. We finally had a built-in, Apple-supported way to bundle up pieces of our app. We aggressively ripped out all our old third-party tools and started moving our code into these clean, native packages.</p><ul><li><strong>The Developer Pain:</strong> Gone. Xcode (our development environment) finally understood exactly how the app was connected. If I only changed code in the Payment package, the computer <em>only</em> rebuilt the payment package. The jet-engine fan noise finally stopped.</li><li><strong>The Team Pain:</strong> Massive relief. Those 40-minute automated testing pipelines suddenly dropped to 10 minutes.</li></ul><h3>Today: The “Empty Shell” Strategy</h3><p>Today, how I architect a project looks completely different than it did when I started.</p><p>We don’t really build ‘apps’ anymore. We build decoupled, standalone features.</p><p><strong>Why this is beautiful:</strong> If I am assigned to fix a bug on the Profile screen, I don’t even open the main app. I just open the isolated Profile package. It builds in seconds. I can test it completely on its own, prove it works, and merge it back into the main project without ever stepping on another developer&#39;s toes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGhcpVhIFZaBLr31Ntc_Ag.png" /></figure><h3>Looking Back</h3><p>Thinking about those massive, tangled codebases from eight years ago makes me sweat a little bit. It’s hard to believe we managed to ship anything on time.</p><p>Software engineering is rarely about getting it perfect on the first try. It’s about building something, realizing it’s painfully slow, and then having the patience to untangle the knot so the next generation of developers doesn’t have to listen to their laptop fans scream all day.</p><p>If your team is still fighting with 40-minute build times and chaotic project files, take a weekend. Pull just one small piece of your app into a modern Swift Package. Once you experience that instant, quiet build time, you’ll never look back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d425b4a7742" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Apple Ecosystem: The Reality of Swift on Android]]></title>
            <link>https://medium.com/@charu.dev/beyond-the-apple-ecosystem-the-reality-of-swift-on-android-82513de86be0?source=rss-766e7ff07fee------2</link>
            <guid isPermaLink="false">https://medium.com/p/82513de86be0</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[wwdc]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[cross-platform-mobile-app]]></category>
            <dc:creator><![CDATA[Charu Gupta]]></dc:creator>
            <pubDate>Wed, 15 Jul 2026 08:13:20 GMT</pubDate>
            <atom:updated>2026-07-15T10:17:20.759Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmZwyZeiHZYWOL817cu9tw.png" /></figure><p>Imagine writing an intricate, massive guidebook, but every time you want to publish it in a new country, you have to rewrite the entire book from scratch in a completely different language.</p><p>For years, that’s just been the tax you pay for building mobile apps. But recently, the mobile engineering world got a massive shake-up. With the release of Swift 6.3 and 6.4, Apple officially released a dedicated Software Development Kit (SDK) to run Swift code natively on Android that changed the math by introducing official toolchains to run Swift code natively on Android.</p><p>Working daily with both native iOS and Flutter projects, I’ve been tracking this closely. There is a lot of hype out there, so let’s cut through the marketing fluff and look at how this actually works, where it trips up, and if it’s worth your time.</p><h3>The Big Misconception: The Engine vs. The Paint</h3><p>When non-developers hear “Swift on Android,” they usually picture a magic button that takes an iPhone app and instantly turns it into an Android app. That is not what is happening here.</p><p>To make sense of this, it helps to split an app into two parts: the <strong>Engine</strong> (the invisible logic, math, and API calls) and the <strong>Paint</strong> (the actual UI screens and buttons).</p><p>With Swift’s new Android support, you are only sharing the <strong>Engine</strong>. You can take the invisible Swift logic from your iPhone app and drop it into your Android app. However, you still have to build the <strong>Paint</strong> (the user interface) entirely from scratch using Android’s native visual tools (Jetpack Compose).</p><h3>What This Looks Like in Code</h3><p>Thanks to the Swift Android Workgroup, you don’t have to manually write absolute nightmare JNI (Java Native Interface) code anymore. You just expose your Swift function with a tag:</p><pre>import Foundation<br><br>// Exposing a shared calculation directly to the Android layer<br>@_cdecl(&quot;Java_com_portfolio_app_CoreLogic_calculateTax&quot;)<br>public func calculateTax(amount: Double) -&gt; Double {<br>    return amount * 1.18 // Straightforward Swift math<br>}</pre><p>On the Android side, the Kotlin developer just calls it as normal external code. The heavy calculations happen in Swift, but the button the user presses to trigger it is pure Android.</p><pre>// MainActivity.kt - Android Native UI Connection<br>package com.portfolio.app<br><br>import android.os.Bundle<br>import androidx.activity.ComponentActivity<br><br>class MainActivity : ComponentActivity() {<br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        <br>        // Calling our compiled Swift binary directly through JNI<br>        System.loadLibrary(&quot;SharedCore&quot;) <br>        val totalAmount = CoreLogic.calculateTax(100.0)<br>        <br>        // Render totalAmount natively using Jetpack Compose...<br>    }<br>}</pre><h3>Real-World Trade-Offs</h3><p>Let’s skip the theoretical pros and cons and look at actual production scenarios:</p><ul><li><strong>Go with Swift on Android if:</strong> You are an enterprise team with a massive, highly complex iOS app (like a banking app with custom local encryption rules). Reusing that heavy Swift backend code guarantees your data stays identical across platforms, while letting both teams build highly polished, platform-specific native UIs.</li><li><strong>Go with Flutter if:</strong> You are a startup or a lean product team that needs to ship an app to both stores in two months. Writing two separate UI layers in SwiftUI and Jetpack Compose takes twice the time. Flutter’s unified UI layer wins the speed race every single time.</li></ul><h3>The Flutter Reality Check</h3><p>Because I live in both worlds, comparing this to Flutter is fascinating.</p><p><strong>The Flutter Way:</strong> Flutter is a unified ecosystem. You use one language (Dart) to build both the Engine and the Paint. The custom rendering engine draws the exact same pixels on both screens. It is incredibly fast for launching an MVP because you design the screen once and you’re done.</p><p><strong>The Swift Way:</strong> Swift on Android is like sharing a car engine between a Porsche and a Jeep. The underlying machinery is identical, but the exterior chassis is custom-built for each ecosystem so it feels completely natural to the user.</p><h3>The Verdict</h3><p>Is Swift on Android going to kill Flutter or React Native? Not even close. The developer tooling for running Swift inside Android Studio is still incredibly early and clunky compared to the seamless experience of Flutter’s Hot Reload.</p><p>Honestly, it’s just exciting to see the ecosystem evolve like this. We are finally getting past the rigid ‘native vs. cross-platform’ arguments. Now, when planning an architecture, we have the flexibility to look at the app and decide exactly where to draw the line between shared logic and native UI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82513de86be0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>