r/SwiftUI • • 19h ago

Tutorial My Swift layout: one Xcode project, no workspace, one local package for every platform

Thumbnail
aleahim.com
0 Upvotes

I build for SwiftUI, AppKit and UIKit on Mac, iPhone and iPad, and my layout used to start with a workspace. A project template can create and open a project, but it can't leave you in an open workspace.


r/SwiftUI • • 6h ago

Solved I rebuilt a Linux desktop's bar panels in SwiftUI, matching the original's design pixel for pixel

Post image
3 Upvotes

For my project omarchy-macos (Omarchy's Linux desktop look, on macOS), I rebuilt Omarchy's QML bar panels as a SwiftUI menu-bar app: Wi-Fi, audio, Bluetooth, power, display, calendar and weather.

Some things that were interesting to solve:

- Porting QML layouts to SwiftUI with the same metrics and font scale

- Following the theme live: every panel re-renders from a palette file when you switch themes

- Talking to CoreAudio, CoreWLAN, IOBluetooth and DisplayServices directly

- A ~30 KB C client so clicks on the bar open panels instantly (launching the Swift binary added visible lag)

It's built with swiftc and a shell script, no Xcode project. Source (MIT):

https://github.com/prashantkoirala465/omarchy-macos/tree/main/src/barpanel

Feedback on the code is welcome.


r/SwiftUI • • 12h ago

A native SwiftUI iPad/iOS/MacOS client app for a local LLM

0 Upvotes

I built a native SwiftUI iPad/iOS/MacOS client app (not a chromium or browser control hosted like most of the people do) for a local LLM served by any OpenAI-compatible server over the LAN. It’s a chat harness with streaming, conversation history, tool calling, and settings. Partially as a learning exercise in building a harness and partially as a way to access my LLM when I am away from my computer. Here’s the repo: https://github.com/alexyak/Sparkle

Planning to add more features like skills, agents… etc.. There’s an option to use a local on-device Apple model as well.

Disclaimer: I have a decades-long experience in software and application development, including iOS development, but I have been gladly accepting the help from Claude Coding agents 😉. 


r/SwiftUI • • 19h ago

Open-sourced Snagless: SwiftUI @Environment crashes caught at build time, using SwiftSyntax

0 Upvotes

Our codebase has hundreds of `@Environment` call sites. Any one of them can crash in production with "No Observable object of type X found" if a view gets shown without the value injected somewhere above it, and the compiler can't see it. Every fix I found started with "first, change all your call sites."

So I built Snagless, a SwiftPM/Xcode build plugin. It reads your SwiftUI source with SwiftSyntax, works out which view shows which across modules, and fails the build when a view can appear without a value it needs. Zero code changes, about 90 ms on a 431-file app.

Built with Claude Code, and the write-up is upfront about every time the AI was wrong and what caught it.

Write-up: https://tarek-builds.dev/p/swiftui-environment-crashes-compile-just-fine-so-i-made-them-fail-the-build/
Repo: https://github.com/tareksabry1337/snagless

Happy to answer questions.


r/SwiftUI • • 3h ago

Tutorial iOS 27.1: DeviceHinge

Thumbnail
antongubarenko.substack.com
2 Upvotes

r/SwiftUI • • 19h ago

Solved GitHub - SRAYANSH-GUPTA/Blackburn---Ios-Dev-on-linux

Post image
2 Upvotes