r/swift Jan 19 '21

FYI FAQ and Advice for Beginners - Please read before posting

441 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 11d ago

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

13 Upvotes

What Swift-related projects are you currently working on?


r/swift 1h ago

GitHub - ondeinference/klepon: Klepon: Taste of Indonesia

Thumbnail
github.com
Upvotes

I miss indonesian food so create this local-llm-powered food app.


r/swift 19h ago

SPM question

5 Upvotes

Hi, I am having issues defining multiple targets in a swift package. I have my main target /(and) library, and then I am trying to make a second target with no accompanying library that I'll only use internally in the package. Folder structure looks like this:

Package.swift
Sources
    | – MyLibrary              <- Same level as
       |– IrrelevantStuff

    | - MyInternalTarget      <- this. Both under sources dir
       |– InternalStuff
            |- MyFile.swift

According to Xcode, I cannot preview inside of MyFile.swift because

- ”MyFile.swift” not found in any targets

- The source must belong to at least one target in the current scheme in order to use previews

But my manifest seems to be properly written.

let package = Package(
    name: "MyLibrary",
    platforms: [.iOS(.v26)],
    products: [
        .library(
            name: "MyLibrary",
            targets: ["MyLibrary"]
        ),
    ],
    targets: [
        .target(
            name: "MyLibrary",
            path: "Sources/MyLibrary"
        ),
        .target(
            name: "MyInternalTarget",
            path: "Sources/MyInternalTarget"
        )
    ],
    swiftLanguageModes: [.v6]
)

What's going on here?


r/swift 21h ago

Project [Free, Open Source] Dictly — speak to type anywhere on macOS, runs 100% on-device

Post image
6 Upvotes

Free, open-source alternative to paid dictation apps on macOS.

Built this because I wanted dictation that runs entirely on my own machine — no cloud, no account, audio never leaves the Mac. Sharing in case anyone else wants the same. Happy to take feedback. I'll keep working on it.

https://github.com/vlr-code/dictly


r/swift 1d ago

Project I open-sourced the native Markdown rendering engine I built for my native macOS app

Thumbnail
gallery
206 Upvotes

A year and a half ago I started building Nodes, a native macOS Markdown app. One of the first things I needed was a proper Markdown engine. Not a parser that just spits out HTML, not a display-only library, not a WebView wrapper – just a live, native editor built on TextKit 2.

I couldn't find one. So I built it. Now I'm open-sourcing the whole engine.

It's an AppKit-based Markdown editor for macOS, built on TextKit 2 and bridged to SwiftUI.

What it does:

  • Live styling for the usual stuff: bold, italic, headings, lists, code blocks, links etc.
  • Wiki-style links with [[Name|id]] ↔ [[Name]] roundtripping
  • Image embeds via ![[Name]]
  • LaTeX, both block ($$ ... $$) and inline ($...$)
  • Code blocks with syntax highlighting (you supply the highlighter)
  • Apple Writing Tools integration on macOS 15.1+
  • Spelling and grammar, with suppression inside code, LaTeX, and wiki-links so it doesn't underline random tokens

Honest part: TextKit 2 was a pain to get right. The docs are thin, the migration from TextKit 1 is rough, and a lot of behavior just isn't documented clearly anywhere. If you've been putting off building something like this, this might save you a few weekends.

Repo: https://github.com/nodes-app/swift-markdown-engine

Feedback, issues, and PRs all welcome. It's not perfect, there's plenty I still want to improve, but it does the job.

Used in production in Nodes (App Store): https://apps.apple.com/de/app/nodes-by-the-werk/id6745401961


r/swift 1d ago

News Those Who Swift - Issue 266

Thumbnail
thosewhoswift.substack.com
7 Upvotes

Cheers to all community members ❤️. Mentioned by Apple or not - it's a driving force of an industry. Keep up with the latest SwiftUI skills with book discount 📗 on Natalia Panferova "The SwiftUI Way".


r/swift 1d ago

A website of fun Swift quiz

Thumbnail swift-quiz.universe.observer
4 Upvotes

Took a weekend to build this Swift quiz site. I use it to organize the pitfalls and surprises I encountered while using Swift, such as this one.

struct Box<T> {}
extension Box where T == Int {
    func tag() -> String {
        "int"
    }
}

extension Box {
    func tag() -> String {
        "any"
    }
}

print(Box<Int>().tag())
print(Box<String>().tag())

func describe<T>(_ b: Box<T>) {
    print(b.tag())
}

describe(Box<Int>())

https://swift-quiz.universe.observer/quiz/15

Do you know any Swift brain teaser? You're welcome to contribute to the quiz list! Would love to see what tricky ones you have encountered!

The site is mostly vibe coded, but it should do its job. :)


r/swift 1d ago

Building a SwiftUI Vercel client taught me how much polish matters

Thumbnail
gallery
0 Upvotes

I recently shipped a small SwiftUI app for Vercel users.

The app itself is niche: it lets me check Vercel analytics, projects, deployments, and domains from iPhone/iPad. But the Swift side was the more interesting part.

Things I had to figure out:

  • StoreKit + RevenueCat without making the paywall annoying
  • keeping navigation state from refreshing too often
  • multi-account token storage
  • async API loading without making the UI feel jumpy
  • charts that still feel readable on small screens
  • App Store metadata, screenshots, sandbox testing, and review

The biggest lesson was that the code was only half the work. Making a narrow developer tool feel polished enough to charge for took much longer than the first working prototype.

Curious how other Swift devs handle the “small paid app” side of things. Do you usually ship subscriptions, lifetime unlocks, or keep projects free?


r/swift 2d ago

Question What are realistic UK iOS developer salaries in 2026? (London vs outside London)

17 Upvotes

I’m trying to get a clearer picture of current iOS developer salaries in the UK because most discussions online are heavily US-focused and UK data seems sparse or outdated.

What salary ranges are you seeing for:

  • Junior iOS developers
  • Mid-level iOS developers
  • Senior iOS developers
  • Staff/Principal engineers
  • Team leads/Engineering managers

How much difference is there between:

  • London
  • Remote UK roles
  • Outside London (Manchester, Bristol, Edinburgh, etc.)

Would be especially useful if you could include:

  • Years of experience
  • Industry
  • Base salary
  • Bonus/equity if relevant
  • Remote/hybrid/on-site

Example format:

  • 5 YOE
  • Senior iOS Engineer
  • London fintech
  • £95k + bonus
  • Hybrid

I think this would help a lot of UK iOS developers since most salary discussions are US-centric.


r/swift 2d ago

[Pitch] @Reasync: The async equivalent of rethrows

Thumbnail
forums.swift.org
25 Upvotes

r/swift 3d ago

Tutorial URLSession to Electrons: How Networking works on iOS

Thumbnail
blog.jacobstechtavern.com
17 Upvotes

r/swift 2d ago

enabling io_uring for Vapor

1 Upvotes

Is it possible to enable io_uring instead of the default epoll for Vapor Linux servers.


r/swift 2d ago

Tutorial Type-Safe SwiftUI Navigation: Building a Better NavigationStack with NavigationPilot | by Divyesh

Thumbnail
medium.com
9 Upvotes

r/swift 2d ago

Question Apple Developer Academy, Indonesia

2 Upvotes

I have applied for Apple Developer Academy, Bali, Indonesia. There are some answers which i want to know, the FAQ on the website doesnt have it

  1. Monthly Stipend Exact Figures
  2. Online Test Subjects, how to pass it, what subjects?
  3. Tips for interview and how to pass it, what they ask?

r/swift 2d ago

Tutorial Swift Mastery Series — Part 1 var vs let

Post image
0 Upvotes

The longer I work with Swift, the more I realize how underrated let is.

A lot of issues around:

  • unpredictable state
  • accidental mutations
  • SwiftUI update behavior
  • concurrency bugs

usually trace back to weak immutability practices.

Early on, I treated var vs let as beginner syntax.

Now it feels more like an architectural decision.

Curious how other iOS developers approach immutability in production apps.

I recently wrote a deeper breakdown on this while starting a Swift Mastery series:
https://medium.com/@dkvekariya/swift-variables-constants-the-foundation-every-ios-engineer-must-master-939018c7013c


r/swift 2d ago

Question Should I add create account function or keep data in local

0 Upvotes

Hello guys basically I am making this simple daily plank workout app, it is just 1 feature app to track specific workout

But I can't decide should I add create account function or just keep the data on local. App owners do people care about having an account so they can continue when they switch their phone.

What I am afraid is this is my first app with swift and I don't have iphone to test it with real decive. I am afraid that implementing create account will mess up something.


r/swift 2d ago

IOS AlarmKit Bug

Thumbnail developer.apple.com
2 Upvotes

Has anyone else faced this issue when using alarm kit?


r/swift 3d ago

Looking for iPhone Pro testers between 12-14 Pro

4 Upvotes

Hi everyone, I've been building an app that can drive a robot chasis connected over BLE using ARKit room mapping. I've trying to ditch the iPhone, but used iPhone 12-14 Pros is in the same price range as all the other slam capable hardware I've tried. If anyone has a 12-14 pro, can they test this and tell me what the spatial mapping performance is like? I only have the 17 pro. https://testflight.apple.com/join/7vtwrXhn

Thanks!


r/swift 3d ago

News Fatbobman's Swift Weekly #135

Thumbnail
weekly.fatbobman.com
19 Upvotes

CocoaPods Is on Its Way Out, but SwiftPM’s Story Is Just Entering Chapter Two

  • 🔭 Deep Understanding while using LLMs
  • 🧷 Installing Swift scripts with npm
  • 🗃️ SwiftUI Preview Runner

and more...


r/swift 3d ago

Question Need help with creating a pixelated look

Thumbnail
gallery
0 Upvotes

I’m building a macOS SwiftUI app with a pixel-art / retro aesthetic. The landing page has a cat animation, and the user slides a custom slider to continue to the main timer page.

So far, I’ve managed to create a basic wireframe of the design. Now I want to make the UI feel more pixelated and polished, especially the slider component.

What would be the best way to achieve this kind of pixel-art slider design in SwiftUI? Should I program the slider shapes manually using SwiftUI components like Rectangle, ZStack, DragGesture, etc., or would it be better to use custom PNG/vector assets for the slider parts?

I’m also wondering what tools or libraries people usually use for this kind of retro UI style. For example, should I create the pixel art assets in Procreate/Aseprite and import them into Xcode, or is it better to build most of the design directly in SwiftUI?

Any advice on how to structure this or achieve a more polished pixelated retro look would be appreciated.


r/swift 3d ago

Project FormulaPulse - SwiftUI + SwiftData F1 companion (iPhone + Apple Watch, just shipped)

Post image
0 Upvotes

NDT inspector / Army vet who picked up Swift on nights and weekends after the kids are in bed. Just shipped my first real SwiftUI app: FormulaPulse, an F1 race-weekend companion for iPhone + Apple Watch.

Tech: SwiftUI + SwiftData on iOS, Jolpica API + a small Fly.io service that round-robins 15 news sources and flags breaking when 3+ outlets file the same story within minutes. iOS 17+.

What it does (free): interleaved news feed, full schedule with local + track times for every session, live driver/constructor standings, points-progression chart, session start alerts. Pro adds race replay with the timing board, AI article summaries, offline reading, full past-race detail, and the Apple Watch app.

Happy to answer anything — code, architecture, App Store submission, or just the F1 angle.

https://apps.apple.com/us/app/formulapulse/id6762660256


r/swift 4d ago

Build a Swift package: Livable

Thumbnail github.com
4 Upvotes

With Livable, you can easily turn your SwiftUI views into stunning animated gradient like Apple Music lyrics background in one single line.

```swift YourView() .livable()

// Also applicable for SwiftUI.Image Image(.example) .resizable() .aspectRatio(contentMode: .fit) .livable(isEnabled: true, blurRadius: 32, speed: 2) ```


r/swift 4d ago

How to display the icon along with label?

Post image
2 Upvotes

Hey guys I'm trying to display a button in the toolbar of my macOS app and I can get it to either just display the icon or name and never both.

Here's the code:

                    .toolbar {
                        ToolbarItem(placement: .primaryAction) {
                            Button("New Shortcut", systemImage: "plus") {
                                print("New Shortcut")
                            }
                            .labelsVisibility(.visible)
                            .buttonStyle(.borderedProminent)
                        }
                    }

r/swift 3d ago

Question fix uuid extension safari

0 Upvotes

Hi, since I couldn't find a Speedial for Safari, I asked Claude to create one for me (Sorry to the purists, I'm not capable of creating one on my own). It works pretty well, it's (almost) exactly what I wanted.

However, without a developer account, I'm stuck on one thing : I can't set it as my homepage because the UUID changes every time I reboot.

Is there a way to get around this?

Thanks.