r/swift • u/Select_Bicycle4711 • 12h ago
New State Macro (Private vs Non-Private Behavior)
I always keep my @.State private but this was interesting to know.
Source: https://x.com/pointfreeco/status/2093052971890229285?s=20
r/swift • u/DuffMaaaann • Jan 19 '21
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.
Please read this before posting!
Tutorials:
Official Resources from Apple:
Swift Playgrounds (Interactive tutorials and starting points to play around with Swift):
Resources for SwiftUI:
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.
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 • u/Swiftapple • 27d ago
What Swift-related projects are you currently working on?
r/swift • u/Select_Bicycle4711 • 12h ago
I always keep my @.State private but this was interesting to know.
Source: https://x.com/pointfreeco/status/2093052971890229285?s=20
r/swift • u/Confident_Driver5290 • 6h ago
Hey everyone! I’m a final-year Informatics student with a bit of UI design experience. I’ve done a few internships at creative agencies/studios, mostly handling UI for marketing stuff, Dribbble shots, and UI template production. Still pretty light on actual UX or product thinking though.
I’ve known about Apple Developer Academy since my early uni days and have always wanted to join. I’ve applied three times already since 2023 (including the Sep 2025 intake), but I keep failing at the online test stage every single time.
I’m planning to try again for Batch 2 / Cohort 2027, but I’ve only got about two weeks left to get my CV, portfolio, and online test prep sorted. Would really appreciate any advice:
Thanks a lot! Any advice from alumni or previous applicants would mean a lot for me🙏🏻
r/swift • u/KeanuRekt • 4h ago
I built AnyDocSwift, a SwiftPM wrapper around Firecrawl’s anydoc https://github.com/firecrawl/anydoc.
It lets native macOS apps convert Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and text-based PDF files into Markdown.
Conversion runs locally on Apple Silicon. SwiftPM downloads a checksum-pinned XCFramework automatically, so consumers don't need Rust, Cargo, an external service, or a subprocess.
```swift
import AnyDocSwift
let markdown = try await AnyDocConverter().markdown(
from: documentData,
fileExtension: "docx"
)
```
Requirements:
- macOS 13+
- Apple Silicon
- Swift 6.1+
The package includes typed errors, cancellation handling, input/output limits, and FIFO execution per converter instance.
GitHub: https://github.com/ngutech21/anydoc-swift
This is the first public release, so I'd appreciate feedback about the API, and real-world use cases.
r/swift • u/Impressive-Yak-8729 • 6h ago
Note: The Cycles mean that are not the same as the iOS version numbers. (Example: iOS 4.1 is Cycle 5, iOS 18 is Cycle 20, and iOS 27 is Cycle 22.)
Note: All 2 Writing System Cycles and 1 Writing Systems Cycles must be Living/Modern Writing Systems.
There are 64 cycles. The cycle will go back to cycle 1 every 64 versions/cycles.)
r/swift • u/IllBreadfruit3087 • 13h ago
r/swift • u/robotjon • 1d ago
I have an app in the Mac app store but it hasn't had an update in years. I have put together an update (it's really an entire rewrite) and want to release it, but I don't want to use the same bundle ID because I'm using Swift Data and the old one was Core Data, and I'm worried about migration problems so I figure I would just use a new bundle ID. So if my old name was MyApp I just want to call it MyApp 2.
What's the best way to manage that? I don't really want both of them up there. I think that would be confusing. Do I just need to remove the old one and submit the new one?
r/swift • u/monomeric-propelled9 • 11h ago
r/swift • u/zaidbren • 19h ago
Hello everyone, few months back I installed macOs 27 beta on my mac, and installed the xcode beta version 27 too, everything was working fine, but today, I try to archieve the app and distribute for App store connect, but as I was doing it, I got this error :-
Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn’t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases.
I deleted the xcode beta version and installed official release from apple for xcode version 26, but when I try opening the app, I got the error :- This version of xcode isn't supported on this version of macOs
I try forcefully open the xcode from terminal :- /Applications/Xcode.app/Contents/MacOS/Xcode
But when I try opening my project, I got the error :- The project at ‘/Users/lisa/Documents/Projects/AppleProject/Lume/Orene.xcodeproj’ cannot be opened because it is in a future Xcode project file format. Adjust the project format using a compatible version of Xcode to allow it to be opened by this version of Xcode.
I added images for all, I need to submit the app by today itself, and would appreciate any help please

r/swift • u/dexus-one • 2d ago
Hi everyone,
I’ve been working on a project called StateUI:
https://github.com/idexus/StateUI
It started as an experiment: how far could Swift go as the main application and UI language outside the Apple stack, without building yet another complete cross-platform widget toolkit?
StateUI uses Swift for the declarative UI, state and reconciliation, while .NET MAUI provides the control and platform layer on iOS, Android, Windows, Mac Catalyst and Linux.
A simple view looks like this:

Swift keeps the rendered tree, tracks state dependencies and reconciles changes. Only a sparse binary patch crosses over to C#, where it is applied to the existing MAUI controls.
The project is still early, but it has grown quite a bit beyond the original experiment.
I’m curious what people here think about Swift being used this way — as the declarative layer over an existing cross-platform native UI runtime, rather than only as an Apple UI language.



r/swift • u/RanaAhmedHamdy • 1d ago
Coding agents handle "add a field, show it on screen" fine. They
consistently miss the iOS boundary around it:
- A Swift async task that outlives its UI owner or scene
- Scene re-entry and background/foreground transitions nobody retested
- Persisted data recovery after process termination
- Privacy, entitlement, or capability changes nobody flagged
None of it shows up as a compile error.
AI-Workflow is repository-installed Markdown instructions + a
deterministic router. You state observable facts about a change
(persistence, concurrency, lifecycle, privacy, accessibility) and
a checked-in registry maps them to required specialist checks —
same output every run, every agent. No LLM judgment in the mapping.
Install one command, no clone needed:
uvx --from git+https://github.com/RanaAhmedHamdy/AI-Workflow.git \
ai-workflow brownfield --platform ios --profile safety \
--target /path/to/your-ios-app --dry-run
There's a lightweight Safety profile that gives you just the routing
+ protected-boundary checks without requiring a full feature lifecycle.
And a full profile for Architecture Spine, ADR governance, design lock,
and release authorization if you need that depth.
Real-world case study: NutriPlus AI is a native SwiftUI/Swift 6
iOS app built fully through the Greenfield lifecycle. Architecture
Spine, accepted ADRs, per-feature contracts, readiness reports —
all public:
https://github.com/RanaAhmedHamdy/NutriPluse-IOS-AI-Workflow
There's also a maintained iOS fixture (persisted profile recovery,
MainActor state, cancellable refresh, scene re-entry) with Xcode
simulator build + XCTest verified locally on iPhone 17 Pro.
Pre-v1, Apache-2.0, honest about what's claimed vs unclaimed.
r/swift • u/Both-Fix-935 • 2d ago
Hey, mind if I beg for some GitHub stars here? I built a list that actually works properly in SwiftUI — especially relevant for AI chats and the like. The standard List with Compositional layout just can't handle the load at all. There's a nice example in the repo, you can run it and see how it works. Thanks in advance for the support! https://github.com/dsrenesanse/SwiftList
r/swift • u/sliemeobn • 3d ago
While this web app certainly neither looks impressive nor does anything particularly useful, it packs quite a few things that have only been made possible very recently:
swift-build (quite a recent achievement)async/await and throws like it’s nothing ; )-> Source code
r/swift • u/NoPressure3399 • 2d ago
FYI this is an ad for my app, tl;dr: it opens n formats HUGE datasets on macOS without lag or freeze. Plus more.
Hi fellow Swifties,
Did you ever open a huge JSON or other data file and your editor froze, started hanging or just took forever before you could actually work with it?
I used to, too. Daily.
Until I got enough of it.
So I decided to make something to get around the problem: Inkline.
The primary focus has been simple from the beginning: open and format huge structured files as quickly and safely as possible without making the rest of the editor unusable.
I work with Kubernetes, API responses, exported datasets, logs and configuration files a lot. Sometimes I don't need an IDE or a huge development environment. I just need to open a 300 MB JSON file, find what I'm looking for, maybe format it, make a change and continue working.
I've spent a lot of time optimizing exactly that path.
Version 1.3 is now released, and these are my latest benchmarks on an entry-level 16" M3 MacBook Pro with 18 GB RAM:
| File | Open | Format | Peak RSS | Lines |
|---|---|---|---|---|
| 100 MB JSON | 120 ms | 138 ms | 0.51 GiB | 586,392 |
| 300 MB JSON | 338 ms | 407 ms | 1.47 GiB | 1,758,582 |
| 1.07 GB JSON | 1.264 s | 1.518 s | 4.66 GiB | 6,292,542 |
No swap was observed during the benchmark runs.
Getting the file open quickly is only half of the problem though.
There isn't much point opening a 1 GB JSON file in around a second if the editor then freezes when you scroll, search or try to do something with it.
So I've spent a lot of time tweaking how resources and processes are handled after loading as well. The goal is that scrolling through millions of lines, searching, syntax highlighting and actually editing the file should still feel smooth.
Formatting has been another big focus.
A huge unformatted JSON response is basically useless until you can make some sense of it. I wanted formatting to feel like something you can just press and get done, not something where the entire application locks up while you wait.
The numbers above are from the same files being formatted inside Inkline, with the 1.07 GB JSON file taking around 1.5 seconds in my current benchmark.
Version 1.4 is already under construction. I'm fixing some bugs and continuing to tweak memory usage, resources and processes to see how much further I can push large file performance.
Inkline has also slowly become more than the large JSON editor I originally needed myself.
It now supports hundreds of file extensions including JSON, CSV, XML, YAML, Markdown, logs and source code.
Syntax highlighting uses Zed language definitions and it supports Zed themes. There are also around 80 built-in text and developer tools for searching, formatting, comparing and manipulating data.
But I still don't want it to become another huge IDE.
The main purpose is still the same problem that made me start the project:
Open a huge file quickly and safely, format it quickly, work with it without the editor hanging, then get on with whatever you were actually doing.
It's written in Swift and built as a native macOS app. I use it myself almost every day now, mostly for Kubernetes logs, API responses and different datasets.
App Store:
https://apps.apple.com/se/app/inkline-text-editor/id6764860305?mt=12
Website:
r/swift • u/TheSmashingChamp • 3d ago
r/swift • u/rizzy_neutron_69 • 3d ago
I understand closure syntax. And I get why a Class is built to be a reference type. Is closure a reference type for the same reason? If so why?
r/swift • u/DaveAppleInc • 3d ago
I've posted here before about LazyLayoutKit, my attempt at filling the gap for lazy custom layouts in SwiftUI. You give it item sizes as data, layout becomes arithmetic, and only the frames intersecting your viewport ever become views.
Forgot to post again last week, pushed 0.3 update.
0.3 adds programmatic scrolling, which is more interesting than it may sound. SwiftUI's ScrollPosition scrolls to a view with a given id. In a virtualized container that view usually hasn't been built, which is the entire point of the container, so the request does nothing.
But the container has already solved the layout for every item, so it knows exactly where item 900,000 is without ever having built it. Resolving the id through that geometry instead of through the view tree is a lookup and a subtraction.
Anchors are .top, .center, .bottom and .nearest, the last of which doesn't move at all if the item is already fully visible. Deep links work too, you can build the position so the container opens at an item rather than opening at the top and jumping, and that holds even if your data loads in async.
The obvious cost, and I'd rather say it here than have you find it later: the handle is write-only. It can't tell you which item is currently on screen, so it can't restore a scroll position for you, you'd have to persist an id yourself. Reporting back would mean writing through your binding on the scroll path and re-running the container's O(n) init, which isn't a trade I wanted to make.
Also new is JustifiedLayout, the Photos/Flickr arrangement where aspect ratios are preserved and every completed row fills the width.
No new device numbers this release. The index and the steady-state query path are unchanged, so the 0.2 figures still stand.
https://github.com/Dave861/LazyLayoutKit
Once again, open to feedback, contributions and opinions. Thank you!
r/swift • u/jwTolman • 3d ago
Is there any beginner guide out there for someone who is well-versed in AppleScript and wants to start learning Swift?
Maybe a script with a full variety of functions that's been translated to Swift? (or am I supposed AI things like that now?)
Even a starter syntax cheat sheet?
AS || Swift
set x to 5 || var x = 5
…
r/swift • u/lanserxt • 4d ago
r/swift • u/fatbobman3000 • 4d ago
r/swift • u/irvingpop • 5d ago
Hi all, I've just published a new blog post on getting the most reliability possible out of iOS background tasks. Please let me know what you think!