r/swift • • Jan 19 '21

FYI FAQ and Advice for Beginners - Please read before posting

443 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 • • 14d ago

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

8 Upvotes

What Swift-related projects are you currently working on?


r/swift • • 3h ago

I built Graffle, an open-source diagramming and vector graphics app for macOS using Swift and AppKit

Post image
30 Upvotes

Title: I built Graffle, an open-source diagramming and vector graphics app for macOS using Swift and AppKit

Hey everyone!

I've been working on a personal project called Graffle, a native macOS application for creating diagrams and vector graphics.

I built it with Swift and AppKit, and I've decided to make it open source under the MIT License.

Some of the features I've implemented so far include:

  • Shapes, text, and Bézier paths
  • Smart connectors with different routing styles
  • Layers and reusable styles
  • Gradients and shadows
  • SVG import and export
  • PNG and PDF export

My goal was to build a native Mac tool that combines diagramming capabilities with vector editing.

I'm sharing the source code because I'd love to get feedback from other developers and designers, discover what could be improved, and hopefully find people interested in contributing.

I'm still working on the project, so constructive criticism is very welcome!

GitHub repository:
https://github.com/yahirvitelugardo/Graffle

A few things I'd love to hear your thoughts on:

  • What features do you consider essential in a diagramming tool?
  • How would you improve the connector or vector editing experience?
  • Are there any macOS-specific features you'd like to see in an app like this?

Thanks for checking it out!


r/swift • • 17h ago

Swift Pro: a Swift plugin I’ve been building for IntelliJ IDEA

Post image
21 Upvotes

I’ve been working on Swift Pro and wanted to share it here. It’s a commercial Swift plugin for IntelliJ IDEA, built around the IDE’s usual editors, toolbars, run configurations and test runner.

It brings together compiler completion and navigation, SwiftPM support, LLDB debugging, XCTest and Swift Testing results, SwiftUI previews and macro expansion.

It uses your installed Swift toolchain; Apple workflows, including previews, require macOS and Xcode.

If you try it, I’d appreciate feedback, especially on setup and everyday usability. I’m happy to answer questions about any of the supported (and unsupported) features.

Swift Pro on JetBrains Marketplace


r/swift • • 1h ago

Free ASO tool for App Store and Google Play: open source, self-hosted, daily rank tracking (AsoBeast)

Post image
• Upvotes

I'm the developer. It's written in TypeScript, for the part after your Swift app ships.

What frustrated me about ASO tools:

  • They charge per app, per keyword or per seat, which adds up fast for an indie app.
  • I ship on iOS and Android and wanted both stores in one place.
  • I couldn't see how they came up with their popularity and difficulty numbers.
  • My keyword list is my strategy, and it lived on a vendor's server.

So I built my own:

  • Free and open source (AGPL-3.0), self-hosted with Docker Compose.
  • App Store and Google Play, in every storefront: 175 on the App Store (Austria and Switzerland included) and 225 on Google Play.
  • Checks your keyword positions every day down to 200 and keeps the history.
  • One search per keyword and country also records every competitor on that results page, so watching competitors costs nothing extra.
  • Popularity and difficulty come with their inputs, and the docs explain how each one is calculated.
  • If you have an Apple Ads account, you can add your own API credentials and it uses Apple's popularity numbers for the terms Apple publishes. Everything else is an estimate from search results and autocomplete.
  • A keyword field per localization, with a list of tracked keywords your title, subtitle and keyword field don't cover.
  • History of listing and screenshot changes, yours and your competitors', plus review sync.
  • An MCP server, so Claude can answer questions about your rankings.

Setup is four commands from the README, then open localhost:3001. If you don't want to run a server, there's a hosted version for $10 a month with 7 days free and no card. Self-hosting has every feature.

GitHub: https://github.com/AsoBeast/asobeast
Website: https://asobeast.com

Hoping it helps. If you ship on both stores, I'd like to know what you still check by hand.


r/swift • • 19h ago

Project kinhin: scale your Mac’s CI runners to your queue

Thumbnail
youtube.com
0 Upvotes

kinhin watches your CI queue and, for each queued job, starts a fresh VM or container on your Apple silicon Mac, registers a one-job runner, and deletes it afterwards. Nothing idles and nothing is left over.

It works with GitHub Actions, GitLab CE, Gitea Actions and Forgejo Actions. Buildkite, Azure Pipelines and Bitbucket are planned for a later release.

The limits: Apple allows two macOS VMs at once on a Mac, whatever the hardware. Linux containers are not capped by that.

It’s still a beta. The beta 2 post lists what has been run for real and what hasn’t: https://kinhin.dev/blog/beta-2

Source and releases: https://github.com/RabinApps/kinhin. I’d especially like feedback from anyone running CI on Macs today.


r/swift • • 1d ago

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

Thumbnail
iosweeklybrief.com
1 Upvotes

r/swift • • 1d ago

Tutorial iPhone Duo Group Lab 10/15/26 - Q&A

Thumbnail
antongubarenko.substack.com
1 Upvotes

r/swift • • 1d ago

File converter

2 Upvotes

Hello everyone, I need your help. Do you know some libraries for convert files, for example to convert .pages to .pdf. I build an app, for me, where I can convert many different files into another format. Maybe I need more libraries than 1 or 2. Thank you an advance 🥺


r/swift • • 2d ago

Question Anyone letting agents drive their app in the Simulator? Looking for feedback

22 Upvotes

I’ve been working on Argent, an open-source MCP server that lets your agent (Claude Code, Codex, Cursor, etc.) tap through your app in the iOS Simulator, read the view hierarchy and logs, and profile with Instruments. That way it can check its own changes instead of just saying it’s done

A lot of the feedback so far has come from React Native folks, but it works with plain Swift/SwiftUI/UIKit apps too, and that’s where I’d love more input. If you’re already letting an agent drive your app, what’s working, and where does it fall apart? 😊


r/swift • • 1d ago

I managed to implement SwiftData + CloudKit Sharing in my app

1 Upvotes

Hi everyone! I saw a few discussions about SwiftData that don’t support CloudKit sharing for collaboration yet. I was myself searching for a solution after building my app around SwiftData and when I wanted to add collaboration functionality for my shopping list & grocery management app I discovered that SwiftData don't support sharing like CoreData does, I searched everywhere for a solution and the only solution from people here was to move from SwiftData and switch to core data but I really liked SwiftData and I didn't wanted to change it since it was well implemented with my app written in SwiftUI.

So after a lot of research and tests I managed to make collaboration work as well as syncing the private db perfectly with SwiftData using CKSyncEngine. So if you are also in this place where you have or want to build a SwiftData app and implement collaboration know that you can make it work!

My solution was to use two CKSyncEngine isolated in an Actor, one for the private data and the second for the shared data and a database manager that receives the updates from the engines and writes to the database.

It requires some work to start building it, you'll need to well understand CloudKit and a bit of Swift concurrency but once your first prototype works its pretty straightforward forward from there.

I'd be happy to hear your suggestions or learn how you'd approach it differently and if you have questions i'll be happy to answer them. hop this post can be useful!

Link to my app if you want to try:

Kaeli
https://apps.apple.com/il/app/kaeli/id6756275182


r/swift • • 2d ago

Project Show: a SwiftUI disk cleaner with a getattrlistbulk + FSEvents incremental index

2 Upvotes

I built Ammugghia after finding 100 GB of "System Data" on my MacBook Air: it was mostly iOS Simulator runtimes and Xcode/Gradle caches that Finder doesn't show.

  • Native SwiftUI, signed & notarized, no network, MIT
  • Covers Xcode, simulators, Android, about 30 package-manager caches, Electron app caches, local AI models, leftovers of deleted apps, Docker (volumes are never touched)
  • Every item shows exact paths and what happens after deleting it; Trash by default
  • Disk map, duplicate finder (APFS-clone aware), startup items, history with restore

DMG: https://github.com/Mingo07-dev/Ammugghia/releases/latest Homebrew: brew install --cask mingo07-dev/tap/ammugghia

Feedback welcome, especially cleanup targets I'm missing.


r/swift • • 2d ago

Project What broke (and what didn't) running untrusted Swift in the browser

2 Upvotes

I'm building SwiftQuest, a course where every exercise compiles and runs on a real Swift toolchain. A few things I learned along the way:

One throwaway gVisor container per run. It runs on arm64 Linux, with no network, a read-only system, an unprivileged user, and caps on memory, CPU and processes. A script takes about 1.3 s, a two-file compile about 1.5 s, and the first Swift package build about 20 s.

The compiler's notes vanished. Swift's default diagnostic style prints notes inside an ASCII drawing of your code, and my line-based parser couldn't find them. So add missing case: '.fog' disappeared from every run, in the exact lesson that promised the compiler would name the missing case. Compiling with -diagnostic-style=llvm fixed it. The rule since then: show Swift's own message word for word, and only ever add an explanation underneath. Crashes show Swift's one useful line instead of a full backtrace (SWIFT_BACKTRACE=enable=no).

Lessons tested like code. Early testers found that 18 of about 90 "try changing this" suggestions were wrong: the code didn't do what the text said. Now each one is an edit plus its expected result, and the test suite runs all 289 of them on the pinned toolchain.

The attack suite. Hostile programs try a fork storm, eating memory, filling the disk, endless output, sleeping past the clock, and probing the network. The first run found no hole, but it did find two bugs in the attack programs themselves, including a uname read that crashed under Swift 6.4.

Happy to go deeper on any of this. And if you know someone who's never coded and wants to learn Swift, I'm looking for about 10 beta testers from Oct 26 (free, and Pro for life for finishing): https://swiftquest.dev/beta?ref=beta-reddit-swift


r/swift • • 2d ago

Tutorial iPhone Duo Group Lab 10/13/26 - Q&A

Thumbnail
antongubarenko.substack.com
2 Upvotes

r/swift • • 3d ago

libark: libark is a modern, secure, Swift-native foundational layer over Linux POSIX primitives.

Thumbnail
github.com
11 Upvotes

libark

libark is a modern, secure, Swift-native foundational layer over Linux POSIX primitives.

While originally developed as the core runtime layer for ArkOS, libark is completely decoupled and designed to be used on any Linux distribution. It provides highly secure, object-oriented abstractions over low-level system calls, memory management, and file system interactions, without the burden of manual C interoperability.

Features

  • Object-Oriented POSIX: Wraps file descriptors, paths, and directory operations in safe, RAII-compliant Swift types.
  • Secure Syscall Boundary: Routes kernel interactions through strict, audited Syscall primitives.
  • Terminal Capabilities: Built-in abstractions for TTY detection and window sizing.
  • Advanced Formatting: Standardized formatters for human-readable byte sizes (SI and IEC), ISO 8601 timestamps, permissions, and classifications.
  • Declarative Sorting: Powerful generic SortEngine for metadata sorting across multiple criteria.

r/swift • • 3d ago

Project Harbeth: a texture-first Swift/Metal image and frame engine for Apple platforms

Post image
10 Upvotes

I’m maintaining Harbeth, an open-source Swift/Metal rendering engine for Apple platforms. The part I want to share here is the rendering infrastructure: accepting different source types, composing processing steps, and delivering a result with clear color, alpha, and ownership semantics.

The diagram shows the engine from source to delivery. A photo editor and a camera/video frame pipeline can use the same rendering core while keeping their own application workflows.

There are two integration routes:

  • HarbethIO for direct source + filter processing, with synchronous output() and asynchronous transmitOutput().
  • ImageNode for structured processing: reusable sources, geometry/optics, local effects and masks, transitions, ordered layer composition, and output profiles.

The engine accepts UIImage/NSImage, CGImage, CIImage, MTLTexture, CVPixelBuffer, and CMSampleBuffer. The ImageNode route can deliver a Metal texture or a RenderedFrame carrying output metadata and texture ownership. SwiftUI, UIKit, and AppKit preview hosts can display those results without first turning every frame into a CPU image.

A small frame-processing example:

```swift let node = ImageNode.pixelBuffer(pixelBuffer) .applying(C7Exposure(exposure: 0.25)) .transforming(ImageTransformRecipe(rotationDegrees: 90))

let frame = try await node.makeFrameAsync(profile: .stablePreview) ```

Once the frame is available, a SwiftUI view can display it with:

swift HarbethRenderView(frame: frame, resizingMode: .aspectFit)

Underneath, the runtime handles Metal execution, render-plan/pipeline caching, and texture reuse. Color/alpha, orientation, YUV conversion, HDR/dynamic-range contracts, and readback are explicit parts of the rendering layer; diagnostics and image analysis help inspect the result.

The host app owns capture, playback, recording, file export, persistence, and interaction. Harbeth supplies the image/frame rendering layer. Performance depends on the device, resolution, processing chain, and output path.

If you’ve built a Swift image or frame pipeline, which integration detail caused you the most trouble: buffer conversion, GPU resource lifetime, preview/final consistency, or something else?

Source, examples, and documentation: https://github.com/yangKJ/Harbeth

MIT licensed; targets iOS/iPadOS, macOS, and tvOS.


r/swift • • 4d ago

Tutorial App Size 101: Drop 40% in an afternoon

Thumbnail
blog.jacobstechtavern.com
26 Upvotes

r/swift • • 3d ago

how am i doing?

Post image
0 Upvotes

Just released my app a few days ago, havnt really done any marketing yet. How would yall say im doing so far??


r/swift • • 4d ago

enriched-markdown-ios v0.4.0 - syntax-highlighted code blocks (powered by tree-sitter)

Post image
11 Upvotes

enriched-markdown-ios, the SwiftUI Markdown renderer built on TextKit 2, now renders fenced code blocks with syntax highlighting.

New in this release:
🔸 Syntax highlighting: fenced code blocks colored by language with tree-sitter (14 grammars), themed per token type with SyntaxToken(.keyword), .string,… Shipped as a separate EnrichedMarkdownSyntaxHighlighting product, so apps without code don't link the grammars
🔹 Code blocks: .markdownCodeBlockLayout(.scrollable) adds a language header, a copy button, and sideways scrolling for long lines
🔸 Block images: maxHeight, aspectRatio, and resizeMode to cap the height, reserve the frame before load, and pick cover or contain
🔹 Mixed-direction text: writing direction resolved per paragraph, so RTL paragraphs sit right inside an LTR document
🔸 Faster long documents: less render time and memory, no re-measuring of unchanged text
🔹 Improved spoiler overlays: custom overlays get the baseline, segment order and tap point, and stay put through layout changes

🎥 Demo video in the comments.

💎 Available via Swift Package Manager!

dependencies: [
  .package(
    url: "https://github.com/software-mansion-labs/enriched-markdown-ios.git",
    from: "0.3.0"
  ),
],
targets: [
  .target(
    name: "YourApp",
    dependencies: [
      .product(name: "EnrichedMarkdown", package: "enriched-markdown-ios"),
      .product(name: "EnrichedMarkdownSyntaxHighlighting", package: "enriched-markdown-ios"), // optional, for code
    ]
  ),
]

Then enable it on the view:

import EnrichedMarkdown
import EnrichedMarkdownSyntaxHighlighting

EnrichedMarkdownText(content)
  .markdownSyntaxHighlighting()
  .markdownCodeBlockLayout(.scrollable)
  .markdownTheme {
    SyntaxToken(.keyword).foregroundStyle(.purple)
    SyntaxToken(.string).foregroundStyle(.green)
  }

GitHub & Docs: https://github.com/software-mansion/enriched-markdown/blob/main/packages/enriched-markdown-ios/README.md

Give it a spin and tell me what breaks. If it earns a place in your app, a ⭐️ on GitHub helps others find it.


r/swift • • 4d ago

Swift on Web

3 Upvotes

Is there anything jn the works that allows SwiftUI on web with SEO?


r/swift • • 5d ago

News This Website Is Now Made in Swift

Thumbnail
sindresorhus.com
159 Upvotes

r/swift • • 3d ago

Muse Code and Swift

0 Upvotes

In the last 3 weeks I replaced my codex uses with muse code. I mainly use spark 1.3 but yesterday and today I used wonder and wonder full for a few designs and review runs.

IMO, muse is incredible with non-UI swift code! And the way it explains its work and designs is so easy to work with. It also seems to have a very solid understanding of modern swift code. My codebase has noncopyable structs and compiles for embedded mode. I don't know if meta trained muse on very modern swift or what but it just gets it!

I wish I had more concrete words to say about it, but I'm curious if anyone else has tried it.


r/swift • • 3d ago

Project I built an open source office suite in Swift that runs on Linux, macOS, Windows, and WebAssembly

0 Upvotes

I just released Starling Office 0.1.0: Writer, Sheets, and Slides, with support for opening, editing, and saving DOCX, XLSX, and PPTX files.

The part I thought this community might find interesting is the architecture. The native apps and browser versions share the same Swift application code and UI framework. The UI uses Starling’s Swift port of Flutter’s framework, backed by the Flutter engine on desktop. For the browser, Swift compiles to WebAssembly and uses Skia’s WASM renderer.

The suite includes document formatting and tables, spreadsheet formulas and charts, and presentation editing with animations and speaker notes. It runs independently of Starling Desktop.

I built it with substantial assistance from Claude. It’s an early 0.1 release, with known issues documented in the release notes. The source is Apache-2.0 licensed.
Try the browser apps with editable examples:
https://openoffice.starling.build/
Source:
https://github.com/starling-build/starling
Native downloads and release notes:
https://github.com/starling-build/starling/releases/tag/office-v0.1.0
I’d welcome feedback from anyone working with Swift outside Apple platforms, particularly around WebAssembly and cross-platform UI.


r/swift • • 4d ago

Calling Accessibility APIs on an app that might be hung, how do you keep the caller from stalling?

3 Upvotes

My window-detection loop uses CGWindowListCopyWindowInfo to see what overlaps, and only calls the Accessibility API for apps that actually overlap, on a background queue with a 0.25 s messaging timeout. I tested hang safety by stopping a process with SIGSTOP.

Is a short timeout plus a background queue the usual pattern, or is there something cleaner I’m missing, especially for apps that stay unresponsive for longer?


r/swift • • 4d ago

Help! What’s the best stack to bring your current AI subscription (BYOK) by login, inside your mac app?

0 Upvotes

I am curious whether any of you have integrated BYOK into your Mac app and which stack you applied. I am not referring to custom API key setups or MCP.

Additionally, which method are you using lately to build macOS apps? Is it Swift, or are there more robust options?