????Cross-Platform App Development: Simplifying the Chaos with Configuration-Based Setup ??
When I started developing RadarWX, a cross-platform aviation weather app, I had one goal: provide pilots with seamless weather insights across devices.
Developing a cross-platform app sounds elegant. But in reality? It’s a tightrope walk battling platform-specific nuances.
Spoiler: I didn’t let Xcode win this time.
???? Meet RadarWX: simple weather app tailored for Pilots by Pilots
RadarWX is designed to bring users met data no matter what device they’re on. With macOS and iOS support, it leverages Apple’s ecosystem to sync data between widgets and main application.
Building such an app requires more than "clever UI" - I wanted leverage cross platform development benefits of reusable Core and Infrastructure. That’s where the pain points started to emerge, especially when working with App Groups for data sharing.
?? A Cross-Platform App That Plays Nice
Building a cross-platform app is an exciting challenge – until you run headfirst into platform-specific quirks. My app needed to run exchange data between main app and a Widget. One key feature? – App Groups for syncing data between components like widgets and the main app!
In simple words App Groups – is a shared resource, a folder in the OS, where several apps within the same group, can read/write data, without asking the user for the permission to do so. It's a "Sandbox" and It is a simplest recommended by Apple way of interaction.
?? Where It All Went Wrong
Here’s the twist: App Groups require distinct identifiers for iOS and macOS because Apple demands it. Fair. But you simply can not select platform specific requirements with Xcode project's Signing and Capabilities UI – it is simply impossible!
The first and the most straight forward solution is to create two targets: one for iOS and one for macOS. But soon, I was knee-deep in duplicate settings, redundant files and it just doesn't feels right, OK? Let’s face it: that’s not sustainable, scalable, nor fun.
??? The Solution: Configuration-Based Setup
Instead of duplicating targets, I leaned on Xcode configurations and schemes to cleanly manage the differences between platforms. This approach allowed me to:
Here’s a high-level breakdown of how I set it up:
Create Platform-Specific Configurations, this allowed me to define specific settings like App Groups, supported platforms and more.
?? Custom Configuration for Each Platform
I set up two pair of configs: iOS and macOS Configurations – to pair with the schemas:
领英推荐
Separate Schemas
Now you separate your Configurations by leveraging Schemas:
App Groups for Each Configuration
Now we can simply use our defined by Configuration build value:
Guess what? Xcode understand it and even can display it inside Signing & Capabilities UI! What if you could simply press + sign from the really beginning? Bruh, that wouldn't be Apple way ??
?? Why Configuration-Based Setup Wins
This approach unlocked several benefits:
And the best part? No more duplicated targets cluttering the project.
?? Takeaway for Developers
If you’re building cross-platform apps, don’t fall into the trap of duplicating targets or overcomplicating your project. Configurations and schemes can help you maintain a clean, scalable codebase that respects each platform’s quirks.
For RadarWX, this setup means I can continue delivering powerful weather insights without being bogged down by Apple’s red tape. This reminded me that while Apple’s ecosystem can feel restrictive, there’s always a smarter way to work within the system.
And who knows? Maybe one day, Apple will reward us with tools that don’t make us feel like we’re in a toxic relationship. Until then, configuration-based setups are here to save the day.
What’s been your experience working with App Groups or platform-specific setups? I’d love to hear your thoughts!
??? Pilot? - Try RadarWX Today!
Curious about how RadarWX brings radar-based weather insights to life?
Download it today on iOS and macOS to see the results of this streamlined approach in action, track my progress and simply support me!
Software Engineer | Expert in iOS, MacOS, tvOS | Technical Mentoring
3 个月Cool to see this is possible, and great job figuring it out! While reading, I kept asking myself: is it worth it? Cross-platform solutions seem ideal for smaller projects without platform-specific features—they’re cheaper and simpler for everyone. But once challenges arise, it might be worth considering separate native apps, maybe sharing common code through something like SPM. In your case, it seems like it was worth it—just hoping that’s where the platform-specific work ends!