r/iOSProgramming • u/wuyuByteX • 1m ago
App Saturday Summonfall: Native SwiftUI + SpriteKit iOS merge tower defense (zero 3rd-party SDKs, pure-Swift GameCore SPM, 35-language build gate)
Hey everyone, I just pushed v1.2 of my solo iOS game, Summonfall: Tower Defense RPG. It is a one-handed portrait merge tower defense for iPhone. Since Saturday is the one day to share apps here, I figured I would break down the architecture and two iOS-specific headaches that cost me the most time.
App Store: https://apps.apple.com/us/app/summonfall-tower-defense-rpg/id6832150717
Tech stack:
- Client: Pure native Swift (iOS 17+, portrait iPhone only). SwiftUI handles all menus, overlays, shop, and meta progression; SpriteKit runs the battle board. Native GameKit (Game Center), StoreKit 2, and AVFoundation. Zero third-party iOS SDKs.
- Core architecture: All battle simulation, hero/wave definitions, gacha pity math, and economy caps live inside a local Swift Package (GameCore, ~70 source files + 24 test files) with both iOS 17 and macOS 14 targets and zero UIKit/SpriteKit imports. Two macOS CLI executables (econ-gate and balance-audit) import the exact same package and JSON data to check progression caps and wave math from the terminal.
- Backend / DB: Zero-dependency Node.js 22+ server using built-in node:sqlite for Game Center auth, cloud saves, guilds, leaderboards, and StoreKit 2 receipt validation.
- Tooling: XcodeGen (project.yml), SPM, and a Python localization build pipeline.
Development challenges and how I solved them:
- In-app language switching across 35 languages vs. SwiftUI's Text("...") trap
I wanted 35 languages on day one and real-time language switching inside Settings without forcing an app restart. The catch with SwiftUI is that raw Text("...") and Button("...") literals automatically turn into LocalizedStringKey and pull from the system locale bundle, quietly bypassing my custom in-app language bundle. Managing 35 languages by hand in Xcode's String Catalog also turned into a minefield of missing keys, broken %lld / %@ placeholders, and occasional Latin/Cyrillic lookalike typos.
Fix: I turned off SWIFT_EMIT_LOC_STRINGS in project.yml so Xcode stops mutating the catalog, kept 34 Python translation maps plus English source keys, and wrote a build script that compiles Localizable.xcstrings and fails the build if it finds:
- Missing or dead keys
- Format specifier mismatches (%lld, %@)
- Untranslated English strings left in non-English files
- Mixed Latin + Cyrillic/Greek characters in the same word
- Raw SwiftUI Text("...") / Button("...") string literals that bypass the dynamic language switcher
- Dynamic non-constant arguments passed to my tr() helper
That paid off fast: Japan became my most active organic region right after launch, which would not have happened if Japanese UI strings had been half-broken.
2. Catching economy inflation and balance bugs without clicking through Simulator
Testing a 100-floor pet side mode, 5 faction towers, and multi-currency progression by tapping through iOS Simulator is way too slow. Splitting GameCore into a pure-Swift package with a macOS target let me run deterministic simulations and an automated econ-gate check in seconds on every change. Every currency payout goes through a single Wallet.grant gate with cap checks, so a typo in a quest reward cannot accidentally hand out 100x gems.
AI disclosure:
Category: AI-assisted
I designed the architecture, game systems, and automated test/lint gates myself, and used AI coding assistants to speed up SwiftUI views, refactors, and test scaffolding. Hero portraits also started with AI image drafts that I cleaned up and edited by hand.
Honest caveats:
- iPhone portrait only right now (no iPad layout or Android port)
- Online-only and requires Apple Game Center
- Free to download with no forced video ads, optional gacha (100-pull hard pity on Genesis, no separate Mythic pity), and a monthly pass that unlocks 4x speed and auto battle
Happy to answer any questions about mixing SwiftUI + SpriteKit, keeping a zero-dependency node:sqlite backend, or the xcstrings build checks.


