Hi there and welcome to r/swift! If you are a Swift beginner, this post might answer a few of your questions and provide some resources to get started learning Swift.
If you have a question, make sure to phrase it as precisely as possible and to include your code if possible. Also, we can help you in the best possible way if you make sure to include what you expect your code to do, what it actually does and what you've tried to resolve the issue.
Please format your code properly.
You can write inline code by clicking the inline code symbol in the fancy pants editor or by surrounding it with single backticks. (`code-goes-here`) in markdown mode.
You can include a larger code block by clicking on the Code Block button (fancy pants) or indenting it with 4 spaces (markdown mode).
The answer to this question depends a lot on personal preference. Generally speaking, both UIKit and SwiftUI are valid choices and will be for the foreseeable future.
SwiftUI is the newer technology and compared to UIKit it is not as mature yet. Some more advanced features are missing and you might experience some hiccups here and there.
You can mix and match UIKit and SwiftUI code. It is possible to integrate SwiftUI code into a UIKit app and vice versa.
Is X the right computer for developing Swift?
Basically any Mac is sufficient for Swift development. Make sure to get enough disk space, as Xcode quickly consumes around 50GB. 256GB and up should be sufficient.
Can I develop apps on Linux/Windows?
You can compile and run Swift on Linux and Windows. However, developing apps for Apple platforms requires Xcode, which is only available for macOS, or Swift Playgrounds, which can only do app development on iPadOS.
Is Swift only useful for Apple devices?
No. There are many projects that make Swift useful on other platforms as well.
I built Unpage: PDF Reader, an app that turns any PDF into text that reflows to fit your phone, like an ebook. It's made for the hard stuff: two-column papers, tables, equations and figures come out readable instead of mangled. It all runs on your device, so nothing gets uploaded. Tap any paragraph to see exactly where it is on the original page, or read both side by side. Highlights show in both views, scans work too, and Pro exports EPUB for your e-reader. Free to try, and Pro is a one-time unlock with $12.99, no subscription. Currently it's available on iOS and iPadOS, the Mac version is under review, should be out soon. Welcome to any bug report too.
Since the last post, we hit a major milestone that I wanted to share the Swift & WebKit architecture for: getting Google Docs to edit natively offline inside Apple WebKit without Chromium.
🛠 The Engineering Challenge: Offline Google Docs in WebKit
Google historically restricts offline editing behind its official Chrome extension and internal Chrome APIs (chrome.storage.local, chrome.app, etc.). In WebKit:
Clean-Room WebExtension Polyfill: We built a zero-Chromium bridge (OfflineSuiteBridge.js) injected via WKUserScript across all frames at .atDocumentStart. It implements the extension detection flags and answers Docs' port-based chrome.runtime.connect RPC handshakes.
Swift Backend Coordination (OfflineSuiteEngine.swift): Uses an @MainActor**-isolated** WKScriptMessageHandler to receive document tracking and auto-saves from JavaScriptCore, persisting offline files locally to ~/Documents/Workspace.mac/.
WebKit Disk Caching & Smart Sync: We configure .returnCacheDataElseLoad so WebKit boots cached document shells without error -1009. A native NWPathMonitor listener detects when connectivity returns and triggers background sync.
Roadmap for Sheets & Slides (v1.3.1 & v1.3.2): We plan to release minor updates later this month to expand the clean-room bridge to Google Slides and Google Sheets. Because the underlying RPC and storage foundation is already built, it’s primarily a matter of mapping the specific port channels and storage mutations that Slides and Sheets use.
📐 Multi-App Tiling & Window Architecture
Persistent WebKit Pooling: Built a custom WebKitPool and WebKitHostView so users can drag and tile up to 4 active Google Workspace apps into split panes (50/50, master-stack, quad grid) without webviews reloading or losing input focus.
CryptoKit AES-256 Sandboxed Vault: For our new ambient weather widget (powered by Open-Meteo), coordinates and location caches are encrypted at rest with Apple CryptoKit in ~/Library/Application Support/ (0700/0600) so compiling from source never triggers annoying Keychain ACL prompts.
Build Reproducibility: Includes standalone ./build_app.sh and ./build_installer.sh scripts requiring only Xcode Command Line Tools.
Memory sits at around ~90 MB under heavy document load compared to 1–2 GB+ for standard browser tabs or Electron wrappers.
The full Swift codebase is now public under the MIT License. Would love any feedback on the WebKit bridge architecture, PRs, or suggestions from the community!
I built Beaver because I wanted a simple way to scan documents and turn photos into PDFs without uploading anything to the cloud.
Contracts, receipts, visa documents, medical papers. I didn't want any of that sitting on someone else's server, and I was tired of scanner apps full of ads and subscriptions.
It started about three years ago as a small Mac tool I built for myself. I open-sourced it in 2025 and this year I started working on an iOS version. That eventually turned into rebuilding most of the app.
Here's what Beaver can do now:
Works on iPhone, iPad and Mac
Scans documents and converts photos to PDF
Splits and merges PDFs
Exports pages as PDF, PNG or JPEG
OCR that runs entirely on-device
No accounts, no tracking, no ads, no subscriptions. Everything stays on your device.
Why open source but $1.99?
The entire source code is on GitHub. You can inspect it or build the app yourself for free. The $1.99 App Store version is for people who prefer to install it directly and receive updates. It's a one-time purchase.
I had this project idea on my desk for a while now, because I'm a total history buff. Now, I finally got to build it. My biggest fear is that Apple would reject it for the obvious reasons of the Internet Archive being flooded with "inappropriate content". I builtin a ton of filters and safeguards to block any nsfw content, and tbh it works fairly well. Please keep your fingers crossed for me.
Did anyone of you ever publish a similar app and do you have any tips?
built it because i didn't want to buy a mac just to learn swiftui. edit, hit run, it's on the phone in about 30 sec. you can control the phone from the pc too
still early, only tested on my iphone so far. would love people to try it
At ScaleNinja, we build MacVisor, Mac Virtualization Platform written largely in Swift for Apple Silicon Macs, and wrote up its process layout.
MacVisor runs macOS, Windows, Linux & FreeBSD VMs on Apple's Virtualization.framework (not QEMU or any emulator) and enables users to run Mac as virtualization hosts (like Proxmox). It does automatic VM setup with account, ssh keys, guest tools, and brings snapshots, firewall & VLANs, VM auto-start & high availability, schedule backups and other advanced features.
Typical desktop virtualizers for macOS don't offer process isolation and all the VMs it runs are not isolated (killing the app for example, kills all the VMs). We've taken a different path in MacVisor's design and architecture https://scaleninja.com/macvisor/#architecture
The design question is which process owns each VM. Ours: a per-user background service is the only writer of VM state, and each running VM gets its own runner process. The app and the CLI are just clients. So quitting or crashing the app stops nothing, and one VM's crash doesn't take the others down. The service can even restart and reconnect to running VMs.
The post includes a table of what survives what (app crash, service restart, update, power cut) and what the design costs.
Hello everyone, I just started building my first iOS app, it's still in early development.
Im not a real developer, in fact I just started learning python this summer and decided to move to Swift and SwiftUI since I want to build an app for my iPhone.
Im currently working on a simple Habit Tracker, I would love if anyone could check out my code, or just give me general tips when building with SwiftUI!
I work on a 5-monitor MacBook Pro setup (with two 27" monitors stacked on an upper row above my 16" MacBook Pro and two 15.6" portable side displays). On macOS, WindowServer only shows the native Dock on one screen at a time, and on upper stacked displays you can never summon the bottom Dock at all because moving the pointer down crosses into the lower monitor.
I built MultiScreenDock in pure Swift and AppKit (zero third-party dependencies, ~0.0% idle CPU, 2,066 automated assertions) to put a live, synced replica of the macOS Dock on every connected display simultaneously.
A few interesting AppKit / CoreGraphics problems solved in v1.4.2:
Zero-permission Smart Auto-Hide ("Dodge Windows"): Third-party apps cannot reserve NSScreen.visibleFrame insets like Apple's system Dock.app without requesting intrusive Accessibility permissions to forcibly resize user windows. To solve this without any permissions, v1.4.2 uses public CGWindowListCopyWindowInfo([.optionOnScreenOnly, .excludeDesktopElements], kCGNullWindowID) metadata to inspect layer-0 window bounds, translates Quartz global coordinates (top-left origin on primary display) into AppKit multi-monitor coordinates (primaryHeight - (quartzY + height), including negative Quartz Y on upper stacked monitors), and automatically hides the Dock per-monitor only when a window overlaps its footprint.
120 Hz Raised-Cosine Magnification Wave with Piecewise-Linear Focal Lock: When icons magnify on hover, the total pill width expands from the center. Without compensation, hovering an icon near the left or right end causes that icon to drift sideways away from the pointer. MultiScreenDock maps rest knot coordinates to expanded knot coordinates at 120 Hz and shifts the pill origin by cursorX - mappedExpandedX so the hovered icon stays locked directly under the cursor.
Cross-Monitor File Drag-Out from a Non-Activating Fan Stack Panel: On a .nonactivatingPanel, child NSImageView / NSTextField subviews return acceptsFirstMouse == false by default, which swallows mouseDragged before NSDraggingSession can start. Overriding hitTest(_:) on the custom NSControl row and transitioning the panel to ignoresMouseEvents = true (with alphaValue = 0) during the active drag session instead of calling panel.close() keeps the AppKit drag source alive across all monitors.
We just open-sourced MotionSwift, something we put together to get native rendering performance without relying on Remotion and headless Chrome.
We've been using it in our day-to-day video production pipeline, and so far we're seeing roughly 10–20x faster renders while using only about 10% of the memory compared to the Remotion + Chrome setup. We also brought a visual editor and timeline preview directly into Swift, so you can inspect and adjust agent-generated compositions natively on both iOS and macOS.
The eventual goal is 100% compatibility with Remotion, but we're still working our way there. There's still plenty of room to improve the APIs, rendering speed, and overall platform support.
Curious to hear your thoughts, especially if you've run into similar memory or performance bottlenecks with web-based video rendering. Happy to answer any questions!
I decided to use the beginner app tutorial and it won’t accept me changing the text, nothing seems to work! And the next one on the list is greyed out so I’m not sure what I’m meant to be able to do to actually learn as this is task 1 that’s broken
I'm a solo dev about to ship a native macOS app, distributed directly (notarized, outside the Mac App Store). I want a one-time lifetime license, activatable on up to 2 Macs, and the app must keep working offline after activation. I'm in Brazil, selling worldwide. I'm leaning towards a Merchant of Record platform with built-in license keys (looking at Dodo Payments, Lemon Squeezy and Freemius) instead of running my own license server. For people who've shipped something like this: How do you handle a customer whose old Mac died, so they can't deactivate it from inside the app? Do you reset it manually from the platform dashboard? Do you validate online on every launch, or activate once and trust a locally stored (Keychain) activation? How do you stop someone from just copying that state to another Mac? Do refunds and chargebacks revoke the key automatically, or did you need a webhook? Any experience getting paid out from Brazil through these platforms? Did you regret your platform choice later (lock-in, fee changes, platform shutting down)? I'm not looking for a way to make piracy impossible, just to stop casual key sharing without a lot of support work. Thanks!
Nimbus is an open-source macOS cloud storage app (GPL-3.0, Swift 6 strict concurrency). The code is public, so here is what I'd tell someone starting the same thing. The file table is AppKit. SwiftUI's Table could not match Finder's selection, type-to-select and drag behavior. Everything around it is SwiftUI Developer ID builds lose a group. app group. Without a provisioning profile macOS ignores that entitlement, so the File Provider extension could not read what the app wrote. It worked in every debug build and failed only in the notarized release. A team-ID-prefixed group fixed it A notarized, Gatekeeper-accepted build can still fail to launch. A re-sign left a development profile and restricted entitlements in place. The packaging script now launches the app before it builds the DMG NSFileProviderReplicatedExtension change tracking is done by diffing persisted directory snapshots, because the backend (rclone) has no change feed for most providers One third-party package. Sparkle, for updates. The rclone client is a local package over URLSession; a pre-build lint fails if any other dependency is added Source: https://github.com/CasaVargas/Nimbus Happy to answer questions about any of it.
The project itself, JevDK, is not intended for folks on this sub. Unless you are into AI, you don't care about decision models. However, I thought (and folks can correct me if I'm wrong) that you might be interested in the juxtaposition of an open-source project that actually gets approved on the Mac App Store.
Unlike my other project, AnswerSearch, which was closed sourced when it was approved and listed, and then open-sourced, JevDK was open-sourced from the beginning. So you can see what I actually had to do to get it approved.
I actually had to make a few changes from the initial version of JevDK that I submitted.
(1) Rejection: the app has to either completely quit when you close the app window, or have a way to reopen the app window from the app menu. Since I didn't have the latter, I chose the former. So it behaves like our beloved Transporter. Close the window and the app exits. Duh.
(2) There were also new app review guidelines (in October) that came along right after the initial submission, so I had to pull the submission and add a link to the privacy policy webpage. If you didn't know, this is the text: "All apps must include a link to their privacy policy in the App Store Connect metadata field and within the app in an easily accessible manner."
Hope this is useful to other folks. The repo is on github at ancientcomputing/jevdk.
I've been working on Duck for a while and just shipped the first stable 1.0.0 release.
The idea started from something I wanted in my own iOS/macOS apps: a database experience much closer to the server-side SQL world I enjoy with Vapor, Fluent and my SwifQL, but directly on the client.
DuckDB already has an official Swift client, but I wanted a higher-level application-facing layer around it: models, Codable integration, async/await, typed SQL, migrations, connection management, and reactive queries that fit naturally into SwiftUI and UIKit.
So I built Duck.
The basic model API looks like this:
import Duck
struct Todo: Table {
@Column("id")
var id: UUID
@Column("name")
var name: String
}
let todos = try await Todo.all(on: .app)
Duck also re-exports the SwiftStream/SQL DSL, so you can move from simple model operations to much more expressive SQL without switching to a completely different abstraction.
Right now Duck targets iOS 15+ and macOS 12+. I've also tested it on Linux. DuckDB itself supports Android and Windows too, but I haven't validated the Duck Swift layer there yet.
There are complete SwiftUI and UIKit example apps in the repo if you want to play with it without setting everything up from scratch.
Coding agents trace Swift call stacks with grep: search the name, read the file, search the enclosing function, repeat. Every hop costs a couple of tool calls, and text search doesn’t know which write( you meant, which overload the compiler picked, or where a protocol call actually lands.
The compiler already recorded all of that in the index store when you built. SwiftGraph reads it and answers in one call:
The experiment: I gave two Sonnet agents the same “trace every caller” question. The graph agent used 2 tool calls and ~196k input tokens; the grep agent used 8 tool calls and ~689k. Both were correct.
Limits, honestly: it only sees what the compiler records, so NotificationCenter, selectors, KVO, u/Environment injection and reflection don’t show up. It’s macOS + Xcode only, and the graph is only as fresh as your last build.
I wanted to share a native macOS project I've been building in Swift: Workspace.mac.
I was frustrated by how much memory and battery Chromium/Electron wrappers consume just to keep Google Docs, Sheets, Drive, and Gemini open throughout the workday. I wanted a clean, native desktop client with fluid macOS design and genuine system integrations.
Architecture & Tech Stack:
- Language & Platform: Swift, macOS 13+ (Ventura, Sonoma, Sequoia)
- Engine: Pure WebKit
- Security: `LocalAuthentication` framework (`LAContext`) to lock and unlock sensitive documents with **Touch ID & Secure Enclave**
Everything Mode: Docked sidebar + floating navigation bar
Essentials Mode: Compact top bar only (maximizing vertical text area)
At a Glance Mode: Fullscreen immersive edge-to-edge view with hover-activated chrome
- Distribution: Dual `.dmg` drag-and-drop and `.pkg` installer distribution with GitHub Actions CI
Performance & Efficiency Metrics:
Binary & Download Size: Only 3.5 MB on disk (compared to 150MB+ for standard Electron wrappers).
Memory Footprint: Averages around 90 MB system RAM (tested under heavy load with a 100+ page Google Doc open) vs 600MB–1GB+ in Chrome.
CPU: Sits at <1% CPU usage at idle.
Lessons Learned & Challenges:
- WebKit vs Google Web Apps: Handling cross app Google navigation within sandboxed WebKit without breaking SSO tokens or pop-out window handling.
- Memory Footprint: Native WebKit memory footprint sits around 40–80 MB idle compared to Electron wrappers that easily start at 500 MB+.
- Window Management: Giving users the ability to detach any of the 18 Google Workspace apps into their own dedicated macOS window while sharing the underlying session.
The project is completely free, and plan to make it open-source soon after some code tweaks, and has zero telemetry.
Would love any feedback on the codebase, architecture, or suggestions from fellow Swift developers!
Hi r/swift! I’m John. I spent 10 years as an engineer at Apple working on macOS and iOS, and I’ve been indie for the last 8, shipping 20+ apps for myself and clients. I just launched AppTraction, the tool I wish I’d had when I started building my own apps.
The problem
Most iOS and Mac devs that I talk to agree that Apple’s App Store Connect website is slow, confusing, and buggy. There’s a lot of useful data there, but the clunky site makes it hard to make sense of. AppTraction is a native Mac app (AppKit and Swift, no web wrapper, no Electron) that brings your sales, analytics, ratings, and reviews to your Mac, and then tells you what matters.
What AppTraction does
Insights: it monitors your apps in the background and flags problems, trends, and milestones. There are 50+ kinds so far. With my own apps, it has caught serious listing problems, getting featured by Apple, and seasonal sales trends, all of which I would have missed.
Listing fixes: when it spots a problem with your App Store listing, it suggests a fix and, once you approve it, applies it to App Store Connect for you.
Reviews: read and reply to every review. It can translate them and suggest replies.
Reports: it writes detailed tailored reports for each app, for every week, month, and year.
Chat: ask about any chart, table, or report in plain English. The AI is primed with Apple’s own tech talks on ASO and other sources, so the advice is specific, not generic.
Territories: shows a world map revealing how your apps are performing across regions.
The AI runs on your existing Claude or Codex subscription (or OpenRouter), so there are no pricey API fees.
Under the hood
For the curious:
AppKit for the main window, SwiftUI for most sheets and forms, and Swift Charts for all graphs.
A separate launchd agent does the data collection in the background so everything stays fresh even when the app isn’t open. The app talks to it via NSXPC*.
Apple’s analytics are stored in plain SQLite, which is a big part of why everything feels instant.
Privacy
I know “AI + analytics + API keys” can raise some concerns, so here’s exactly what happens:
No AppTraction account. I never ask for your name, email, or password.
Your App Store Connect key lives in your Keychain. You don’t need an Admin key: a limited Sales and Reports key covers your analytics.
Your App Store data is stored only on your Mac. There’s no AppTraction server holding it.
The AI runs on your own Claude or Codex subscription (or OpenRouter). Requests go straight from your Mac to that provider, under your account, and I never see them.
Review translation uses Apple’s built-in translator, so translating a review never sends it anywhere.
What does reach me: anonymized usage stats (which features get used, never app names, numbers, or chat text), license checks, and update checks.
Forr/swift: 50% off your first payment (including the lifetime) with code RSWIFT50, good through Dec 1.
I’d love feedback from fellow devs, good or bad. What do you wish App Store Connect told you? And happy to answer questions about how any of it’s built.
I’m planning to participate in the Apple Swift Student Challenge 2027 and would love to hear some advice from people who have participated in previous years.
I’m relatively new to Swift and Swift Playgrounds, so I’m currently trying to figure out how to approach the challenge and what makes a submission stand out.
A few questions I have:
What are some common mistakes beginners should avoid?
How complex should a Swift Student Challenge project be?
What makes a project stand out to the judges?
Do you have any tips for coming up with a creative and meaningful idea?
Are there any resources, tutorials or previous winning submissions you’d recommend checking out?
I’d especially appreciate advice from people who have actually participated or even won the challenge.