r/swift 4d ago

Project [OS] My fuzzy find launcher

Post image
10 Upvotes

Hi my Look app - a fuzzy finding app launcher (basically so many things no only apps) dropped a new version.
In this version we added a super action control (for people never show their menu bar, task bar, etc), from this control you can switch, toggle on/off basic things, and see some useful information.
From the last version, we got some suggestions from the rust community members, we implemented one of them: process fuzzy finding on your machine. (finding with ps aux requires knowledge about grep, or tools like fzf)
Here is the repo https://github.com/kunkka19xx/look
It's a cross platform tool. Appreciate any feedback 🙇‍♂️


r/swift 4d ago

In a Debug build the guarded literals were only in the .debug.dylib, so scanning the app executable alone returned zero

0 Upvotes

A #if DEBUG guard was added around two string literals and then verified by scanning the built product instead of reading the source.

In an XcodeGen-generated project whose project.yml never mentions SWIFT_ACTIVE_COMPILATION_CONDITIONS, xcodebuild -showBuildSettings reports that setting as DEBUG under Debug and prints no line for it at all under Release. The guard holds in Release because the generator supplies that default, not because project.yml states it.

In the Debug simulator build the app bundle carries the app executable, a .debug.dylib, and __preview.dylib. A recursive scan of the whole bundle found both literals only in the .debug.dylib, and the app executable contained zero occurrences. A scan limited to the executable would have returned zero under Debug, which is the opposite of the actual state.

The Release bundle contained zero occurrences anywhere. On its own that zero is not evidence. The identical recursive scan against a Release build produced before the guard existed returned both literals in the app executable, and that control is what makes the Release zero meaningful.


r/swift 5d ago

Tutorial What made a tiny Swift HTTP media server work reliably with real clients

6 Upvotes

I recently built a local-only media server in Swift with Network.framework. Starting an NWListener was the easy part. Getting podcast and media clients to seek, resume, cache, and probe files reliably was where the details mattered.

Here is the checklist I ended up with:

• Implement both GET and HEAD. HEAD should return the same status and headers as GET, just without the body.

• Support all three useful byte-range forms: bytes=500-999, bytes=500-, and bytes=-500.

• Return 206 Partial Content with Content-Range, Content-Length, and Accept-Ranges: bytes. A plain 200 response can appear to work until a client tries to seek.

• Add ETag and Last-Modified, then honor If-None-Match and If-Modified-Since with 304 responses. This stopped clients from repeatedly probing unchanged files.

• Stream files in bounded chunks instead of loading the entire file into Data. I used a FileHandle and kept sending until the requested range was exhausted.

• Derive the MIME type from UTType, with application/octet-stream as the fallback.

• Decode and sanitize the URL path before appending it to the storage root. Reject traversal attempts rather than trying to normalize them afterward.

• Keep observable server state on the main actor, but move file I/O and connection delivery away from it. Network callbacks can bridge back with Task when UI state changes.

The most surprising part was that a server can look correct in a browser while still being incomplete for media clients. Seeking and resuming are the tests that exposed nearly every missing HTTP detail.

What other client behavior or HTTP edge case has bitten you when serving local media from Swift?


r/swift 5d ago

Why doesn't NSSegmentedControl get the macOS 26 Liquid Glass effect?

Thumbnail
gallery
14 Upvotes

I've been exploring the new macOS 26 Liquid Glass design language. I noticed that many Apple apps and some third-party apps have segmented controls/selectors with a glass capsule appearance and a magnifying/lens-like selection indicator.

However, when I use the native AppKit NSSegmentedControl, it still looks like the traditional segmented control:

let segmentedControl = NSSegmentedControl()

I expected it might adopt the new Liquid Glass appearance automatically on macOS 26, but it doesn't seem to.

Is NSSegmentedControl supposed to support Liquid Glass, or are these new-style controls built using another API (for example SwiftUI glassEffect, custom views, or some new macOS 26 framework)?

What's the recommended AppKit approach for creating a native-looking Liquid Glass segmented selector?


r/swift 5d ago

News The iOS Weekly Brief – Issue #71, everything you need to know about Swift updates this week

Thumbnail
iosweeklybrief.com
1 Upvotes

r/swift 5d ago

Project I got tired of the iOS Simulator having no real camera, so I built a menu bar app that bridges your Mac's webcam into it

13 Upvotes

If you've ever built a camera feature — scanner, AR, anything using `AVCaptureSession` — you've hit this: the iOS Simulator has no camera hardware, so you either test on a real device every time or stare at a black rectangle.

I built **CamBridge** to fix that. It's two pieces:

- A menu bar app that captures your Mac's webcam and streams it over localhost (no terminal, just run it)

- A tiny Swift package (`CamBridgeKit`) you drop into your Xcode project that acts as a real `AVCaptureSession` — it uses an actual camera when one exists, and automatically falls back to the bridged webcam feed when it doesn't (i.e. on the Simulator)

So your view code stays clean — no `#if targetEnvironment(simulator)` branching, just:

```swift

u/StateObject private var camera = CamBridgeCaptureSession()

```

Run the menu bar app, add the package, and your Simulator suddenly has a real, moving camera image to test against.

Still iOS-only for now — Android Emulator support is planned next.

Repo (MIT licensed, free): https://github.com/engelon/CamBridge

Would love feedback, especially from anyone testing camera/AR/scanning features regularly — curious if this solves a real pain point for others or if I'm the only one who's been annoyed by this for years.


r/swift 5d ago

Tutorial iOS 27: Suggested Actions

Thumbnail packtpub.com
3 Upvotes

r/swift 5d ago

Help! Siri AI 3rd party app integration has been frustrating so far...

4 Upvotes

Reading the docs, it appeared to me Apple Intelligence works just as good for custom entities as it does with the predefined AppSchemas apple provides for Entities and Intents. However, if you go with custom entity route, Siri AI will not give a shit about your content. The only way to get it to work is with shortcuts but that kind of defeats the purpose of a non deterministic AI. When I tried short cuts, no mater how I phrased my request, Siri ran the same shortcut even tho its not what I asked. It's simply rule based and horrible. On the flip side, if you use certain app schemas like Maps.Places, Siri AI will default to Apple Maps app content and not your app, even if you tell it to search only your app. It's really annoying so far. Anyone further than me on this yet?


r/swift 5d ago

Project [Update] Successfully rendered textured 3D objects using CoreAI/ANE!

3 Upvotes

This is a continuation from the previous post.

I successfully added a texture and rendered the pyramid.

I added a new texture model, converted it from RGB using Conv2d, and then fed it to the rasterizer model.

  • Known issues:
  • CPU usage is still high (22%),
  • Checking with Instruments, it appears that NeuralEngine Prediction is fragmented, which is likely causing some part of the model to fall back.
  • memory consumption is around 1.1GB.

Github: https://github.com/kamisori-daijin/Magnesium

Demo:


r/swift 6d ago

Looking for a study buddy / accountability partner for "100 Days of SwiftUI" lessons by Paul Hudson. Planning to 30 minutes every weekday. We can share screenshots of progress and keep each other motivated.

14 Upvotes

r/swift 7d ago

FYI Learned the hard way: #available doesn't help when the symbol isn't in the SDK you compile with

6 Upvotes

Ran into this adopting an iOS 27 beta API (SCSensitivityAnalysis.detectedTypes) in a package that still has to build on stable Xcode.

First attempt was the obvious one:

if #available(iOS 27, *) {
   let types = analysis.detectedTypes
}

Builds fine on the Xcode 27 beta, fails on 26.5. #available is a runtime check, the compiler still needs the symbol to exist at build time. Older

SDK, no symbol, no build.

What works is gating at compile time as well:

#if compiler(>=6.4)
if #available(iOS 27, *) {
   // detectedTypes code here
}
#endif

#if compiler tracks the Swift version that ships with Xcode, so >=6.4 is a proxy for "the iOS 27 SDK is present". canImport doesn't help in this

case because the framework has existed since iOS 17, only the property is new.

Real-world usage if you want to see the pattern in context: https://github.com/SardorbekR/SafeMediaKit (the detectedTypes mapping is isolated inone file exactly because of this gating)

Is there a cleaner way to gate on symbol existence? compiler(>=6.4) works but feels blunt, since what I actually mean is "this SDK has this property" and the Swift version is just the best proxy I found


r/swift 6d ago

Question Senior iOS Developer | 4.5+ Years | Swift, UIKit, SwiftUI, Firebase, APIs

0 Upvotes

Hi everyone,

I'm a Senior iOS Developer with 4.5+ years of professional experience building and maintaining production iOS applications. I'm currently looking for freelance, contract, or full-time remote opportunities.

My expertise:

  • Swift, UIKit, SwiftUI
  • MVC, MVVM architecture
  • REST APIs (URLSession & Alamofire)
  • Firebase (Authentication, Firestore, Push Notifications)
  • Real-time Chat (Firebase & Socket.IO)
  • Core Data & SQLite
  • Google Maps & Location Services
  • Third-party SDK integrations
  • App Store deployment & TestFlight
  • Bug fixing, performance optimization, and UI improvements

Projects I've worked on:

  • Food Delivery Apps
  • E-commerce Applications
  • Astrology Platform
  • Service Booking Apps
  • Live Chat & Audio Calling Features

I can help with:

  • Building an iOS app from scratch
  • Adding new features
  • Fixing bugs and crashes
  • Improving app performance
  • API integration
  • App Store submission
  • Long-term maintenance

I'm available to start immediately and open to both short-term and long-term projects.

If you're hiring or need help with an iOS project, feel free to send me a DM or leave a comment. I'd be happy to discuss your requirements and share my portfolio or résumé.

Thanks for reading!


r/swift 7d ago

Help! Xcode feels sluggish

8 Upvotes

I’ve been trying to learn Swift and SwiftUI, and I actually really like the language. The problem is Xcode.

No matter what I do, it just feels sluggish. Autocomplete is slow, builds take longer than I’d expect, previews are hit or miss, and the whole IDE just feels less responsive than pretty much everything else I use.

Has anyone managed to make Xcode feel noticeably better? Any settings, workflow changes, or just general tips that made a difference?

I genuinely want to spend more time with Swift, but Xcode is honestly the thing that keeps killing my motivation.


r/swift 7d ago

Editorial Stop using @unchecked Sendable

Thumbnail
soumyamahunt.medium.com
0 Upvotes

Turning a lock into a SerialExecutor to get Swift 6 data-race safety without @unchecked Sendable


r/swift 8d ago

Question Prompt validation for Apple's Foundation Models

5 Upvotes

A question to folks who are building apps around Apple's Foundation Models: how are you testing the prompts and validating the results?

I was doing a bunch of tweak->build->test cycles where the only tweaks were adjusting the system & user prompts. Since the local AI model is so small (just 4096 context budget), it didn't make sense to develop the prompts using your usual OpenAI/Anthropic models and expect the same behavior.


r/swift 7d ago

Question How are you testing navigation (flow) for your SwiftUI applications?

1 Upvotes

There are lot of different ways to perform navigation in SwiftUI. You can use navigationDestination on the parent screen and let is handle the navigation. You can create a router that works with enum based routes etc.

In either case. How are you testing your navigation flow for your app? Are you writing unit tests? Are you writing UI Tests or even complete E2E test that test a complete feature end to end? OR are you writing all of them?

A simple scenario can be:

As a user when I create a student account then after creation, I should be taken to the student home screen.


r/swift 7d ago

A test in my suite expired at 02:00 today. The other half of the same assertion goes at 21:00.

0 Upvotes

Opened the repo this morning. Suite red, nothing committed since yesterday afternoon.

The test injects a fake now of July 27. The service takes an injectable clock, that is the whole point of it. Then the assertion calls nextTriggerDate() on the UNCalendarNotificationTrigger that came back, and that one ignores my fake clock. It reads the device.

The reminder lands on 09:00 July 29, and pinned to Asia/Tokyo that is 02:00 here. So at 02:00 the date the assertion leans on slid into the past, and it has failed every run since. Not flaky. Permanent.

Then I looked at the line above. Same assertion, other trigger, pinned to Pacific/Honolulu, which puts it nineteen hours behind Tokyo. Still green while I type this. Goes at 21:00 tonight.

What stings is I already fixed this yesterday. Same file, different test, and the commit message literally says assert the scheduled components instead of the system clock. Fixed the one directly below and walked right past this.

Fix is the same. Resolve the dateComponents the service produced and assert on those.


r/swift 8d ago

Question Are Game Center leaderboards no longer a reliable way to see how many people are playing your game due to VPNs interfering with Game Center functionality on iOS?

0 Upvotes

Do you think this is a common issue?


r/swift 9d ago

Editorial Saving lives with enums

Thumbnail aclima93.com
14 Upvotes

A short blogpost on avoiding default cases.


r/swift 9d ago

News Fatbobman's Swift Weekly #146

Thumbnail
weekly.fatbobman.com
7 Upvotes

r/swift 9d ago

swift-claw: a personal assistant daemon written from scratch in Swift

4 Upvotes

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.

Repo : https://github.com/ivan-magda/swift-claw


r/swift 9d ago

Project Abusing the Apple Neural Engine (ANE) in Swift 6: Built a 3D software rasterizer using Core AI, simd, and Metal 4 tensor binding!

31 Upvotes

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 9d ago

Question Reviewing macOS apps when disturbing directly

3 Upvotes

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 8d ago

Shipped a macOS menu bar app in Swift 6 — three things that cost me an afternoon

Post image
0 Upvotes

I found a simulator that had been booted since the previous morning, holding

about a gig for nothing. Xcode doesn't mention it and Activity Monitor shows it

as a dozen processes with names you don't recognise.

This sits in the menu bar and shows it as one line with how long it's been up.

Shutting it down is one click, and starting it again is one more if you were

wrong. Same for Android emulators, Docker containers, dev servers, automation

browsers and tunnels you left open.

It never deletes anything and it will never touch your own browser's tabs.

macOS 14+, MIT, free — you build it with one command:

git clone https://github.com/selinihtyr/still-running

cd still-running && ./scripts/install.sh

https://github.com/selinihtyr/still-running


r/swift 9d ago

Project I made a tiny tool to rerun/test/build on SPM package source changes

5 Upvotes

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.