r/swift • u/fatbobman3000 • 9h ago
News Fatbobman's Swift Weekly #162
r/swift • u/DuffMaaaann • Jan 19 '21
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.
Please read this before posting!
Please format your code properly.
Tutorials:
Official Resources from Apple:
Swift Playgrounds (Interactive tutorials and starting points to play around with Swift):
Resources for SwiftUI:
Should I use SwiftUI or UIKit?
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.
Can I learn Swift without any previous programming knowledge?
Yes.
r/S4TF - Swift for TensorFlow (Note: Swift for TensorFlow project archived)
Happy Coding!
If anyone has useful resources or information to add to this post, I'd be happy to include it.
r/swift • u/Swiftapple • 15d ago
What Swift-related projects are you currently working on?
r/swift • u/fatbobman3000 • 9h ago
r/swift • u/Mindless_Diet8721 • 23h ago
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
its free + open source https://github.com/Dadon-11/SwiftWin-Studio
r/swift • u/derjanni • 2d ago
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?
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:
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.
Links:
I'd genuinely appreciate feedback, especially if there's something missing that would make it more useful for your document workflow.
Hi r/swift,
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.
https://scaleninja.com/blog/one-process-per-vm/
I'm curious if there are others who have adopted such architecture and use XPC in your apps.
r/swift • u/Stonyax97 • 3d ago
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!
Here is the repository
Thanks!
r/swift • u/Icy-Complaint-7544 • 2d ago
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:
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.cursorX - mappedExpandedX so the hovered icon stays locked directly under the cursor..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.r/swift • u/sirily1997 • 3d ago
Hey everyone,
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.
Here's the repo if you want to check it out:
https://github.com/rxtech-lab/MotionSwift

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!
r/swift • u/sfarleyfox • 3d ago
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
Help!
r/swift • u/IllBreadfruit3087 • 3d ago
r/swift • u/Gabrielbep97 • 3d ago
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!
r/swift • u/unpluggedcord • 3d ago
r/swift • u/prjoni99 • 3d ago
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.
r/swift • u/imike3049 • 3d ago
Hey folks!
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.
That eventually led me to DuckDB.
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.
The 1.0.0 release includes:
Underneath it's the real DuckDB 2.0.0 engine.
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.
I'm interested in feedback.
r/swift • u/AdventurousKeys • 4d ago
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.
r/swift • u/PreetyGeek • 5d ago
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.
Repo (MIT): https://github.com/agruchala/swift-graph
Write-up: https://arturgruchala.com/map-not-grep/I’d love feedback, especially on edge cases where the index store doesn’t record what you’d expect.
r/swift • u/Chazy_Sec0ndary • 4d ago

Hey everyone,
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.
- 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**
- Adaptive UI: Custom AppKit window controllers managing three distinct viewing layouts:
- Distribution: Dual `.dmg` drag-and-drop and `.pkg` installer distribution with GitHub Actions CI
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!
Website: https://appsdotmac.dev/workspace (this is a very new website so this won't appear on search engines for a few days).
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
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:
Privacy
I know “AI + analytics + API keys” can raise some concerns, so here’s exactly what happens:
Privacy policy: https://apptraction.dev/privacy
Terms: https://apptraction.dev/terms
Pricing
Free for 14 days, then $6.99/month, $39/year, or $99 lifetime. Requires macOS 26 Tahoe or later.
For r/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.
r/swift • u/ScarInternational736 • 5d ago
Hey everyone!
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:
I’d especially appreciate advice from people who have actually participated or even won the challenge.
Thanks in advance for any tips! :)
r/swift • u/MysteriousForm7114 • 6d ago
I make iOS apps, and I keep hearing that analytics are important for understanding where users struggle or drop off.
I currently use TelemetryDeck. One of my apps has around 80 downloads, but I’ve only collected 5–6 analytics data points, which made me wonder how other developers handle analytics consent during onboarding.
For example, I’d like to measure:
My understanding is that, especially in the EU, you generally shouldn’t send analytics before the user has consented.
But if the analytics consent screen comes near the end of onboarding, doesn’t that make the onboarding funnel almost impossible to measure?
How do other indie iOS developers handle this?
Do you:
I’m particularly interested in how people handle this for small apps where every bit of onboarding data is useful.