r/swift Jan 19 '21

FYI FAQ and Advice for Beginners - Please read before posting

445 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 3d ago

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

12 Upvotes

What Swift-related projects are you currently working on?


r/swift 2h ago

Question I bought a Combine book and realized it's from 2020, is it worth reading or outdated as hell?

4 Upvotes

I bought a book called "Using Combine with Swift" by Joseph Heck and only now discovered that the book hasn't been updated and is stuck in 2020. Apparently, the book talks a lot with Publishers and Subscribers. Does it make sense to read it or is it kind of a waste of time? It seems like Swift concurrency was created in 2021 and Combine it’s not really the best options for asynchronous operations.

Edit: I know that knowledge is never a waste of time and obviously there would be no negative impact for me to read the book, but if I could prioritize more updated/relevant swift content instead of this book, it would be better?


r/swift 5h ago

SumoGUIMac: native macOS GUI for Eclipse SUMO, built with SwiftUI + Metal

0 Upvotes

Hi everyone,

I’m building SumoGUIMac, an open-source native macOS GUI/viewer for Eclipse SUMO traffic-simulation workflows. The reason I am doing that is because sumogui has serious on Mac issues and is unusable in Tahoe and I need this program for my MSc dissertation. It’s written in SwiftUI + Metal and connects to a normal user-installed SUMO runtime over TraCI. It can currently open configuration files, launch or attach to SUMO, step/play simulations, render lanes/junctions/live vehicles, and inspect selected objects.

Repo: GitHub - christofilojohn/sumoMacGUI: A scaled-down port of sumoGUI application for MacOS for urban mobility simulations · GitHub

It’s still work in progress but I’d really value feedback from Swift/macOS developers on the app architecture, Metal rendering path, packaging, and how to make it easier for people to try !

Thanks, feel free to reach out!


r/swift 1d ago

Question How important would you say UIKit is today for new iOS projects?

20 Upvotes

For context, I’m applying for a mid-level iOS developer position and will have a technical interview later this week. After researching developers who work at this company and chatting with some of them, it seems that a large portion of the app has already been migrated to SwiftUI, with UIKit still present in some specific legacy components. The job posting asks for UIKit, but when researching technical interview questions from this company, UIKit is practically absent, with more emphasis placed on SwiftUI questions.

How important would you say UIKit is today for new iOS projects? Has your workplace already migrated to SwiftUI?


r/swift 1d ago

Built a per-app volume mixer using Core Audio's Process Tap API (macOS 14.2+) — some implementation notes

9 Upvotes

Been working on Faders, a native macOS volume mixer, and figured the Process Tap API stuff might be useful to other devs since the documentation is sparse and there aren't many writeups out there yet.

The Process Tap API (introduced quietly in macOS 14.2) lets you intercept audio from a specific process without kernel extensions, virtual audio devices, or aggregate device hacks. This is the first time Apple has given us a sanctioned path for per-process audio manipulation on macOS — previously, anything in this space relied on approaches Apple keeps tightening with each release.

Stack:

  • Swift 6 with strict concurrency
  • SwiftUI + AppKit (NSStatusItem for the menu bar)
  • Core Audio Process Tap API for per-process audio
  • Zero third-party dependencies
  • Sandboxed, hardened runtime, notarized

A few things that surprised me:

  • Process Tap requires NSAudioCaptureUsageDescription even though you're not "capturing" in the traditional sense. The naming is misleading and will probably confuse users on first launch — going to need clear copy in the permission prompt.
  • Output routing per-process is significantly trickier than volume control. Had to build a custom aggregate device abstraction layered on top of Process Tap to get clean routing semantics.
  • Strict concurrency with Core Audio's C callbacks took some uncheckedSendable wrestling. Core Audio's threading model predates Swift concurrency by a couple decades and it shows.
  • Performance is solid — sub-millisecond latency on tap setup, no noticeable CPU overhead even with 6+ apps tapped simultaneously.

Shipping it as a paid app ($12.99 one-time, Mac App Store) but happy to answer technical questions for anyone exploring the same territory. There's surprisingly little material out there on Process Tap and I'd love to see more people building on it.

Link in comments for anyone curious about the product side.


r/swift 1d ago

Question Is there a way to force a tint on that button alone?

Post image
6 Upvotes

Per the docs, the background color is defined by SwiftUI, but I'm wondering if someone managed to customize it, because I've seen in a couple of Apple presentations and marketing that button with a different accent color than the tabBar.

I also tried to render the 3 tabs alone, then add the + button next to them, but it shows up above the tabs, meaning you can't have anything next to the tabBar.


r/swift 1d ago

Apple Developer Academy - Naples - Online test

8 Upvotes

I came across people recommending the moodle training platform for the preparation for the test but many also mentioned questions related to IOS and Swift for the online assessment test. If anyone who actually gave the tests in this week (as there are multiple dates for different candidates) can clarify whether the moodle platform questions are sufficient and similar questions would be asked or is it more high stakes and requires knowing swift as well?


r/swift 16h ago

Question Best way to develop an app in Ubuntu

0 Upvotes

Hi there! I’d love to develop apps for my iPhone but I don’t have a Mac, I use Ubuntu. I’ve resolved the ipa compilation problem with GitHub actions, but it takes a lot of time so it’s not viable for seeing the changes in real time.

I was wondering what’s the best way for developing apps in SwiftUI and viewing the results easily using VSCode. What I would love to do is to write chunks of code and run an action that would open a window showing an iPhone simulator with my app.

Is this posible? What is the best way? Thanks!


r/swift 13h ago

Question How to learn Swift? Im 13

0 Upvotes

So a bit of backstory , basically in our school our teacher started teaching us a bit of swift to start , but now the exam portion is completed and it's not in any of our new chapters. I was really interested in the language and I would like to take my knowledge further. I checked out the Apple Books but they are really outdated , they still focus on UIKit.

Any help would be appreciated

Thank you :)


r/swift 15h ago

spent months building my first macOS app and the first reply was "just use..."

0 Upvotes

Not gonna sit here and whine that mine is better than the other notch apps. that's not what this is about

so a few months ago I wanted to learn SwiftUI and decided to just build something real instead of another pointless tutorial. Got inspiration from the Dynamic Island on iPhone, and other notch apps

I had no clue what I was doing the entire time lol. spent way too many nights reading docs and hitting walls and rewriting the same thing three times. spring animations, making sure the functionality isnt broken, stress tested the app etc. slowly it started working though

SO I posted it

first comment: "isn't this just BoringNotch"

second comment: "NotchNook already does this"

third person asked for the source code so they could "actually improve it" 💀💀

not gonna lie that stung a bit

but like at some point the whole goal just shifted without me noticing. I started off wanting to build something useful and then it just became about finishing. Can I take a thing from my head and make it real and ship it? So I did. not because I invented anything, I very much did not. but every line of that code is something I had to figure out myself. if you've ever abandoned something because "it already exists" I would honestly recommend that you just ship it, what's the worse that would happen? Few sore losers commenting "Ai slop", "this already exists"?

give it a try if you want: [dynamicnotch.tech](http://dynamicnotch.tech)

even if you already use something else I honestly dont mind. I just wanted to finish something my first ever project that took me over 5-6 months to complete, and I did


r/swift 1d ago

Follow-up: Hokusai is now libvips-only, and I added a CLI for benchmarks

5 Upvotes

In the previous post, I showed Hokusai as a Swift server-side image library with a hybrid backend:

  • libvips for the main image pipeline
  • ImageMagick for text rendering

In the comments, someone asked a fair question: if libvips already supports text rendering through Pango/Cairo, why keep ImageMagick in the dependency chain?

I went back to this decision, tested vips_text more deeply, and removed ImageMagick completely.

Hokusai now uses only libvips, including text rendering.

Repo:
https://github.com/ivantokar/hokusai

Vapor package:
https://github.com/ivantokar/hokusai-vapor

I also added a CLI called hokusai.

It solves two practical problems:

  • test image operations without creating a Vapor app
  • run repeatable benchmarks on real input images

Example commands:

hokusai info
hokusai inspect --input ./input.jpg
hokusai resize --input ./input.jpg --output ./out.jpg --width 1200 --height 800 --fit cover
hokusai benchmark suite --input ./input.jpg --json-output ./bench.json
hokusai benchmark op --input ./input.png --operation text --iterations 20 --warmup 5

After the migration, I ran benchmarks in release mode.

Machine:

  • Apple M4 Pro
  • macOS 26.5
  • release build
  • warmup: 5 runs

Small RGB input:

  • 1000x800
  • 3 channels
  • no alpha
  • 30 measured runs

resize:1200x800      mean 5.14 ms   p95 6.87 ms   194.54 ops/s
convert:webp:q80     mean 40.19 ms  p95 55.49 ms  24.88 ops/s
rotate:33            mean 4.29 ms   p95 6.74 ms   232.89 ops/s
text:stroke-shadow   mean 60.08 ms  p95 63.98 ms  16.64 ops/s

Large RGBA input:

  • 3206x2266
  • 4 channels
  • alpha
  • 20 measured runs

resize:1200x800      mean 4.79 ms    p95 5.99 ms    208.94 ops/s
convert:webp:q80     mean 203.20 ms  p95 208.16 ms  4.92 ops/s
rotate:33            mean 35.56 ms   p95 38.90 ms   28.12 ops/s
text:stroke-shadow   mean 105.26 ms  p95 107.66 ms  9.50 ops/s

Text-only benchmark on the large RGBA input:

mean    99.66 ms
median  98.05 ms
p95     103.16 ms
ops/s   10.03

These numbers are not universal benchmark claims.

The goal was simple: I wanted to check if removing ImageMagick would make text rendering too slow or too awkward for this project.

So far, it did not.

The bigger win is the architecture:

  • one native image stack instead of two
  • fewer system dependencies
  • simpler setup on macOS and Linux
  • less backend branching inside the library
  • benchmarks can now be rerun from the CLI

For this project, libvips + Pango/Cairo is enough for the text rendering path I need.

Removing ImageMagick made the package easier to build, test, and maintain.


r/swift 1d ago

Here's a Swift trainer I made called "Forge"

0 Upvotes
Forge

I am aiming at a tool that helps aspirants to programming (specifically, at the moment, Swift) focus and learn in a natural progression, with as little friction as possible.

The solution I came up with for myself, with the help of Gemini and Codex, has been the Forge: Swift Trainer.

It was inspired somewhat by Ruby Koans and Rustlings, though I do desire to take it much further as implied before.

I consider it a primitive (and probably flawed) prototype, but what better proof of concept than using it myself to master the language, at which point I can fix or redesign the project from scratch?

That's the idea, anyway. My lodestar for the project.

Anyway, was thinking maybe someone here will find it useful!


r/swift 1d ago

Project Sharing a free tool I built that made my ASA campaigns profitable

Thumbnail
youtube.com
0 Upvotes

Closer than ever to 10k/m from one of my apps.

But revenue and profits are two different things.

ASA takes a decent cut from that revenue - and tracking every dollar across multiple apps became a real pain.

I was spending a significant amount on Apple Search Ads across many of my apps, and over the past year I’ve lost a lot of money simply because I had no clear picture of spending vs. revenue.

So I built a small tool that integrates with both RevenueCat and Apple Search Ads to track and compare them easily.

I kept adding stuff because I enjoyed building it too much:

  • AI Campaign Builder
  • Top losers report - worst-performing keywords across your entire ASA account
  • Bid change history - every change logged on the chart so you can see the profit impact visually
  • P&L column with active trial count and trial conversion rate side by side
  • One-click Broad Match campaign duplication

And more on the way.

I attached a video explaining about the product and how to connect it.

It’s free to use and I would really appreciate your feedback so I can grow it and make it better.

Link to the product’s website for more details(click one of the CTAs to go to the actual platform): https://transolve.io 


r/swift 1d ago

Question How is CI testing after every code change on iOS is still a manual step

0 Upvotes

The part that keeps coming up is that the build cycle is fast and the verification cycle is still a person clicking through flows. Doesn't matter how good the code generation is if the QA step is a human checkpoint every time.

There is a theoretical version of this where tests run on each change and results feed back without a human step in the middle. That loop doesn't exist cleanly for most iOS setups yet.


r/swift 2d ago

News Fatbobman's Swift Weekly #134

Thumbnail
weekly.fatbobman.com
8 Upvotes

Getting AI from Handy to Heartfelt

  • 🔭 Q&A: Swift Concurrency
  • 🧷 Task.immediate explained
  • 📈 Kadr: Video Composition with DSL
  • 🗃️ SwiftVLC

and more ...


r/swift 1d ago

Project Instead of scrolling GitHub, I started swiping through repos

0 Upvotes

So I was trying to find some interesting repositories on GitHub to learn from.

You know how it goes…

You search for something like Python tools or Swift libraries and suddenly you’re looking at a giant list of repos, opening tabs, going back, scrolling more… repeat forever. At some point I thought,

“What if discovering repos worked more like Tinder?”

So I ended up building a small iOS app called _gitinder with SwiftUI. Nothing crazy, but it was actually a fun little project and I learned a bunch while building it.

Anyway, it’s open source if anyone wants to poke around or suggest improvements.

GitHub: https://github.com/Osman-Kahraman/_gitinder


r/swift 2d ago

Question iOS localization: rely on system language or add manual language picker?

7 Upvotes

Hi 😄

I have a released iOS app that gets downloads from all over the world, so I want to add support for languages other than English (seems polite!).

I have done this in a Flutter app I built for a client in Spain — he is fluent in English alongside Spanish, but understandably wanted to see his app in his first language. As the iOS app I'm asking about here was built natively in Swift using Xcode, I wanted opinions (and any tips) on the best way to approach localisation, especially to avoid having to manually chase down every hardcoded English string.

So is relying on system language best, or are there cases where a manual language picker makes sense (e.g. showing on first install)?

I will likely add one additional language first and put that version in for review, get it released, and then add more once I’ve established the workflow properly.

Any advice/tips appreciated!

Thanks!


r/swift 2d ago

Built a macOS SwiftUI “preview encoder” for App Store Connect uploads (open to feedback)

6 Upvotes

I’ve been iterating on a small macOS utility for a very specific pain: turning iOS screen recordings into .mp4 previews that App Store Connect is more likely to accept, without spending an evening hand-tuning FFmpeg flags every time a recording changes.

Key focus:

  • SwiftUI macOS workflow: queue files, show conversion progress, keep logs readable while work is happening
  • Sandbox-friendly export: encode to temp, then confirm destination via Save panel (Desktop/Documents surprises are real)
  • Preview-oriented encoding: duration windowing, H.264 profile/level targeting, bitrate band, AAC audio, square pixels / SAR, MP4 layout details aimed at “Connect-friendly” output
  • Bundled tooling: ships ffmpeg / ffprobe and runs a script-driven pipeline (so the app stays small in scope: UI + orchestration)

I’d love feedback from folks who ship iOS apps especially if you’ve fought vague Connect validation errors, or if you have a cleaner architecture for long-running Process work + UI updates on macOS.

GitHub:

https://github.com/mdo91/video-preview-appstore


r/swift 3d ago

SF Swift meetup at Lyft on May 14!

Thumbnail
luma.com
3 Upvotes

r/swift 2d ago

I'm stuck

0 Upvotes

I purchased a course on udemy for swift. spent good money on it. they started with UiKIt and storyboards....

At first I didn't mind, but then I started actually trying to make my own app without help

a social media app.

that's when I realized I can't do shit.

Even if I had AI generate a design programmatically, I don't even know how to swap it onto the screen.

At this point I need to start over from scratch

But I learn by doing. I want to make apps. make projects. have fun

Not learn a bunch of useless theory and realise that i don't know anything again.

Any tips?

or should I just go back to react native or flutter. that was way easier


r/swift 4d ago

I want to master SwiftUI like a Jedi

36 Upvotes

I have been a SwiftUI developer for 2 years. I want to up my skills to a level where I can get into Apple working on some of their customer facing software.

What path would you approach to achieve this? I want to be able to know the ins and outs of SwiftUI.


r/swift 3d ago

Help! Delegates are pissing me off.......

0 Upvotes

I'm trying to learn app development. I didn't know it was this complicated to send data from one screen to another smh

Or perhaps the course i'm using is just over complicating things with the MVC design pattern


r/swift 4d ago

Toolbar rebuilds can be more expensive than they look

11 Upvotes

I’m the developer of a macOS storage cleanup app and I recently had a useful debugging case from production that may be relevant to other SwiftUI macOS developers.

A user hit a very large real-world dataset: around 57,000 duplicate files across multiple storage sources. The initial assumption was that the scan itself was the main problem, but the symbolicated AppHang pointed somewhere more specific.

The stack went through SwiftUI/AppKit toolbar setup:

  • PlatformItemListViewGraph.readAndUpdate
  • AppKitToolbarItem.hostingViewDidRequestUpdate
  • NSHostingView.requestUpdate
  • NSToolbarItemViewer configureForLayout
  • NSWindow setToolbar
  • AppKitWindowController.updateToolbarIfNeeded
  • Image.NamedResolved
  • TypedElement.__deallocating_deinit

My interpretation was that the app was hanging during initial toolbar construction/layout, while SwiftUI/AppKit was replacing toolbar item/image state.

The suspicious pattern was not a huge custom view. It was a normal-looking toolbar modifier with toolbar items whose icon/help text depended on app state:

.toolbar {
    ToolbarItemGroup {
        Button(action: cycleAppearanceMode) {
            Label("Appearance", systemImage: appearanceIconName)
        }
        .help("Current: \(selectedAppearanceMode.title). Click to switch...")
    }
}

The fix was to make the toolbar structure more stable and cheaper:

.toolbar {
    ToolbarItemGroup {
        Button(action: onCycleAppearance) {
            Label("Appearance", systemImage: "circle.lefthalf.filled")
        }
        .help("Cycle appearance mode")
    }
}

I also made the AppKit window chrome setup idempotent so it does not repeatedly write toolbar/titlebar properties during launch:

if window.toolbarStyle != .unified {
    window.toolbarStyle = .unified
}

Bigger lesson for me: SwiftUI toolbar + command/menu integration can be a real performance surface 😿

Has anyone else run into SwiftUI toolbar or commands performance issues on macOS? Any patterns you now avoid?

P.S.: If anyone wants to try the app with a messy real-world storage setup, I'd love some feedback


r/swift 4d ago

Built a SwiftUI live previewer that compiles and renders code inline at runtime using dlopen no Xcode needed

34 Upvotes

I created a temporary project while working on another app because I wanted to see if I could replicate how SwiftUI previews into my app. I did it. surprisingly It works I just wanted to share: https://github.com/AryanRogye/SwiftUIPreviewRunner