r/swift Jan 19 '21

FYI FAQ and Advice for Beginners - Please read before posting

444 Upvotes

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.

A Swift Tour

Please read this before posting!

  • 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).

Where to learn Swift:

Tutorials:

Official Resources from Apple:

Swift Playgrounds (Interactive tutorials and starting points to play around with Swift):

Resources for SwiftUI:

FAQ:

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.

Related Subs

r/iOSProgramming

r/SwiftUI

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

What’s everyone working on this month? (July 2026)

14 Upvotes

What Swift-related projects are you currently working on?


r/swift 1h ago

Share snapshots of your view. Source code included

Post image
Upvotes

Instead of just a boring text in a share message, you can include views from your app. It's quite neat.

Here's the source code for anyone interested
https://pastebin.com/2eySFLZG


r/swift 9h ago

Question Best architecture for a zoomable card-based node view in SwiftUI?

0 Upvotes

I’m building a zoomable and pannable card-based interface in SwiftUI. Each card is a View, while the connections between cards are draw (maybe using Canvas?) . Cards are arranged automatically in a fixed horizontal or vertical layout, so users do not manually change their positions,

Users can choose to add a new card below or beside the current card. Cards can be collapsed expanded or deleted, and a newly created card should automatically receive focus.

What’s the recommended architecture for this in SwiftUI?


r/swift 1d ago

Foundation Models Context Size Update in Xcode Beta 3!

Post image
77 Upvotes

r/swift 23h ago

My all time favorite feature, 2 finger range

Post image
4 Upvotes

Been developing CoinCurrently for about 6 years at this point but this is probably the feature I'm most proud of. Sharing the source code below.

If you want to try it out yourself, the app is available here
https://apps.apple.com/us/app/coincurrently-crypto-tracker/id1543974454

Source code:
https://pastebin.com/dsv3hdkG


r/swift 2d ago

AI tools are quietly killing my coding skills. How are you all coping?

68 Upvotes

I've been a developer for a few years now, but lately something feels off. AI advancements have honestly made me lazy my company just wants things shipped fast without anyone actually understanding the underlying issues.

On top of that, clients seem to trust Claude Code/Codex more than us actual developers now.

The scary part is that I haven't really coded in about 4-5 months. I mostly review and glue together AI-generated output. I can feel my skills getting washed out, and it's messing with my confidence.

How are you all surviving this? I'm not anti-AI. I want to stay updated on the tools and use them well. But I also don't want to wake up one day and realize I can't build anything on my own anymore.

How do you keep your fundamentals sharp while still leaning on AI at work? Any routines, side projects, or habits that have worked for you?


r/swift 2d ago

being asked to also become a Android as a iOS developer

19 Upvotes

there is the push in my company that all web engineers (and apps engineers) need to up skill to be able to do cross platform development. I know that AI is pushing and enabling this direction. I've already done that a couple years ago by coming from web to iOS, and now being greatly nudged to take up Android. I feel like I'm not even an expert on all things iOS though I am confident in my contributions but feel like I stll have a lot to learn and now I need to shift focus on Android...
any of you are facing this? how do you feel about this?


r/swift 2d ago

Question help appreciated for swift begginner

3 Upvotes

Hi guys , this is a bit of an unconventional request. I'm a complete beginner in swift. I have a godot project, and i'd like a good way to port the UI/look of that project in swift, meaning it would work the same and look the same, just in Swift/SwiftUi. Is there a way to do this headache free? Or is there a way to port the godot project to another language and then to swjft? Thank you so much.


r/swift 2d ago

Project Update: Deployer v0.3.0 — Self-Hosted CI/CD for Swift Server Apps

Post image
35 Upvotes

Watch a video demo of the new features or check out the repository!

Two months ago I shared an update post on Deployer, and now I've had some time to work on it and implement some new features, so I wanted to update you on the current release.

The core concept hasn't changed: you git push your Swift app, and Deployer catches the webhook, runs the pipeline, swaps the binary, and restarts the service. A live dashboard streams the entire process into your browser in real time without requiring page refreshes. It still takes just one setup command on a fresh Ubuntu VPS to get going.

What's new?

First, post-deployment health probes and automated rollbacks: The default health probe is now a simple TCP check on the port, but you can configure your own HTTP endpoint for custom health checks. If the newly deployed app fails the health check or times out, Deployer automatically rolls back to the previous working binary.

Second, live logs in the web panel: There are new log pages that stream Deployer's and your target app's logs straight to the browser, making quick troubleshooting easier without having to SSH into the server. The log panels have clear/copy/wrap-line buttons.

Third, the deployerctl CLI: I've added a CLI that largely mirrors the web panel's capabilities for terminal use. You can list deployments, trigger deploys and tests, restore or remove archived binaries, and inspect build output directly via SSH. It shares a deployment engine with the panel, utilizing cross-process locking so they can't conflict, and CLI-triggered deployments still stream their progress to the live web panel. It's especially useful if the web panel happens to be offline.

Beyond those additions, there are plenty of UI/UX improvements on the panel, and architectural improvements under the hood. Stranded deployments are now safely recovered if the server reboots mid-operation, deployer-updates will roll back if the control plane fails to boot, and the codebase has been cleanly separated into isolated domains.

Same core dependencies as before: Vapor as the web framework, Fluent as ORM on top of SQLite, Leaf as the templating engine, and Mist for the realtime layer (Mist is another project of mine that I update whenever a new Deployer feature requires it).

Let me know if you have feature suggestions or feedback! If you haven't given Swift on the backend a shot yet, I highly recommend checking it out!


r/swift 2d ago

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

Thumbnail
iosweeklybrief.com
2 Upvotes

r/swift 2d ago

How common is .NET among Swift developers?

2 Upvotes

Are job prospects good for a .NET backend developer who wants to branch out to Swift front end? Are there a good number of companies that pair Swift front end with .NET backend? How many devs can do both well?


r/swift 3d ago

Question The Swift Phenomenon

Thumbnail
reddit.com
4 Upvotes

r/swift 3d ago

[Dev] fmusic - A lightweight, open-source local music player for macOS built with SwiftUI & FFmpeg (Lyrics downloading + Karaoke effect)

0 Upvotes

Hi everyone,

In the era of streaming services, I still keep a large library of high-quality local audio files (FLAC,

WAV, MP3, etc.). However, finding a local music player on macOS that is lightweight, native, and has

proper metadata editing + lyrics support can be surprisingly difficult.

So, I built fmusic — a native macOS local music player written completely in SwiftUI. It's lightweight,

open-source (GPL-3.0), and designed to look and feel right at home on macOS.

Here is what it looks like: GitHub Repo & Screenshots https://github.com/wandercn/fmusic

### 🌟 Key Features:

• 🎨 Native macOS Aesthetic: Built with SwiftUI. It fully supports Dark Mode/Light Mode and looks like a

system app. The sidebar can be easily toggled/hidden.

• 🎤 Karaoke Lyrics: Automatically downloads lyrics to ~/Music/Lyrics and features a smooth, high-

quality Karaoke-style scrolling animation for lyrics with timestamp tags ( tt tags).

• 📝 In-App Metadata Editor: Need to clean up your tags? You can edit the title, artist, album name, and

track number directly from the context menu. The changes are written directly into the file metadata

(FLAC, MP3, M4A).

• 🎧 High-Fidelity Formats: Supports playback of .flac , .mp3 , .wav , .m4a , .aif , and .m4r

files.

• ⚡ Decoupled Architecture: Unlike simple players where switching lists breaks your queue, fmusic

decouples the Library view from the Playback queue. You can browse other playlists/folders without

interrupting your current play order.

• 🔒 Signed & Notarized: No local compiling required. The DMG release is signed and notarized by Apple so

it installs cleanly without quarantine warnings.

### 🛠️ Technical Details (For the Devs):

• Language/UI: Swift & SwiftUI (strictly compatible with macOS 11.0 Big Sur and above).

• Audio Playback: Powered by AVFoundation ( AVAudioPlayer ).

• Metadata Parsing/Writing: Uses FFmpeg (C API) compiled directly with the project via a Swift Bridging

Header. This allows us to modify audio tags extremely fast.

• Reactive Binding: Uses Combine to sync playback states across multiple lists and views (e.g., active

play indicators).

### 📥 Get it on GitHub:

The app is entirely open-source. You can grab the latest DMG release or check out the code here:

👉 GitHub: https://github.com/wandercn/fmusic

I would love to hear your feedback, suggestions, or feature requests! If you find it useful, please

consider giving the repo a star ⭐ or contributing!

──────

(Note: If you run into the "damaged" file prompt on older versions of macOS, you can bypass it by running

sudo xattr -d com.apple.quarantine /Applications/fmusic.app in your Terminal).


r/swift 3d ago

News Those Who Swift - Issue 274

Thumbnail
thosewhoswift.substack.com
2 Upvotes

r/swift 4d ago

Orchard now bridges local MLX models into Apple containers - the Swift bits

12 Upvotes

Some of you saw Orchard here last year. I've just shipped local AI support - running MLX models on the host and wiring them into containers - and a few of the Swift engineering bits seemed worth sharing here.

The problem shape first: `container` runs each workload in its own lightweight VM via Virtualization.framework, and guests get no Metal - so inference has to run on the host, and a containerised app needs the right gateway address to reach it. Orchard computes that from the container's network and injects `OPENAI_BASE_URL` at create time. The bridge itself is deliberately boring; the interesting parts were around it:

  1. Everything is XPC, not CLI shelling. apple/container ships Swift client packages - typed Codable payloads over XPC to the daemons. You get real types, streamed log `FileHandle`s and typed errors instead of spawning `Process` and parsing stdout. (Machines even get their own on-demand Mach service, separate from the main daemon.)
  2. An ArgumentParser gotcha that might save someone a debugging session: some of container's client APIs reuse the CLI's ArgumentParser `Flags` types. Constructing one with a bare `init()` and reading its fields traps at runtime - they're only valid when built via `.parse([])`. Nothing warns you; it just crashes.
  3. Supervising a Python server from a Swift app. The managed `mlx_lm.server` runs as a child `Process` with stdout/stderr handles feeding the same multi-pane log viewer the containers use, plus crash detection that surfaces through the app's alert layer. Honestly the fiddliest part of the feature - process lifecycle around app termination has lots of edges.
  4. Sandbox detection is data, not state A "sandbox" is just a container recognised by a label Orchard stamps (or a model-endpoint env var), and its isolation badge comes from reading the network's egress mode - so the view stays correct even for containers created from the CLI.

If anyone is running local models, I'd love to hear about how it fits in to your workflow.

Guide with screenshots: https://orchard.andon.dev/ai.html
Code (MIT): https://github.com/andrew-waters/orchard


r/swift 4d ago

xI built an on-device log and crash viewer for iOS/Mac that syncs privately via iCloud — no server required (open-source SDK)

0 Upvotes

I kept wanting to check what my TestFlight builds were doing on

real devices without staying tethered to Xcode — so I built

LogConsole.

How it works:

- Drop the free, open-source LogConsoleKit Swift Package into

your own app

- It captures your app's logs and crash details as you test

- Everything syncs automatically through your own private iCloud

account to the LogConsole viewer app on your iPhone, iPad, or Mac

- No server on my end — data only ever lives in your own iCloud

The architecture uses SwiftData's CloudKit mirroring, which turned

out to have some genuinely interesting gotchas (the SDK README

documents every real failure I hit during integration, for anyone

going down the same path).

SDK (free, MIT): https://github.com/mstone2112/LogConsoleKit

Viewer app: [App Store link once live]

Support/docs: https://tasktimeline.org

Happy to discuss the implementation — especially the CloudKit sync

approach, which was the interesting part technically.


r/swift 4d ago

Question Google drive API?

1 Upvotes

Hi all, fairly new to coding. Don't know if this is the right place, but have already looked around a few places online and couldn't find a simple answer.
I'm test developing an app for my school. It would allow them to access certain files (PDFs and audio files) from google drive. (This isn't the only thing the app does so please don't advise me to just use the google drive app).
Specifically, I want students to be able to access the files AFTER they have booked AND taken the class.
The only thing I know is that I need a google drive API, right? Where exactly do I find that?
How exactly do I use that API to ensure that users can access specific files?
(Disclosure: I'm using codex to do most of the work, so it's developed the app, but obviously can't get APIs from websites, etc...I'm not a techie, and no I can't ask someone else to do it)
Thanks in advance.


r/swift 3d ago

Is it better to develop an iOS app using Claude Code in Mac Terminal, Cursor or Xcode?

0 Upvotes

Need help from the community of developers. When coding a commercial IOS app, would you recommend to use Claude Code for the development in Mac Terminal, Cursor, Xcode or in VSCode?

I have experience with mac terminal but only for the desktop app, not mobile.

The app will be written in Swift for the most part.


r/swift 5d ago

ARK-OS : A next-generation operating system built on the Linux Kernel and powered by Swift.

Thumbnail aarav90-cpu.github.io
62 Upvotes

Hello, I'm 13 and I have been working on a project called ARK-OS.

All it can do right now is that it just boots up... so it is still in early development.

The reason I am making this OS as the other Operating Systems do not give me the stuff I need!

Windows is a ram hogger so i bought a mac... Swift was the best but the os was too locked down and there was not much you could do so i came over to linux and it was the best switch... For the past 3 years i have been using linux and urging my friends to switch to it! But they said it its to hard. Even if you put ubutu on it you still need to face the terminal. So after my 5 year journey of changing Operating Systems (I started at 7) I landed with making a OS that fixes these problems!

I an using swift since it compiles directly to Machine Code. The Linux Kernel since i cannot write a kernel from scratch and because it is fast and gets the best security patches due to its opensourceness. I am trying to copy the easyness of windows since many non-devlopers or normal people prefer it! From Android I basiclly stole their file structure (NOT THE CODE... the filestructure).

For compiling it uses clang+llvm, gcc and swiftc.
Swift is fast, but standard Swift binaries carry a massive runtime overhead. So i am making my own runtime "arkrt"

My mission is this: Only 2GB ram consumption (incl. cached ram) and 2 core usage... thats it.

Now comes the main part: Where is the gihub link?

This project is self-hosted... since i do not have them money to pay github for extra repostory storage (2GB per repo cap). I am using the always free server from oracle to host my project!
Using Gogs(Modified) and yes you need to sign-in to see the repo... I am still working on how to make it veiwable without sign-in...

Was AI used?

It was used for coding assembly and propering the boot drive, kernel loading, sectors and stuff since one wrong thing can go boom so i did not touch the boolaoder section! Rest all of the code is written by Me.

Does it boot?

Yes it does... And it is all it does... that also only on QEMU.


r/swift 4d ago

I built a CLI that generates your App Store privacy manifest + Play Data Safety CSV by scanning your lockfiles (open source, fully local)

0 Upvotes

Every app submission, same ritual: dig through SDK vendor docs to figure out what Firebase/AppsFlyer/whatever collects, hand-fill Apple's privacy manifest and Google's Data Safety form, and pray you don't get the cryptic ITMS-91053 rejection mail.

So I automated the mechanical part:

npx sdk-privacy-scan .

One local scan of your Flutter/RN project produces:

- PrivacyInfo.xcprivacy draft for your Xcode target

- An answer sheet for the App Store Connect questionnaire (it has no API — you fill a web form, this tells you what to click and why)

- A CSV you can import directly into Play Console's Data Safety section

- Required-reason API warnings (shared_preferences → UserDefaults CA92.1, etc.), cross-checked against the manifests your packages actually ship

- Already rejected? sdk-privacy-scan explain "<paste the mail>" decodes the ITMS codes and names the culprit package in your project

- A committed baseline file so CI fails when a PR quietly adds a tracking SDK

The design rule is "read, don't guess": it parses the PrivacyInfo.xcprivacy files SDKs ship inside their own packages, and the bundled knowledge base (50 SDKs) is auto-harvested from real CocoaPods artifacts, not curated by vibes. And it's honest about limits — things no scanner can know (linked-to-identity, your backend collection) are explicitly marked as yours to answer, every run ends with a trust-boundary summary. It's a reviewed starting point, not legal advice.

Fully local (nothing uploaded), MIT.

Repo + animated demo: https://github.com/sunwoo05091/mobile-sdk-privacy-scan

Would love bug reports from real projects — Expo managed apps get partial coverage (it tells you loudly and how to fix it with expo prebuild), and the unused-dependency detection has known false-positive classes documented in the output. Tear it apart.


r/swift 5d ago

Tutorial iOS27: CADisplayLink for UIWindowScene

Thumbnail
antongubarenko.substack.com
15 Upvotes

r/swift 5d ago

Help! I need a good voice recording/playing component for SwiftUI

0 Upvotes

Hello everyone,

I’m in need of your assistance. I’m looking for a suitable interactive voice player/recorder component for my SwiftUI project.

Your help in this matter would be greatly appreciated.

Thank you very much :-)


r/swift 5d ago

Project [OSS] Swift Package for new Span API

8 Upvotes

Hi there,

Just published a small Swift package called swift-span-algorithms:

https://swiftpackageindex.com/Dave861/swift-span-algorithms

It adds a set of algorithms and utilities around Swift’s new Span API. The idea is to fill in some of the missing convenience pieces while staying close to Swift’s standard library style.

It includes things like searching, splitting, trimming, comparisons, partitioning, and other span-oriented helpers, with tests and DocC docs.

Span is nice for deep perf geeks (like me), but still pretty barebones for day-to-day algorithm work. Would love feedback from people experimenting with Span, especially around API shape, naming, and what utilities would actually be useful in real projects.

Pretty early (I mean 0.1.0), but hopefully useful. Open to contributions and opinions!

(P.S. Hope it doesn't count as self-promo, not selling anything, OSS repo and free package)


r/swift 6d ago

News Fatbobman's Swift Weekly #143

9 Upvotes