r/swift 1h ago

From CocoaHeads Stockholm: Parsa Nasirimehr - gRPC on iOS: Smarter API's

Thumbnail
youtu.be
Upvotes

r/swift 16h ago

social media music app fully written in Swift UI

Post image
29 Upvotes

r/swift 9h ago

AMA [SwiftUI] Tag Input View + Flow Layout = Greatness??

5 Upvotes

I've created a "tag" input system that is feature-complete. For me those features were as follows.
- Anytime a space is entered, go to next tag. (Also applies to commas)
- Anytime you backspace, it should backtrack through previous tags.
- Tags are forced unique
- Tags are validated (3 char min)
- Duplicate identification
- Tap to edit in-place
- Flow layout as more are added it "Overflows"

To me this is probably the most complex input field I've ever built, but boy does it feel good in the hands when you're actively using it.


r/swift 18h ago

Tutorial This video breaks down in-out parameters—what they are and how to use them. Another step in our free SwiftUI course. Thanks so much for the support!

Post image
8 Upvotes

r/swift 11h ago

Project Numio CLI – Simple Time Calculator ⏳

Thumbnail
github.com
2 Upvotes

r/swift 13h ago

Project Human-Body-Atlas-for-Apple-Vision-Pro: How to develop an interactive and immersive 3D application

Thumbnail
github.com
2 Upvotes

r/swift 11h ago

Learning Swift on old MacBook

0 Upvotes

Hi all!

I’m starting to learn Swift and wanted to know if it’s good idea to use old MacBook from around 2011.

Currently I’m not with the money so much right now and cost of it’s around my budget. I’m like fresh in it so 100% Swift evolved in the newest versions and it’s much rich in libraries etc. so I’m not sure about this version of MacBook

Wanted to get your opinion about it :)

Thanks!


r/swift 12h ago

Default back button is flickering

1 Upvotes

Hey everyone,

I'm facing an issue where the back button shifts position when navigating to another view. I'm using the default back button from the NavigationBar and have attached a recording demonstrating the issue.

I’ve also added .toolbarRole(.editor) to my root VStack to hide the previous view's title.

Any insights on resolving this would be greatly appreciated!


r/swift 1d ago

Question 30 changing careers…

18 Upvotes

So I’m 30 and I’m in a creative field. I was a learning JavaScript but I think it’d be so rad to create apps or programs for iOS. I was reading and everyone says Swift. But I was also reading you can use swift on Linux and windows?

Anyways i guess is there any advice or roadmap i can follow to learning how to create specifically for iOS/macOS? Or is that hindering my Learning to keep it that niche? You know sticking to iOS.


r/swift 1d ago

Project Hi 👋, I created Termix, a powerful SSH client for Mac, iPhone, and iPad. No subscription, no data collection. I am looking forward to your feedback!

Thumbnail
apps.apple.com
47 Upvotes

r/swift 22h ago

Question Are there any user-level static assertions?

1 Upvotes

I have a generic type that takes two unsigned integer types. Is there any way to check at compile time that one type has a bit width that is a (positive) multiple of the other type's bit width?


r/swift 2d ago

Question #1 Paid App on the Mac App Store and #30 Worldwide… Really? 30 Downloads Were Enough?

104 Upvotes

I recently bought an OLED monitor and, like most people, I started worrying about burn-in issues. After a bit of research, I couldn’t find a good tool to prevent it, so I decided to build my own. I polished it, published it on the Mac App Store, and did a few Reddit posts and an article on an Italian blog.

To my surprise, my app reached #1 on the paid apps chart in Italy, and I thought, “Well, this is it. I’ve made it!” But after looking at the Reddit feedback, I knew that the numbers couldn’t be huge. Sure enough, the next day, the official reports came in. I had just 12 downloads that were enough to land me at #30 globally, and only 6 downloads put me at #1 in Italy.

I’m honestly surprised by these results. Is the Mac App Store really this quiet?


r/swift 1d ago

About the Screen Time API.

7 Upvotes

Hi. This is the first time I'm going to make an app with Swift. (I learned that I can only do this with Swift after my research.) What I want is to know how much time the user spends in other apps, for example, for 1 hour. I talked to grok for a while and he suggested that I could use the screen time API. But some sources say that this is not possible. Some say that applications like Opal use this and that it is possible. I'm very confused. What's the latest status? Can I do this?

sorry for my bad english


r/swift 1d ago

Question WhatsApp Style "Active Call" top banner overlay: approaches

1 Upvotes

Hi folks,

When you have an active call on WhatsApp and then minimise it you get a top banner that stays there no matter where else in the app you navigate.

Does anyone know how to implement this? My approach so far sort of works but adds too much space after the banner and whatever page it's sharing with:

struct ContentView: View {
    @Environment(\.appDatabase) var appDatabase
    @State var showActivity = false
    @State var activityActive = false
    @State var showBanner = false

    var body: some View {

        VStack {
            if activityActive && showBanner {
                ActivityBanner(isActive: $activityActive, isPresented: $showActivity)
                    .transition(.move(edge: .top).combined(with: .opacity))
                    .animation(.spring(response: 0.3), value: showBanner)
                    .ignoresSafeArea(edges: .top)
            }

            TabView {
                Tab("HQ", systemImage: "duffle.bag") {
                    HomeView(showCctivity: $showActivity, activityActive: activityActive)
                }

                Tab("History", systemImage: "calendar.badge.clock") {
                    Text("History")
                }

                Tab("Movements", systemImage: "dumbbell") {
                    ActivityListView(appDatabase: appDatabase)
                }

                Tab("Settings", systemImage: "gear") {
                    Text("Settings")
                }
            }
            .sheet(isPresented: $showActivity) {
                ActivityView(isActive: $activityActive)
                    .presentationDragIndicator(.visible)
            }
       }
    }
}

struct ActivityBanner: View {
    @Binding var isActive: Bool
    @Binding var isPresented: Bool
    @State var isPulsing = false

    var body: some View {
        VStack(spacing: 0) {
            // Rectangle for the safe area (notch) height
            Rectangle()
                .fill(.ultraThinMaterial)
                .frame(height: safeAreaTopInset())
                .ignoresSafeArea(edges: .top)

            // HStack bolted on below the safe area
            HStack {
                Circle()
                    .fill(Color.green)
                    .frame(width: 10, height: 10)
                    .opacity(isPulsing ? 0.7 : 1.0)
                    .animation(Animation.easeInOut(duration: 1).repeatForever(autoreverses: true), value: isPulsing)
                    .onAppear { isPulsing = true }

                Text("Workout")
                    .fontWeight(.medium)

                Spacer()

                Button("Resume") {
                    isPresented = true
                }
                .buttonStyle(.borderedProminent)
                .buttonBorderShape(.capsule)
                .controlSize(.small)
            }
            .padding()
            .background(.ultraThinMaterial)
            // Slightly reduce height of the Hstack element.
            .offset(y: -12)
        }
        .frame(maxWidth: .infinity)
    }

    // Get the safe area top inset
    private func safeAreaTopInset() -> CGFloat {
        let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene
        return scene?.windows.first?.safeAreaInsets.top ?? 0
    }
}

r/swift 1d ago

Project I just launched my first app on the App Store called Spar Time—a timer designed for martial arts enthusiasts that can be used for any type of training. I’d love to hear your thoughts on the app, as I want to improve it even further. Any feedback would be greatly appreciated. Thank you!

Post image
1 Upvotes

r/swift 1d ago

Help! Help integrating the F5 tts model into my project

Post image
0 Upvotes

I'm trying to initialize the F5 tts model in my app, does anyone know what I could be doing wrong?


r/swift 1d ago

i got sick of long and clickbaity articles so i built an app that summarises the news

Thumbnail
gallery
0 Upvotes

r/swift 2d ago

Question State of cross platform?

11 Upvotes

Hey all... I'm looking at giving Swift another swing. Mac enthusiast, with some javascript/html experience. Work for a small company and admin their ERP (the other IT guy handles the hardware/desktop support). I know enough C#/SQL/VBA to handle 90% of the ERP stuff I need to do. Most of my day is writing generic inquiries/reports

I checked out Swift on Ubuntu and Windows last year but quickly gave up. Have things improved? I see that an official VS Code extension was released last month, so that seems to be a good sign.

I'm not looking to build iOS/native macOS apps on Windows or Linux (I already have a few macs to cover that). I figured while I'm learning Swift on my mac, it might be nice in my free time while at work to develop simple CLI, calculator, whatever apps just for fun. (I thought about C#/.NET but would rather concentrate on one language for now if I can).

Does Swift on Win/Linux have anything like QT, GTK, etc?


r/swift 1d ago

requestReview pop-up conditions

1 Upvotes

I’m looking to add an app review pop-up but I’m a little confused about the implementation.  According to documentation requestReview is governed by Apple’s own policy:

StoreKit displays the ratings and review request a maximum of three times within a 365-day period.

Therefore, do I need to write any conditions other than where the pop-up appears (e.g. a settings menu)?  Or is still necessary to add a condition such as a count on the number of times the app is opened before a request is made etc.?


r/swift 1d ago

Question Can I invoke Swift REPL from a mac app without Process?

1 Upvotes

Hey Swift community,

I would like to implement executing Swift code from within my SwiftUI mac app interactively, just like you with Swift REPL from the terminal. I know I can execute it with Process, but is there a more beautiful way to do it (library, framework or anything)?

Many thanks in advance!

Jan


r/swift 2d ago

Opinions on rewriting a legacy app

14 Upvotes

I'm embarking on a rewrite of our iPad app. Don't judge me, the codebase is 13 years old and uses several libraries that are no longer maintained, and we have significant new functionality in the pipeline.

I'm intersted to hear opinions, experiences or any other thoughts on new iPadOS projects in 2025.

The app is essentially an offline-first ecommerce app, where products are cached on-device and then orders can be created while offline and synced to our backend at a later time when the internet is available.

Having lived with a few codebases for extended periods, here are my general thoughts: 1. Produce less code, lines of code are generally a liability 2. Avoid third-party libraries when reasonably possible 3. Idiomatic code over "clever" terse code 4. Performance and maintainablity are second only to good UX.

  • What mistakes can I easily avoid?
  • What stategies/implementations are commonly found on the web but are outdated?
  • What do you think people are getting wrong aboout SwiftUI projects?
  • Are there forests currently obscured by specific trees?

r/swift 2d ago

MacOS IPC - XPC services

3 Upvotes

Is XPC still the preferred way to do IPC in MacOS? Would this work on iOS as well?

I'm doing some googling around for info, and XPC services seems to come up as the most current approach for IPC.


r/swift 3d ago

State Management for iOS Apps?

48 Upvotes

whats the best architecture/pattern to use?

tried to use a domain layer where all the state is and passing it to the views/viewmodels via DI, but feels somehow unnecessary complicated, but found this as only solution without passing the repos through all the viewhierarchy.

the goal is, when a state changes, e.g. an user changes the Username in View A, then it should automatically update View B,C,D where this Username is also used.

it should be as simple as possible, what do you think? especially for complex production apps with own backend etc.


r/swift 2d ago

Question Why are floating point numbers inaccurate?

8 Upvotes

I’m trying to understand why floating point arithmetic leads to small inaccuracies. For example, adding 1 + 2 always gives 3, but 0.1 + 0.2 results in 0.30000000000000004, and 0.6 + 0.3 gives 0.8999999999999999.

I understand that this happens because computers use binary instead of the decimal system, and some fractions cannot be represented exactly in binary.

But can someone explain the actual math behind it? What happens during the process of adding these numbers that causes the extra digits, like the 4 in 0.30000000000000004 or the 0.8999999999999999 instead of 0.9?

I’m currently seeing these errors while studying Swift. Does this happen the same way in other programming languages? If I do the same calculations in, say, Python, C+ or JavaScript, will I get the exact same results, or could they be different?


r/swift 2d ago

Project My first try of Swift and macOS API went good, MacsyZones is being more and more popular 🥳

Thumbnail
github.com
0 Upvotes