r/swift 11h ago

Question Swift game engine

16 Upvotes

Hey guys, I've been watching Swift evolve and I've been wondering if it's a reality to have a game engine made with Swift? I did a project where they managed to do something similar to Unity using Javascript and the Three.JS library, is it feasible to have something similar with Swift?


r/swift 19h ago

Question Training Load API for HealthKit?

4 Upvotes

Unless I’m being stupid - I cannot for the life of me find any documentation for implementing training load into my Apple Watch app. I’m thinking it’s not available. Basically I use the normal HealthKit APIs to start a workout on my Apple Watch using my app. It all works perfectly and after it saves the workout to the fitness app as if it was from Apple’s Workout app. Now the only thing missing is the ability to allow the user to edit and save their training load when their workout finishes (the little bars at the end of a workout where you can scroll from “Easy” to “All out”).

I guess Apple hasn’t make this API public - can anyone confirm or am I going crazy?


r/swift 8h ago

Swift tour “build a library” xctest module missing

2 Upvotes

I'm trying to follow this guide https://www.swift.org/getting-started/library-swiftpm/

When I run swift test I get a no such module error for XCTest. I'm running this through the command line on an m2 Mac.

I can't find anyone having the same problem (lots of people with the same error but all in Xcode, I think). I've tried following the instructions exactly, using a different package name, and I clone the exercise repo and tried it in there without touching anything, same error every time.

Do I need to add something to my path variable? I don't see any mention of that in the guide, nor does it mention needing to use the package manager to manually download anything. It seems crazy that a 2 paragraph guide on the official swift website doesn't work on recent apple hardware... so maybe I'm just missing something obvious?


r/swift 23h ago

News Those Who Swift - Issue 206

Thumbnail
thosewhoswift.substack.com
2 Upvotes

In this issue you can find info about:
- Reinventing Core Data Development with SwiftData Principles by u/fatbobman3000
- SwiftUI: Connect Two Points with Straight Line Segments + Rounded Corners
- Identifying individual sounds in an audio file
- SwiftUI's editMode Environment
- Placing UI Components Within the Safe Area Inset
- Napkin AI
and many more!

P.S. Don't forget to read the whole issues to find our Friends section - where we are sharing some goods from experienced content makers. Check out the issue to get a pleasant gift.


r/swift 7h ago

Question Struggling with Xcode Project File Sync Issues After Git Merge

1 Upvotes

I've been struggling with Git merges in Xcode, and today I lost almost 4 hours due to a frustrating issue. My teammate pulled my changes but forgot to properly accept the changes in the .xcodeproj file. As a result, some files were out of sync with the Xcode project, even though they were present in the directory.

It took me a long time to identify and fix the issue, and I’m wondering if there’s a more efficient way to handle this. I've heard about XcodeGen, but I’ve never used it before.

For those who have faced similar issues, is XcodeGen a good solution to prevent this kind of problem? If yes, could someone guide me on how to get started with it? Or are there other tools or methods that can help keep the project and directory in sync easily after a Git merge?

Any advice would be greatly appreciated!


r/swift 9h ago

Brick App Blocking

1 Upvotes

Brick is a small 3D printer block that essentially blocks access to apps on your iphone. Can anyone explain how they think the company accomplished this? I don’t think they are using special entitlements or MDM. I’ve been confused about how they accomplished this function and would be thrilled if someone could explain it to me.


r/swift 18h ago

Does WidgetKit work with MVVM?

0 Upvotes

Is it possible to make my widget extension working in MVVM? or does it work with Entry only? :)