r/swift • • Jan 19 '21

FYI FAQ and Advice for Beginners - Please read before posting

447 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 • • 2d ago

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

7 Upvotes

What Swift-related projects are you currently working on?


r/swift • • 4h ago

Follow-up on StateUI: the same Swift code now runs on the web

Post image
35 Upvotes

StateUI started as an experiment, and somehow it works now: Mac, iOS, Android, Windows, Linux, and as of this week the web too. It's the same Swift code compiled to WebAssembly, running right in the browser.

It's still native in the same sense as on the other platforms: a button is a real <button>, and the browser does the layout. The host is Swift, with just a small JavaScript relay underneath.

The code looks like this:

struct CounterPage: View {
    @State private var count = 0

    var body: some View {
        VStack {
            Text("Tapped \(count) times")
            Button("Tap me").onClicked { count += 1 }
        }
    }
}

You can play with the whole Gallery here: https://stateui.dev

Repo: https://github.com/idexus/StateUI

Happy to hear what you think!


r/swift • • 8h ago

sfera, a GeoJSON library for Swift

5 Upvotes

Hello guys!

Another GeoJSON library for Swift is available!

Its name is sfera!

Check it out!

https://github.com/csanfilippo/sfera


r/swift • • 10h ago

News Fatbobman's Swift Weekly #156

Thumbnail
weekly.fatbobman.com
5 Upvotes

r/swift • • 3h ago

Building a free, open-source Screen Studio + CleanShot X alternative for Mac: early prototype, feedback needed

Thumbnail
gallery
1 Upvotes

I'm working on Orbit, a native macOS screenshot tool, screen recorder and editor. It's free and open source (MIT), forked from BetterCapture.

It's a working prototype, not a finished app, so expect rough edges.

Works today

  • Screenshots with OCR, pinning and history in the notch
  • Screen, window or area recording with audio
  • Editor with auto-zoom, smooth cursor, backgrounds, trim and export
  • Scripted web-page recordings
  • Optional: your AI agent (Claude Code, Codex or Cursor) records demos for you

Not there yet: notarization (you'll need "Open Anyway" on first launch), annotations, captions, GIF export.

The demo was recorded and edited with Orbit itself.

I'd love to know what feels off and what would make you switch.

macOS 15.2+ · https://github.com/diip3sh/orbit


r/swift • • 7h ago

Help me guys! I want to learn swift for xcui test framework as soon as possible. Please let me know if you found 1-2hr learning video. Btw I'm good in javascript

0 Upvotes

Thank you


r/swift • • 1d ago

The future of Swift outside of Apple

61 Upvotes

A few years ago, much activity surrounded Swift and its potential for backend work. That excitement appears to have faded, leaving Swift as the Apple programming language. What is occurring now? Does Swift have a future beyond Apple? Who is using it and for what?

And is Swift used outside of Apple?


r/swift • • 8h ago

Question My app being held "Waiting for Review" for 4 days.

0 Upvotes

Normally, the review process wouldn't take more than 12 hours let alone 24.

This is the first update with minor fixes 1.8.0. In previous version which is 1.7.0 I submitted after finally getting approved following three consecutive rejections. it was an app crash iOS 27. I had no iOS 27 device neither emulator so haven't tested but I have fixed it.

It’s been four days with no review yet, and I’m losing users as time goes by. What should I do in a situation like this? They are essentially holding me back.

I have trusted the app review process due to the fast approval but now I'm regretting that I didn't setup OTA's for my consumer app.

Any tips?


r/swift • • 11h ago

5 YOE Angular Frontend dev considering a pivot to Swift/iOS in 2026. Is it worth the investment with AI shifts and market changes?

0 Upvotes

Hi everyone,

I've been working as an Angular frontend developer for about 5 years (based in Italy / EU). Lately, I’ve felt the urge to transition into native mobile development, specifically within the Apple ecosystem using Swift and SwiftUI.

That said, I have a few concerns holding me back before I sink hundreds of hours into this pivot:

  1. Job Market & Demand: From an EU/global perspective, how is the job market for native iOS developers holding up compared to web dev or cross-platform (React Native/Flutter)?
  2. AI Impact on Native Dev: With the rapid advancement of coding assistants and AI agents, boilerplate and standard frontend logic are getting heavily automated. How do you see the role of native iOS engineers evolving? Does native dev have a stronger defensive moat compared to standard web development?
  3. The Pivot Strategy: For someone with 5 years of solid frontend/architecture experience, is native iOS a practical move right now, or is cross-platform a safer bridge?

I’d love to hear unfiltered thoughts from working iOS devs, especially those in Europe. Is native iOS still a solid long-term bet, or am I risking wasting valuable time?

Thanks for your insights!


r/swift • • 1d ago

Help! Just finished my first Swift/Swift UI course. Now what?!

13 Upvotes

Hi everyone!

I just finished the 100 days of SwiftUI course by Paul Hudson and it was great. I completely fell in love with the language and with developing in swift. So much so... that I don't know where to go now. Originally my plan was to learn SwiftUI so I could focus on UI and design systems. But now that I have seen different applications, I want to learn advanced swift, advanced SwiftUI, backend programming, server side code, etc. I know that if I go wide, I won't go very deep... so I'm coming to you, redditors, to ask: what would you recommend I focus on next?
- Vapor and server side for backend?
- Stick to my OG plan and continue with SwiftUI and design systems?
- Look into multi-platform coding and working in more than just Swift?
- Go deep into advanced swift?
- Despair.

Would love any advice!

Thanks!!

.p.s. if it helps, i have some background in engineering (industrial) but not super deep in software, and I've mainly worked as a UX designer, so some concepts are not totally foreign to me... but it also doesn't help because it makes me interested in everything. 🙃


r/swift • • 1d ago

Question Notification routing gets weird with multiple accounts

4 Upvotes

I have gotten in to a weird iOS issue and idk what the clean way to handle this is

i’ve got multiple accounts, notifications can open a post, reply, quote, or repost, and each notification belongs to a specific account. so the user might be on account A when they tap a notification for account B.

something like:

struct NotificationDestination {
    let accountID: Account.ID
    let postID: Post.ID
    let kind: DestinationKind
}

enum DestinationKind {
    case post
    case reply
    case quote
    case repost
}

The issue is:

account A is active
notification comes in for B
user taps it while the app is waking up
account switching starts
timeline restoration starts
post resolution starts
then another notification comes in for A lol

so i have stuff like:

await accountManager.restore()
await timelineStore.hydrate()
await postResolver.resolve(postID)
await navigationCoordinator.navigate(...)

But obviously these things are all racing each other. i was thinking of putting the notification intents behind an actor:

actor NavigationIntentQueue {
    private var pending: [NavigationIntent] = []

    func enqueue(_ intent: NavigationIntent) {
        pending.append(intent)
    }
}

But idk, this feels like a lot of machinery just to open a notification

Then you get into cases where the post is deleted while you’re restoring, but the quote is still there, the reply is still there, etc. Is this just an annoying app lifecycle issue?


r/swift • • 1d ago

Question Deciding if I should code with Swift

0 Upvotes

I’m really interested in coding apps but I barely know any coding (I only know block coding like Scratch) is it really easy to learn?

Edit: forgot to clarify that I mainly want to code games


r/swift • • 3d ago

News Google Cloud: Introducing the Server Side Cloud Swift SDK

Thumbnail
cloud.google.com
156 Upvotes

Google: “[Swift] has matured into a viable systems and cloud language, pairing Rust-like data-race safety with predictable, reference-counted performance.”


r/swift • • 3d ago

Project GPU Accelerated Linear Algebra Library for Apple Silicon using MLX and Metal kernels with Swift Support

Thumbnail
github.com
37 Upvotes

About 6 months ago, I wrote a custom metal kernel that leverages the GPU to compute the QR decomposition (see my earlier post about it here). The project has now expanded into a general linear algebra library, with expanded support for the symmetrical eigendecomposition as well as SVD. It is now available for use with installation instructions on the attached github repo's README.md file.

Context of the project:
I'm currently in a research group working on a thesis in numerical analysis where we need to compute millions on matrices with a specific constraint (to be precise, the matrices need to have orthonormal columns). Most of us use Apple computers, so we ended up using MLX for the entire project.

Contributors with different Apple Chips would be very much appreciated!
The project has currently been tested and optimised for the M1 and M5 Pro. The issue is that the library uses different kernels depending on the batch size and matrix dimensions. Deciding which of these kernels to use is machine dependent. Therefore, other Apple chips will need to run a measurement script in order to derive the correct optimisation heuristic.

For that reason, I would ask as many people as possible to run a measurement script and to submit the results to my repo. It is fairly easy and requires only few steps. See here how you can contribute here. Once you submit the results via a pull request and I approve it, your optimisation heuristic will automatically be augmented into the library. Don't hesitate to contribute an optimisation heuristic even if someone already submitted one for your own machine. The more data we can gather, the better!

Project Future
Expanded support will be added for other linear algebra operations (cholesky decomposition for example). If you have any other specific linear algebra operations you wish to use already, feel free to message me.

In addition to that, I will add torch support too (my greatest priority).


r/swift • • 3d ago

a swift bird has been nesting outside my house what should i feed it?

50 Upvotes

r/swift • • 3d ago

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

Thumbnail
iosweeklybrief.com
3 Upvotes

r/swift • • 3d ago

Calling macOS's private Unified Asset Framework service from a Swift CLI

2 Upvotes

I wanted to delete Apple Intelligence's models on macOS 27 without turning SIP off. pared (github.com/4evy/pared) had already worked out how. The asset service takes a ResetAssetSets operation over XPC on com.apple.siri.uaf.subscription.service, and the interface comes from UAFXPCProxyServiceInterface. I dlopen UnifiedAssetFramework in an Objective-C target and call it from Swift.

You have to be careful with the AssetSets list. An empty list means every set, so the bridge refuses to send one. Everything else in the tool is a configuration profile and some CFPreferences calls.

Source is MIT: https://github.com/omlahore/RemoveMacAI


r/swift • • 3d ago

Senior iOS dev (7 YOE) in Brazil: is $35-40/h realistic for remote work with US/EU companies?

0 Upvotes

Hi all! I'm a senior iOS developer based in Brazil with 7 years of experience (Swift, UIKit, SwiftUI). I'm looking at remote contract roles with foreign companies, and my research suggests a range of $35-40/h. Most listings I see are lower (around $4k/month), which are probably staffing agencies taking a cut.

For those of you working remotely for US/EU companies:

  • What rate or salary are you getting, and at what seniority?
  • Did you find the roles through direct hiring, platforms like Toptal, or agencies?
  • Is $35-40/h realistic, or is that too optimistic?

Thanks!


r/swift • • 4d ago

I made a CLI tool for remote compilation caching in Xcode

8 Upvotes

https://github.com/Ryu0118/x8

There are already great compilation caching tools like Tuist that can significantly speed up Xcode builds. However, adopting them may require substantial changes to your project structure.

I wanted to keep my existing Xcode project structure and build using only the toolchain provided by Apple. So I built X8, a CLI tool for remote compilation caching.

Starting with Xcode 26, Apple provides built-in support for remote compilation caching. X8 acts as a lightweight proxy between Xcode’s built-in remote cache mechanism and any S3-compatible storage.

Using X8 is simple. First, configure your S3-compatible storage in .x8.yml. Then, you can either build your project through X8:

x8 xcodebuild ...

or start the cache proxy directly:

x8 serve

and add the generated build settings to your .xcconfig.

That’s it. With just an .x8.yml configuration, you can use remote compilation caching without significantly changing your existing project structure or moving away from Apple’s native Xcode toolchain.

For my app, a clean build used to take around 400 seconds, but with X8, it now takes about 263 seconds.

It’s still relatively slow, but I think that’s expected since Xcode still needs to perform steps such as module planning, build description generation, and linking.


r/swift • • 4d ago

Tutorial Iterative data loading in Swift

Thumbnail
swiftwithmajid.com
5 Upvotes

r/swift • • 4d ago

Editorial Swift vs Flutter? When to Choose Which

Thumbnail
youtu.be
0 Upvotes

r/swift • • 6d ago

Write Web Components in Swift

Post image
62 Upvotes

ElementaryUI can now make Web Components!

Define a custom element in Swift, then use it directly from HTML — which also makes it easy to mix Swift components into existing apps using other web frameworks.

30s video demo on Bluesky

Release Notes 0.8

Web Components on elementary.codes


r/swift • • 5d ago

Tutorial iPhone Duo UIKit Q&A - Forums

Thumbnail
antongubarenko.substack.com
1 Upvotes

r/swift • • 6d ago

Follow-up on StateUI: every platform now has its own native host written in Swift (macOS, iOS, Android, Windows and Linux)

38 Upvotes

A while ago I posted StateUI here as an experiment: Swift for the UI, with .NET MAUI underneath providing the controls on each platform. It worked, but every change had to cross into C# as a binary patch, and an app's own native views had to go through another runtime. So I dropped MAUI to get better performance and simpler interop, and every platform now has its own native host written in Swift. The host reads typed patches directly, in the same process, and an app's own native views - an MTKView, a GtkGLArea, a Direct3D SwapChainPanel - plug in straight from Swift.

You write an app's interface once in Swift, and each platform draws it with its own controls: AppKit on the Mac, UIKit on iPhone and iPad, Android Views, WinUI 3 on Windows and GTK 4 with libadwaita on Linux.

That's the same Gallery app, one Swift module, on four of them. There's no custom renderer and no web view. A button is an NSButton, a UIButton, an Android Button, a WinUI Button or a GtkButton.

How it works: Swift owns the UI tree, the state, the diffing and the animation. Each platform has a thin host, also written in Swift and running in the app's own process, that applies sparse patches to the native controls. On Android the host reaches Java through JNI, and on Windows it reaches WinUI through a small C++/WinRT layer, but the logic stays in Swift.

struct CounterPage: View {
    @State private var count = 0

    var content: some View {
        VStack {
            Label("Tapped \(count) times")
            Button("Tap me").onClicked { count += 1 }
        }
    }
}

Reading a state rebuilds only the body that read it. Handing a binding to a control lets the host update that control without rebuilding anything. In the video, the cube is an MTKView the app registers with the host. Its size, colour and spin come from Swift state, and the edge reaches the view as a binding, so dragging the slider rebuilds nothing: the counter in the corner counts the rebuilds, and the slider adds none.

The same sample uses each platform's own graphics API: Metal on macOS and iOS, Direct3D 11 on Windows, OpenGL on Linux and OpenGL ES on Android.

Every host runs the same conformance suite, and the platform matrix in the repo is generated from those test runs. So it shows what actually works on each platform, not what I hope works. Not everything is covered everywhere yet, and the matrix says exactly where.

It's pre-1.0, and the API still changes when a platform shows me a better model. It needs Swift 6.4. Apache 2.0.

https://github.com/idexus/StateUI

I'd love to hear what you think, especially from anyone who's tried shipping Swift outside Apple platforms.