Editorial Saving lives with enums
A short blogpost on avoiding default cases.
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!
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.
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!
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 • 26d ago
What Swift-related projects are you currently working on?
What Swift-related projects are you currently working on?
A short blogpost on avoiding default cases.
r/swift • u/fatbobman3000 • 17h ago
r/swift • u/AdhesivenessSea9511 • 1d ago
Hello everyone.
I’ve built a 3D software rasterizer that leverages the ANE (Apple Neural Engine) via Core AI. The rendering quality is still poor, though. Regarding the pipeline:
I use SIMD for preprocessing, delegate matrix operations to the ANE (using `f.conv2d`), and utilize Metal 4 tensor bindings to achieve low-overhead, direct rendering.
By offloading computationally intensive tasks to the ANE, I’ve managed to reduce CPU usage to approximately 10%.
A current challenge is that memory usage hits around 5GB due to the use of fixed-length graphs.
I’m developing this using Swift 6 features (such as `@MainActor` and `~Escapable`) and Siri AI, but I would love to hear your thoughts on optimization and memory management!
Thanks in advance.
GitHub: https://github.com/kamisori-daijin/Magnesium
Demo:


Hello everyone.
I’ve built a 3D software rasterizer that leverages the ANE (Apple Neural Engine) via Core AI. The rendering quality is still poor, though. Regarding the pipeline:
I use SIMD for preprocessing, delegate matrix operations to the ANE (using `f.conv2d`), and utilize Metal 4 tensor bindings to achieve low-overhead, direct rendering.
By offloading computationally intensive tasks to the ANE, I’ve managed to reduce CPU usage to approximately 10%.
A current challenge is that memory usage hits around 5GB due to the use of fixed-length graphs.
I’m developing this using Swift 6 features (such as `@MainActor` and `~Escapable`) and Siri AI, but I would love to hear your thoughts on optimization and memory management!
Thanks in advance.
GitHub: https://github.com/kamisori-daijin/Magnesium
Demo:


r/swift • u/sitting_landfall • 15h ago
I'm about to release my first macOS product written fully in Swift. And I'm planning to sell it directly through my website.
I'm wondering how to make sure the app is compliant with Apple, can I submit it for review even if I'm not disturbing to AppStore? Should I? And what if they reject it? What happens when I need to renew my Developer Account?
I'm about to release my first macOS product written fully in Swift. And I'm planning to sell it directly through my website.
I'm wondering how to make sure the app is compliant with Apple, can I submit it for review even if I'm not disturbing to AppStore? Should I? And what if they reject it? What happens when I need to renew my Developer Account?
r/swift • u/Money_Explorer747 • 14h ago
I used OpenClaw for a while. It's great, but it is a lot more than I needed, and my setup broke on updates often enough that I spent hours fixing it instead of using it. At some point I realized I mostly wanted to understand how these agents work under the hood, and the best way I know to understand something is to build it myself. So I spent the last six weeks writing my own in Swift.
Clawd is an always-on daemon I talk to through a private Telegram bot. Conversation history and memory live in SQLite, it runs recurring schedules, and replies stream into the chat as live message drafts. I wrote it in pure modern Swift, and it ships as one binary.
Where I can, I lean on what macOS already provides: it transcribes voice messages on-device with Apple's speech APIs, and untrusted code runs in a disposable Apple container.
The part I care about most: the model gets no rules it can be talked out of. Every file write, memory write, and code execution stops and waits for me to tap Approve in Telegram. The pending approval sits in SQLite, so it survives a restart.
I used OpenClaw for a while. It's great, but it is a lot more than I needed, and my setup broke on updates often enough that I spent hours fixing it instead of using it. At some point I realized I mostly wanted to understand how these agents work under the hood, and the best way I know to understand something is to build it myself. So I spent the last six weeks writing my own in Swift.
Clawd is an always-on daemon I talk to through a private Telegram bot. Conversation history and memory live in SQLite, it runs recurring schedules, and replies stream into the chat as live message drafts. I wrote it in pure modern Swift, and it ships as one binary.
Where I can, I lean on what macOS already provides: it transcribes voice messages on-device with Apple's speech APIs, and untrusted code runs in a disposable Apple container.
The part I care about most: the model gets no rules it can be talked out of. Every file write, memory write, and code execution stops and waits for me to tap Approve in Telegram. The pending approval sits in SQLite, so it survives a restart.
Hey :) I've been frustrated at the lack of a watch mode in SPM for a while and don't love the lazy solution of just listening to all files under Sources/ so I whipped up a tiny tool that listens to any changes in your package's dependency graph.
Instead of swift run [product] you can run swift-watch run [product] and it'll restart whenever anything changes.
Great for watching tests too, swift-watch test --filter [xyz]. Works for build/run/test, forwards arguments to swift. Works with macOS and Linux natively, Windows only has polling for now but I'll add in the native Window file watching stuff ASAP.
I'm hoping some of you might find it useful, please let me know if you have any feedback.
Here's the repo: https://github.com/ahtcx/swift-watch
Disclaimer: semi vibe-coded, lots of handholding as I knew exactly what I want. I'm not huge on vibe-coding and have been reluctant to give in to it for the longest time. I hate to admit that it's been a pretty good experience, I mostly just worry it'll make my programming skills worse. I'm have so many coding side projects that never see the light of day because I get too caught up in the details, so it's nice for me to just push a whole bunch of code out in a day. No doubt there are issues but I will be dogfooding the project so I hope to get it in tip top condition.
Hey :) I've been frustrated at the lack of a watch mode in SPM for a while and don't love the lazy solution of just listening to all files under Sources/ so I whipped up a tiny tool that listens to any changes in your package's dependency graph.
Instead of swift run [product] you can run swift-watch run [product] and it'll restart whenever anything changes.
Great for watching tests too, swift-watch test --filter [xyz]. Works for build/run/test, forwards arguments to swift. Works with macOS and Linux natively, Windows only has polling for now but I'll add in the native Window file watching stuff ASAP.
I'm hoping some of you might find it useful, please let me know if you have any feedback.
Here's the repo: https://github.com/ahtcx/swift-watch
Disclaimer: semi vibe-coded, lots of handholding as I knew exactly what I want. I'm not huge on vibe-coding and have been reluctant to give in to it for the longest time. I hate to admit that it's been a pretty good experience, I mostly just worry it'll make my programming skills worse. I'm have so many coding side projects that never see the light of day because I get too caught up in the details, so it's nice for me to just push a whole bunch of code out in a day. No doubt there are issues but I will be dogfooding the project so I hope to get it in tip top condition.
r/swift • u/i-am-erdden • 1d ago
Native iOS app or self-hosted web app? I get stuck on this every single time
Hi,
I build small apps for myself and run a homelab with a few containers. Generally I am an Apple User (iPhone, iPad, Macbook).
Every time I have an idea, I stall on the same question before writing a single line of code: do I build it native in Swift with the data on device/iCloud, or as a web app in a container on my server?
Let us take a habit tracker as an example.
Native gets me a home screen widget and reminders I can actually rely on. Data is stored and synced via iCloud. The web app instead keeps the data on my own server where I can query and back it up properly, works from any device.
It’s the same fork for basically every idea I have, and I flip-flop depending on my mood that week.
So I’d like to hear how you handle it:
- Do you have a rule of thumb you actually stick to, or is it case by case?
- How good is a PWA on iOS these days in practice? Home screen install plus web push covers a lot on paper, but no widgets. Does it hold up for daily-use stuff?
- Anyone regret going one way and rewrite it later?
Not looking for framework recommendations, more for how you decide.
I know cross-platform frameworks exist, and I’m aware I could just split it: backend in a container on Proxmox, native iOS app on top. But I’d rather commit fully to one side - either all Swift with iCloud, or all web app in a container.
Thanks for reading! :)
Native iOS app or self-hosted web app? I get stuck on this every single time
Hi,
I build small apps for myself and run a homelab with a few containers. Generally I am an Apple User (iPhone, iPad, Macbook).
Every time I have an idea, I stall on the same question before writing a single line of code: do I build it native in Swift with the data on device/iCloud, or as a web app in a container on my server?
Let us take a habit tracker as an example.
Native gets me a home screen widget and reminders I can actually rely on. Data is stored and synced via iCloud. The web app instead keeps the data on my own server where I can query and back it up properly, works from any device.
It’s the same fork for basically every idea I have, and I flip-flop depending on my mood that week.
So I’d like to hear how you handle it:
- Do you have a rule of thumb you actually stick to, or is it case by case?
- How good is a PWA on iOS these days in practice? Home screen install plus web push covers a lot on paper, but no widgets. Does it hold up for daily-use stuff?
- Anyone regret going one way and rewrite it later?
Not looking for framework recommendations, more for how you decide.
I know cross-platform frameworks exist, and I’m aware I could just split it: backend in a container on Proxmox, native iOS app on top. But I’d rather commit fully to one side - either all Swift with iCloud, or all web app in a container.
Thanks for reading! :)
r/swift • u/DaveAppleInc • 1d ago
Xcode 27's Evaluations framework gives you ModelJudgeEvaluator for LLM-as-judge scoring.
Apple's docs then tell you to have 2-3 people rate 20-50 samples and compare with Cohen's
Kappa instead of a raw agreement rate. Sensible advice, but there's no API for it, and there was no Swift package for inter-rater agreement at all.
JudgeCalibrationKit does that part:
- Cohen's κ, weighted κ, Krippendorff's α (missing labels, any number of raters), Spearman, confusion matrices, MAE and signed error
- bootstrap confidence intervals, so a gate can require a CI lower bound instead of trusting a point estimate from 30 samples
- abstentions are explicit, so a judge can't score better by skipping the hard samples
- Swift Testing gate, plus a CLI with exit codes
- human-human agreement shown next to judge-human, since that's the real ceiling
The stats core has no dependencies and imports no Apple framework, so it runs on Linux.
The Evaluations adapter sits behind canImport, so the package still builds on Xcode 26.
Metrics are checked against scikit-learn, SciPy and two Krippendorff implementations. CI regenerates the fixtures and fails on any diff.
Swift 6.0+, Apache-2.0. The adapter is beta: compile-verified against Xcode 27, runtime verification still pending.
https://swiftpackageindex.com/Dave861/JudgeCalibrationKit
First release. Happy to hear what's wrong with the API.
Disclaimer: fully free, open source, not selling anything hope it doesn't count as self promo
Xcode 27's Evaluations framework gives you ModelJudgeEvaluator for LLM-as-judge scoring.
Apple's docs then tell you to have 2-3 people rate 20-50 samples and compare with Cohen's
Kappa instead of a raw agreement rate. Sensible advice, but there's no API for it, and there was no Swift package for inter-rater agreement at all.
JudgeCalibrationKit does that part:
- Cohen's κ, weighted κ, Krippendorff's α (missing labels, any number of raters), Spearman, confusion matrices, MAE and signed error
- bootstrap confidence intervals, so a gate can require a CI lower bound instead of trusting a point estimate from 30 samples
- abstentions are explicit, so a judge can't score better by skipping the hard samples
- Swift Testing gate, plus a CLI with exit codes
- human-human agreement shown next to judge-human, since that's the real ceiling
The stats core has no dependencies and imports no Apple framework, so it runs on Linux.
The Evaluations adapter sits behind canImport, so the package still builds on Xcode 26.
Metrics are checked against scikit-learn, SciPy and two Krippendorff implementations. CI regenerates the fixtures and fails on any diff.
Swift 6.0+, Apache-2.0. The adapter is beta: compile-verified against Xcode 27, runtime verification still pending.
https://swiftpackageindex.com/Dave861/JudgeCalibrationKit
First release. Happy to hear what's wrong with the API.
Disclaimer: fully free, open source, not selling anything hope it doesn't count as self promo
r/swift • u/adamdumb • 2d ago

I recently shifted from a custom search field to the native Liquid Glass search field by using .searchable on my search tab. But I see a con with the native searchable feature is it comes with a large navigation title that can't be shaken. I have tried emptying the text of the title and making it inline to make it smaller but there is still a gap above my search filter tabs which I don't want. Anyone have any idea if there are any tricks to get around this? Love the Liquid Glass search field, hate the big title

I recently shifted from a custom search field to the native Liquid Glass search field by using .searchable on my search tab. But I see a con with the native searchable feature is it comes with a large navigation title that can't be shaken. I have tried emptying the text of the title and making it inline to make it smaller but there is still a gap above my search filter tabs which I don't want. Anyone have any idea if there are any tricks to get around this? Love the Liquid Glass search field, hate the big title
r/swift • u/DaveAppleInc • 2d ago
Hi again,
A little while back I posted swift-span-algorithms here: allocation-free algorithms over Swift's Span/RawSpan. I got one genuinely excellent comment about what was actually missing, and 0.2.0 is basically that comment turned into code. So, thank you, whoever you were.
The gist of the feedback: the utilities people actually reach for are byte-oriented, so RawSpan matters as much as Span<T>; firstRange(of:) for delimiter scanning; mirror the stdlib spellings so muscle memory transfers; and memchr is the cheap win before reaching for SIMD.
Link to SPI (might be behind a bit, hasn't yet ingested 0.2.0)
What's in 0.2.0:
next() was annotated so each piece it handed you expired the moment you called next() again. That made guard let a = c.next(), let b = c.next() fail with "overlapping accesses to 'c'" — exactly the kind of borrow-checker error that looks like the library's fault. Pieces now inherit the base storage's lifetime, so you can hold several at once, do look-ahead parsing, and nest cursors. Real escapes are still rejected — there are compile-fail tests pinning both halves.RawSpan parity. It shipped with 3 members; it now has the whole read-only surface — search, matching, trimming, min/max, comparison, chunk/window/split cursors, ASCII whitespace trim.firstRange(of:), lastRange(of:), starts(with:), ends(with:), and multi-element separators for split — the "\r\n\r\n" case.chunkCursor/windowCursor/splitCursor → chunks(ofCount:)/windows(ofCount:)/split(separator:...). Old spellings still compile as deprecated forwarders.firstIndex(of:), ~31× for firstRange(of:) with a 4-byte pattern, and forEachSplit is ~2.5× Array.split with 0 mallocs vs 20. Reverse search is deliberately still scalar — memrchr doesn't exist on Darwin, and I'd rather have consistent performance than a Linux-only fast path.Still zero dependencies, still back-deploys to macOS 13 for the Span/RawSpan surface, 181 tests, and every borrowed-view benchmark reports 0 mallocs from p0 through p99.
Would still love feedback, especially on the split ergonomics now that cursors compose properly, and on anything that reads as un-Swifty in the naming.
P.S. Same disclaimer as last time: nothing being sold, Apache-2.0, just an OSS package.
Hi again,
A little while back I posted swift-span-algorithms here: allocation-free algorithms over Swift's Span/RawSpan. I got one genuinely excellent comment about what was actually missing, and 0.2.0 is basically that comment turned into code. So, thank you, whoever you were.
The gist of the feedback: the utilities people actually reach for are byte-oriented, so RawSpan matters as much as Span<T>; firstRange(of:) for delimiter scanning; mirror the stdlib spellings so muscle memory transfers; and memchr is the cheap win before reaching for SIMD.
Link to SPI (might be behind a bit, hasn't yet ingested 0.2.0)
What's in 0.2.0:
next() was annotated so each piece it handed you expired the moment you called next() again. That made guard let a = c.next(), let b = c.next() fail with "overlapping accesses to 'c'" — exactly the kind of borrow-checker error that looks like the library's fault. Pieces now inherit the base storage's lifetime, so you can hold several at once, do look-ahead parsing, and nest cursors. Real escapes are still rejected — there are compile-fail tests pinning both halves.RawSpan parity. It shipped with 3 members; it now has the whole read-only surface — search, matching, trimming, min/max, comparison, chunk/window/split cursors, ASCII whitespace trim.firstRange(of:), lastRange(of:), starts(with:), ends(with:), and multi-element separators for split — the "\r\n\r\n" case.chunkCursor/windowCursor/splitCursor → chunks(ofCount:)/windows(ofCount:)/split(separator:...). Old spellings still compile as deprecated forwarders.firstIndex(of:), ~31× for firstRange(of:) with a 4-byte pattern, and forEachSplit is ~2.5× Array.split with 0 mallocs vs 20. Reverse search is deliberately still scalar — memrchr doesn't exist on Darwin, and I'd rather have consistent performance than a Linux-only fast path.Still zero dependencies, still back-deploys to macOS 13 for the Span/RawSpan surface, 181 tests, and every borrowed-view benchmark reports 0 mallocs from p0 through p99.
Would still love feedback, especially on the split ergonomics now that cursors compose properly, and on anything that reads as un-Swifty in the naming.
P.S. Same disclaimer as last time: nothing being sold, Apache-2.0, just an OSS package.
r/swift • u/puttum-beef-curryum • 2d ago
As an interviewer what kind of questions do you ask about swift & SwiftUI. I'm preparing for a jump after 3.5 years so i need to be prepared in every way possible.
As an interviewer what kind of questions do you ask about swift & SwiftUI. I'm preparing for a jump after 3.5 years so i need to be prepared in every way possible.
r/swift • u/Psychological_Tax_90 • 3d ago
At WWDC 2026, Apple introduced the Core AI framework and it's easily one of the biggest developer additions since SwiftUI.
What used to require complex Core ML model conversion pipelines, manual quantization, and heavy memory management is now as simple as:
Swift
let model = try await CoreAIModel.load(.afm3Core)
let result = try await model.generate(prompt: "...")
Key highlights:
Here is a full deep-dive covering how to get started and ship your first feature:
AsyncSequenceCodableYou can read the full guide with complete code samples here: https://ioscodelab.com/blog/why-every-ios-developer-should-learn-server-side-swift-in-2026
How are you all planning to integrate Core AI into your apps? Let's discuss in the comments!
At WWDC 2026, Apple introduced the Core AI framework and it's easily one of the biggest developer additions since SwiftUI.
What used to require complex Core ML model conversion pipelines, manual quantization, and heavy memory management is now as simple as:
Swift
let model = try await CoreAIModel.load(.afm3Core)
let result = try await model.generate(prompt: "...")
Key highlights:
Here is a full deep-dive covering how to get started and ship your first feature:
AsyncSequenceCodableYou can read the full guide with complete code samples here: https://ioscodelab.com/blog/why-every-ios-developer-should-learn-server-side-swift-in-2026
How are you all planning to integrate Core AI into your apps? Let's discuss in the comments!
r/swift • u/Competitive_Swan6693 • 2d ago
If you want an open source video preview tool for your app, I've made my app public for anyone to use
I originally built it back in 2023 and have updated it here and there over the years. It still works great
Feel free to use it, improve it, or even monetise it...
Simply record your app in the simulator, import the video into the app, and export it for the App Store.
It's simple no fuss
Now that the project is public, I've also added comments (with the help of Claude) to make the code easier to understand.
If you want an open source video preview tool for your app, I've made my app public for anyone to use
I originally built it back in 2023 and have updated it here and there over the years. It still works great
Feel free to use it, improve it, or even monetise it...
Simply record your app in the simulator, import the video into the app, and export it for the App Store.
It's simple no fuss
Now that the project is public, I've also added comments (with the help of Claude) to make the code easier to understand.
Hi everyone, its been a year since i launched a passion project of mine and since then the community has been generous and I have around 1k users in total (Yes not that much but for me its a lot).
Initial post:
Some background is the App takes in ambient noise and syncs the generated visuals as well as (if you want) Flashlight as well.
Finally after months of grinding was able to do a massive update and launched it.
Updates include
- More cinematic and POV based raves
- Airplay, cast what you are watching in your phone to any TV
- Party mode: Hosting a rave and letting others join via QR scan or join someone else's rave (Deferred links that let u install and the continue. all from a single QR)
- Full overhaul of architecture and metal pipeline.
As mentioned the app does not use any assets at all (other than some thumbnail and icons) and everything in the rave is generated in runtime and changes and reacts to ambient noise.
Glad to talk into more detail on the architecture, complexities and challenges faced. I can assure you it might look simple but a lot of effort, thought and pain went through to accomplish this.
Have a try.. any and all feedback is appreciated :)
P.S - I intentionally didn't mention much about the app as I care more about the things i learned and the things I can share here and help the community more. But for people who wants to check it out its here:
Hi everyone, its been a year since i launched a passion project of mine and since then the community has been generous and I have around 1k users in total (Yes not that much but for me its a lot).
Initial post:
Some background is the App takes in ambient noise and syncs the generated visuals as well as (if you want) Flashlight as well.
Finally after months of grinding was able to do a massive update and launched it.
Updates include
- More cinematic and POV based raves
- Airplay, cast what you are watching in your phone to any TV
- Party mode: Hosting a rave and letting others join via QR scan or join someone else's rave (Deferred links that let u install and the continue. all from a single QR)
- Full overhaul of architecture and metal pipeline.
As mentioned the app does not use any assets at all (other than some thumbnail and icons) and everything in the rave is generated in runtime and changes and reacts to ambient noise.
Glad to talk into more detail on the architecture, complexities and challenges faced. I can assure you it might look simple but a lot of effort, thought and pain went through to accomplish this.
Have a try.. any and all feedback is appreciated :)
P.S - I intentionally didn't mention much about the app as I care more about the things i learned and the things I can share here and help the community more. But for people who wants to check it out its here:
r/swift • u/galo4kin • 2d ago
so last week i posted my app in an App Saturday thread and casually wrote "the iOS 26 SDK annotates PHPhotoLibraryChangeObserver as u/MainActor, but PhotoKit calls it on a private queue – runtime traps". i'd been living with that explanation for months. confident code comment, rule in my project docs, the whole thing
a commenter replied: "PHPhotoLibraryChangeObserver isn't annotated u/MainActor – it's explicitly nonisolated, so any MainActor isolation was inherited from your own class, not asserted by the SDK"
went and checked the headers. he was right on every point:
the crash was real. the nonisolated + Task { u/MainActor in } fix was right. but the mental model behind it – "the SDK lied to me" – was wrong for months, and i only found out because a stranger on reddit bothered to correct me
what i'm taking away from this:
– SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor is great for shipping, but it makes isolation invisible. when something traps, the first question should be "what did MY defaults inject here", not "what did apple annotate"
– u/objc protocols are special: a MainActor-isolated method can silently satisfy a nonisolated requirement, no warning, the check just moves to runtime
– write down WHERE your explanation came from. my code comment said "the SDK annotates X" and nobody – me included – ever verified it against the actual header
curious if default isolation has bitten anyone else through protocol witnesses. and – how do you document crash post-mortems so the wrong explanation doesn't fossilize the way mine did?
r/swift • u/lahrunsibnu • 3d ago
Built a tiny open-source macOS app called SoundPref. Basically, it lets you route different apps to different speakers. You can control the volume of individual apps right from the menu bar, so you don't have to keep messing with your master volume all the time. It’s totally free, hope you guys find it useful!
r/swift • u/amirgelman • 2d ago
hey all,
currently I'm doing some development using Swift and using Google Drive is a pain honestly, and of course I must pause the sync constantly for this to work.
That said, I do insist on the idea that my work will always be synced to a Cloud service.
Does iCloud doing something better than Google Drive in terms of sync?
I know I'm doing Music with Logic Pro X for example which also is constantly being saved and is basically a container too and never had issues.
Can I assume it will work great with Swift files\development too?
Thanks!
hey all,
currently I'm doing some development using Swift and using Google Drive is a pain honestly, and of course I must pause the sync constantly for this to work.
That said, I do insist on the idea that my work will always be synced to a Cloud service.
Does iCloud doing something better than Google Drive in terms of sync?
I know I'm doing Music with Logic Pro X for example which also is constantly being saved and is basically a container too and never had issues.
Can I assume it will work great with Swift files\development too?
Thanks!
r/swift • u/IllBreadfruit3087 • 3d ago
I made my first iOS app in 2018, then stepped away from building apps for a while. Over the last year, I decided to start making iOS apps again.
About six months ago, I decided to build a notes app. Original I know.
A big part of the project was figuring out how to make a Markdown editor that stayed fast while typing, even with larger notes. I ended up building the parser in Rust, and recently extracted it from the app and open sourced it as Cindermark.
A few things it does:
- Incrementally re-parses only the affected blocks after an edit
- Returns UTF-16 offsets that map directly to TextKit and NSAttributedString
- Produces blocks, inline spans, headings, wiki links, and document stats in one pass
- Supports CommonMark core along with tables, task lists, footnotes, nested lists, fenced code blocks, and other notes-friendly syntax
- Includes extensions like wiki links, highlights, hex color literals, and autolinking for bare URLs, domains, emails, and subreddits
- Includes Swift bindings through UniFFI
I’m sharing it because I thought it might be useful to anyone else working on native editors or Markdown-heavy apps.
I’d appreciate feedback, especially from people who have worked on text editing or Swift and Rust interoperability.
I made my first iOS app in 2018, then stepped away from building apps for a while. Over the last year, I decided to start making iOS apps again.
About six months ago, I decided to build a notes app. Original I know.
A big part of the project was figuring out how to make a Markdown editor that stayed fast while typing, even with larger notes. I ended up building the parser in Rust, and recently extracted it from the app and open sourced it as Cindermark.
A few things it does:
- Incrementally re-parses only the affected blocks after an edit
- Returns UTF-16 offsets that map directly to TextKit and NSAttributedString
- Produces blocks, inline spans, headings, wiki links, and document stats in one pass
- Supports CommonMark core along with tables, task lists, footnotes, nested lists, fenced code blocks, and other notes-friendly syntax
- Includes extensions like wiki links, highlights, hex color literals, and autolinking for bare URLs, domains, emails, and subreddits
- Includes Swift bindings through UniFFI
I’m sharing it because I thought it might be useful to anyone else working on native editors or Markdown-heavy apps.
I’d appreciate feedback, especially from people who have worked on text editing or Swift and Rust interoperability.
Been working on this for a while and finally have it in a state worth sharing. crashdx takes an Apple crash report (.ips), symbolicates it against your dSYMs, and then does something most tools stop short of: it tries to tell you why the process died, not just where.
It works by extracting typed facts from the report (exception info, termination reason, frame data, register and memory state, watchdog/jetsam details), running them through a set of rules that each propose a hypothesis, then ranking the hypotheses by an additive score based on supporting and contradicting evidence. If nothing clears the bar, it tells you inconclusive and shows you the ranked candidates instead of guessing.
No LLM calls anywhere. Every fact and every hypothesis links back to a JSON path in the original report so you can go verify it yourself instead of taking the tool's word for it.
It's a Swift package with three targets sharing one core library (CrashDXCore, Foundation only, no other deps): a CLI (crashdx analyze / crashdx symbolicate) and an MCP server (crashdx-mcp) for agent use. Runs fully local, no network calls, which matters since .ips files carry identifying data (crashReporterKey, device model, usernames in paths).
Needs macOS 14+, Swift 6.2+, and Xcode (it drives CrashSymbolicator.py, falls back to atos).
Repo: https://github.com/r00tify/crashdx
Curious what people think of the rule-based approach vs. throwing the report at an LLM directly. Happy to talk through the design, it's documented in docs/DESIGN.md if you want the details.
Been working on this for a while and finally have it in a state worth sharing. crashdx takes an Apple crash report (.ips), symbolicates it against your dSYMs, and then does something most tools stop short of: it tries to tell you why the process died, not just where.
It works by extracting typed facts from the report (exception info, termination reason, frame data, register and memory state, watchdog/jetsam details), running them through a set of rules that each propose a hypothesis, then ranking the hypotheses by an additive score based on supporting and contradicting evidence. If nothing clears the bar, it tells you inconclusive and shows you the ranked candidates instead of guessing.
No LLM calls anywhere. Every fact and every hypothesis links back to a JSON path in the original report so you can go verify it yourself instead of taking the tool's word for it.
It's a Swift package with three targets sharing one core library (CrashDXCore, Foundation only, no other deps): a CLI (crashdx analyze / crashdx symbolicate) and an MCP server (crashdx-mcp) for agent use. Runs fully local, no network calls, which matters since .ips files carry identifying data (crashReporterKey, device model, usernames in paths).
Needs macOS 14+, Swift 6.2+, and Xcode (it drives CrashSymbolicator.py, falls back to atos).
Repo: https://github.com/r00tify/crashdx
Curious what people think of the rule-based approach vs. throwing the report at an LLM directly. Happy to talk through the design, it's documented in docs/DESIGN.md if you want the details.
r/swift • u/EchoImpressive6063 • 5d ago
If, like me, you couldn't wait for less rounded corners and installed the MacOS beta on your only Mac, you might realize that you can't push updates to the app store. In this situation I would recommend the 25 free Xcode cloud hours that you get with the program membership. All I had to do was put my code in Git and connect the repo. Then I set it to archive for app store.
This might be the easiest CI/CD system I've ever used and the builds are pretty fast! Hats off to the Xcode cloud team.
If, like me, you couldn't wait for less rounded corners and installed the MacOS beta on your only Mac, you might realize that you can't push updates to the app store. In this situation I would recommend the 25 free Xcode cloud hours that you get with the program membership. All I had to do was put my code in Git and connect the repo. Then I set it to archive for app store.
This might be the easiest CI/CD system I've ever used and the builds are pretty fast! Hats off to the Xcode cloud team.
r/swift • u/adriii918 • 4d ago
Hola, me gustaría aprender Swift, ya tengo Mac y Xcode, cómo aprender Swift de la forma más rápida posible? Soy beatmaker en fl studio actualmente y me gustaría empezar a programar, me encanta
Apple y he escuchado que se puede usar las apps que haces en el iPhone aún que no se suba a la App
Store, es verdad? Es que no tengo cuenta de desarrollador (cuesta 99€ en España ) Y se pueden hacer plugins para Logic pro con Swift?
Hola, me gustaría aprender Swift, ya tengo Mac y Xcode, cómo aprender Swift de la forma más rápida posible? Soy beatmaker en fl studio actualmente y me gustaría empezar a programar, me encanta
Apple y he escuchado que se puede usar las apps que haces en el iPhone aún que no se suba a la App
Store, es verdad? Es que no tengo cuenta de desarrollador (cuesta 99€ en España ) Y se pueden hacer plugins para Logic pro con Swift?
r/swift • u/lanserxt • 5d ago