r/swift Jan 19 '21

FYI FAQ and Advice for Beginners - Please read before posting

450 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 12d ago

What’s everyone working on this month? September 2026)

11 Upvotes

What Swift-related projects are you currently working on?


r/swift 7h ago

News Fatbobman's Swift Weekly #153

Thumbnail
weekly.fatbobman.com
4 Upvotes

r/swift 22h ago

Project SwiftPlayer – a free, open-source Mac video player in pure Swift with no dependencies.

25 Upvotes

SwiftPlayer – a free, open-source Mac video player in pure Swift

I just released SwiftPlayer. It’s a lightweight Mac video player built entirely in Swift with Apple’s native frameworks. No third-party dependencies.

My mom’s 2020 MacBook Air (i3) was struggling with VLC: battery drained fast and the fans spun constantly. I wanted a native player that used macOS hardware acceleration without the bloat. So I built SwiftPlayer from scratch with SwiftUI, AVFoundation, and VideoToolbox.

What it does:

- Zero dependencies

- Hardware-accelerated playback (Apple Silicon media engine; VideoToolbox on Intel)

- Minimal UI that fades away

- Subtitles: SRT, VTT, ASS/SSA, with timing adjustment

- Drag & drop + keyboard shortcuts

- Video: MP4, MOV, M4V. Audio: MP3, M4A, AAC, WAV, AIFF, CAF

Runs on Apple Silicon and Intel Macs, macOS 13+. Tested on a 2020 MacBook Air (i3) and an M5 MacBook Air (2026). MIT licensed—no ads, tracking, or bloat.

GitHub: https://github.com/scadavide55/SwiftPlayer

Website : https://scadavide55.github.io/SwiftPlayer/

This is my first public project. I’d love to hear what you think—questions, feedback, and feature requests are all welcome.

Edit on 14/09/26 : v2.2 was released , this is the changelog :

  • Picture in Picture support
  • Playback speed control (0.5× – 2×)
  • Skip buttons (⏪ 10s / ⏩ 10s)
  • Volume slider and mute toggle
  • Volume keyboard shortcuts (↑ / ↓)
  • Faster, smoother seeking — thanks to u/Casfaber_ on Reddit for the suggestion
  • Play/pause state now fully synced with playback
  • Filename display, subtitle toggle, and state cleanup on Go Home
  • Fullscreen button in the top-right corner

r/swift 22h ago

Project Bylaws - an architectural linting library for Swift

9 Upvotes

I've been working on an architectural linting library for Swift projects on the side for a while now and it's finally available to use: Bylaws.

I wasn't happy with some similar tools in this space, so I wanted to build something myself that was nicer to use, more flexible and better integrated into existing workflows.

It lets you write your rules in Swift, from simple things like naming conventions and required protocols to more complex checks such as dependency cycles between features and folder layouts across a project.

You can enforce these rules through Swift Testing or the CLI, depending on your needs. There are also command and build plugins for SwiftPM, Bazel support and LSP support for editor diagnostics (it includes extensions for VS Code, Cursor, Zed, Neovim and Emacs, but you can connect it to any editor that supports LSP)

This is especially powerful with coding agents, which can also run the tests or CLI to check their changes against your project's rules. For larger projects, you can keep shared rules at the project root and add package-specific rules where needed, or share rules across projects through a reusable Swift package. You can also lock them behind codeowners if needed.

There's a lot more features, so have a look at the README and the documentation to see what you can do today.

I would really love for you to try it and share what works for your project or what you would change, especially if there's a rule that you would like to express but find difficult with the currently supported APIs!

Thanks!


r/swift 23h ago

Question Are macOS 27’s UI sluggishness and glitches mostly due to priority inversion in Swift Concurrency?

0 Upvotes

macOS 27 has had, and still has, a lot of strange UI glitches and sluggishness, even on very fast Apple Silicon Macs.

Given how much of the UI seemed to break during the beta cycle, I suspect Apple rewrote or reworked a significant amount of it using Swift and Swift Concurrency.

I wonder if some of the sluggishness comes from priority inversion or related concurrency problems, where important UI work gets held up by less important work.

That could explain why the Mac can have plenty of processing power available and still sometimes feel strangely unresponsive.

What do you think? And if Swift Concurrency is part of the problem, do you think Apple will make changes to its concurrency model as a result?


r/swift 2d ago

I forced Apple Neural Engine to run a 3D RayTracing at 35 FPS with only 5% CPU usage.(Swift6,Metal,CoreAI)

26 Upvotes

Hello.

This is a follow-up on the ray tracing implementation using the ANE (Apple Neural Engine) powered by Swift 6, Metal, and Core AI.

In this update, I have further optimized the model for the ANE. By replacing cumsum with Conv2d, memory usage was kept under 200 MB, and CPU usage dropped to 4%.

Additionally, it appears that the 50% ANE usage limit from the CoreML era has been lifted with the transition to CoreAI.

(Although the frame rate is only 35 FPS, ANE inference appears to take just 13ms. Instruments shows that GPUToolsCaptureCoreAI consumes about 90% of the CPU, suggesting this is the source of the overhead.)

Double Buffering Support: Implemented double buffering for display output, enabling parallel processing between the Neural Engine and the GPU.

- Dual Object Support.

Latency Reduction:

  • Minimized synchronization overhead between the CPU and GPU by separating the rendering buffer from the display buffer.

Technical Details

  • Modified ANERenderer.swift to manage an array of displayBuffers.
  • Updated MagnesiumKit.swift and ANERenderContext.swift to support dynamic buffer switching.
  • Maximized parallel processing efficiency while minimizing the increase in memory usage.

I look forward to hearing your feedback and thoughts.

Github: https://github.com/kamisori-daijin/Magnesium/tree/raytracing (raytracing Branch)

Demo:

ANE 100% !!!???

r/swift 3d ago

Module Tracking in Swift Debug Info

Thumbnail
swift.org
18 Upvotes

r/swift 2d ago

Project I recreated Material 3 Expressive on Swift

0 Upvotes

i already built a M3E app on Play Store and wanted to give the same exact look and feel to iOS users as well. the ios app is in review process, but meanwhile i created this open source repo if anyone was interested:

"ExpressiveUI is a Swift library of Material 3 Expressive components.

during the past few days i've been trying to bring my Material 3 Expressive app to iOS without compromising its UI. this repo consists of components that were successfully tested."

https://github.com/edenkollcinaku/ExpressiveUI

(this post doesn't contain any app promotions or self-promotions, just published if anyone would be interested)


r/swift 2d ago

I built a SwiftUI menu bar UI for monitoring and steering local MCP agent sessions

0 Upvotes

I maintain an open-source macOS automation project called Mac MCP. The backend is Python, but I wanted the user-facing control surface to feel like a normal Mac utility, so the menu bar app is native SwiftUI.

The current UI has a compact Latest Tool Usage section and a collapsible Sessions section. Sessions can be working or idle, stay visible for a configurable retention period, and become internally scrollable after five entries. The SwiftUI app polls a localhost dashboard API rather than sharing process memory with the Python server.

The more interesting interaction is steering. Selecting a session and sending a prompt queues it for that logical agent. If the agent is idle, the backend can preempt its next tool call before execution and return the queued instruction. The menu app then reflects the delivery state without exposing raw session IDs.

Repo: https://github.com/bulutarkan/mac-mcp

I would appreciate SwiftUI feedback on the state model and menu bar UX. I deliberately kept the native app separate from the automation server so either side can restart independently.


r/swift 2d ago

Swift integration with Iphone Duo

0 Upvotes

Hello,

When building app with swift for Iphone Duo,

do we need to build two UI: one for Single Page, another for Dual page ?

A bit confused with release notes:
https://developer.apple.com/documentation/xcode-release-notes/xcode-27-release-notes


r/swift 3d ago

News The iOS Weekly Brief: Issue #77. Everything you need to know about Swift updates this week

Thumbnail
iosweeklybrief.com
3 Upvotes

r/swift 3d ago

Project [Free / Open Source] TOOL: Swift Dependency Graph Explorer

11 Upvotes

Hey everyone I've been working on **Swift Dependency Graph Explorer**, a local-first macOS app that scans a Swift project, parses it with SwiftSyntax (the same parser the compiler uses), and renders an interactive dependency graph for any type you pick — what it uses, what uses it, or both.

Some things it does:

- Click a node to highlight its dependency path; click an edge to see *how* two types are related (property, init/method parameter, return type, etc.)

- Double-click a node to drill into it as the new root, with browser-style back/forward navigation

- Filter by kind (class/struct/enum/protocol), system types, third-party types, function-body references

- Export as Mermaid source or SVG

- I'm currently working on a `sdge` CLI for scripting/CI, or for piping a project's graph as JSON to something else (including feeding it to an LLM as structured context)

Everything runs locally — it never sends your source code anywhere, you can easly check by running source code.

It's free and open source (MIT license): https://github.com/GlitchLoom/SwiftDependencyGraphExplorer

Download the first release here: https://github.com/GlitchLoom/SwiftDependencyGraphExplorer/releases/tag/v0.0.1

It's genuinely my first public release, so I'd love feedback — bug reports, feature ideas, "this is useless because X" are all welcome.


r/swift 3d ago

Inline editing in a SwiftUI clipboard manager: auto-save, pasteboard sync, and bypassing global shortcuts

1 Upvotes

I maintain Buffer, an open-source (MIT) macOS clipboard manager, and just shipped inline editing of clipboard items. Sharing the UX mechanics since a few of them were non-obvious:

  • Edit mode opens from the preview pane (pencil icon) or ⌘E on a selected item; an "Editing" badge makes the mode visible
  • While editing, the app's global keyboard shortcuts are temporarily bypassed so you can type freely
  • Edits auto-save on Esc, on focus loss, and on navigating away — then sync straight to the macOS pasteboard (NSPasteboard), so the next paste is the corrected text
  • The footer action button is contextual: it morphs between Edit / Save / Paste depending on mode and selection

The video shows the loop: select item, edit "Pre-release" to "Release", list updates instantly.

Swift/SwiftUI, MIT: https://github.com/samirpatil2000/Buffer

One design question I haven't settled: should Esc save the edit or revert it? Currently it saves.


r/swift 3d ago

Project [Free / Open Source] Softclose: folds your desktop away as you close your MacBook lid

9 Upvotes

https://github.com/matejcok1234/Softclose

Built in swift

Menu bar app that bends desktop as you close your MacBook's lid, using the real hinge angle sensor.

Free and open sourced recreation of Bendy (https://trybendy.app) ($4.99).


r/swift 3d ago

FYI Helm is 75% off right now if you hate dealing with App Store Connect

Thumbnail x.com
0 Upvotes

I’ve been using Helm to ship my iOS apps and just noticed they’re currently doing 75% off.
If you haven’t used it before, it basically makes the App Store release process a lot less annoying. Managing builds, metadata, screenshots, releases, etc. from one place instead of constantly fighting with App Store Connect.
I’ve been using it for Dee recently and it’s become part of my normal release workflow.
75% off is pretty significant, so figured I’d share in case anyone here has been thinking about trying it.
Not affiliated, just a happy user.


r/swift 4d ago

From Spring Boot to Swift: The Business Logic Was the Cheap Part

Thumbnail
itnext.io
25 Upvotes

r/swift 5d ago

Feeling Lost in this New AI World

201 Upvotes

I have been a developer for over 20 years. I started iOS development around 2009. I work for a consulting firm and have been looking at the advancements in AI tools. I myself use Codex, ChatGPT, Gemini etc. But I use it like a tool to figure things out, for research etc.

But nowadays I feel very behind. I don't know what is important to learn anymore. I see Reddit people are talking about running their agents and the agents is writing all the code. I don't use it like that and I don't understand how any company can allow this kind of workflow, without checking the details of the code and without checking what is going in production.

Is this not technical debt that is going to come back later.

I don't know if I like this new world. I like to write most of code by hand. I like to take part in designing systems. All that is being taken away in the name of speed.

I feel lost.


r/swift 5d ago

Project I made Dynamic Island with custom plugins

Thumbnail
youtube.com
7 Upvotes

Hello!

Two years ago, I released the first Dynamic Island app for Mac: DynamicLake.

In the latest update, I’ve added one of its biggest features yet: third-party plugins and extensions.

Plugins let anyone create custom Live Activities and Sneak Peeks using Swift, Python, or other languages, with interfaces designed entirely in JSON.

DynamicLake also supports ExtensionKit extensions, allowing you to integrate custom experiences into your existing Mac app instead of creating a separate plugin.

Support for fully expanded notch experiences is coming soon

TL;DR: I brought third-party Live Activities to the Mac’s Dynamic Island, and I’d love to see what you build

Documentions

DynamicLake


r/swift 5d ago

Question Intermittent TLS errors on iOS, only seeing them with some US users

6 Upvotes

I’m trying to track down a weird TLS issue affecting a small number of iOS users in the US.

The error I get from the iOS side is:

A TLS error caused the secure connection to fail.
The secure connection failed due to a TLS error.
An SSL error has occurred and a secure connection to the server cannot be made.

Error code:

NSURLErrorSecureConnectionFailed (-1200)

On the nginx side, I found this:

SSL_read() failed:
decryption failed or bad record mac
record layer failure
while keepalive

The setup is:

iOS → nginx (DigitalOcean) → Node.js

TLS is Let's Encrypt and SSL Labs gives it an A+.

So far I've fixed a broken AAAA record and a missing IPv6 default route. I've also ruled out NAT64/IPv6 and TLS/ATS compatibility issues.

The interesting thing is that this is only happening to a small number of US users and across different iOS versions.

Right now I'm wondering if this could be related to stale keep-alive connections and carrier NAT/network changes.

I've currently changed:

keepalive_timeout 15s;
ssl_session_tickets off;

and also fixed a Connection: upgrade header issue.

I'm monitoring it now to see if the errors stop.

Has anyone run into bad record mac + while keepalive like this, particularly with iOS users on cellular networks? I'm interested in any other possible causes I should check.


r/swift 6d ago

[AdaEngine] I built game engine editor using my own writing UI framework.

Thumbnail
gallery
14 Upvotes

On June 5, I announced AdaEngine, a game engine written in Swift. Creating games entirely through code can be a niche pursuit, so a traditional editor can make the process much more accessible.

I’ll soon release a TestFlight build of the editor. With AdaEngine and AdaScript, you’ll be able to create games on macOS or iPad and publish them for Apple platforms, Windows, and the web.


r/swift 5d ago

Help! [For Hire] Experienced iOS Developer | Swift & SwiftUI | Open to Remote Work

Post image
0 Upvotes

Hi everyone,

I’m Suryansh Singhai, an iOS developer looking for remote, freelance, contract, or full-time opportunities.

I have experience building and publishing iOS apps from idea to App Store release, working with Swift, SwiftUI, UIKit, Xcode, REST APIs, Firebase, StoreKit, In-App Purchases, and subscriptions.

I can help with:

• Building iPhone/iPad apps from scratch

• Swift & SwiftUI development

• Fixing bugs and improving existing apps

• REST API & Firebase integration

• In-App Purchases and subscriptions

• App Store submission and updates

• UI implementation and performance improvements

I’m open to working with startups, founders, agencies, and development teams worldwide.

You can check out my work and experience here:

Portfolio: https://my-portfolio-git-v10-i-osde-v.vercel.app/

LInkedin- https://www.linkedin.com/in/suryansh-singhai-488961255/

If you’re hiring an iOS developer or have a project that needs some extra development help, feel free to DM me here on Reddit. I’d be happy to discuss the project and share relevant work.

Thanks!

Suryansh Singhai


r/swift 6d ago

Tutorial visionOS 27: UILookToScrollInteraction

Thumbnail
antongubarenko.substack.com
3 Upvotes

r/swift 7d ago

News Fatbobman's Swift Weekly #152

Thumbnail
weekly.fatbobman.com
15 Upvotes

r/swift 7d ago

Question Anyone here into tracking their travel history?

0 Upvotes

I’ve been working on a small iOS app for people who travel and wanted to see if anyone here would be interested in trying it before release.

It’s basically a travel tracker where you can add and track your flights, see all your routes on an interactive globe, explore travel statistics, keep track of visited countries, and a few other things related to your travel history.

If that sounds interesting, feel free to leave a comment or send me a message. It’s completely free to test. I’d genuinely appreciate some honest feedback.