Sunday, December 8, 2024

I have submitted a few dozen radars/feedbacks over the years since Swift was first released. While some have gotten more traction than others, the one's that really find honest to gosh broken functionality get fixed. The bug I detailed here was reported on to Apple on 11 Nov in Feedback: FB15764538. On 3 Dec, I was notified by Apple that they believe it was fixed in Xcode 16.2 Beta 3 and they asked me to test it. I did and they did indeed fix the issue. Success. Effort justified.

import SwiftUI

struct ContentView: View {
  @State private var text = ""
  var body: some View {
    VStack {
      TextField("Enter Text Here", text: $text)
        .foregroundStyle(text.count > 3 ? .primary : Color.red)
      Text(text)
        .foregroundStyle(text.count > 3 ? .primary : Color.red)
    }
  }
}

This is the simple test case I sent Apple detailing the problem with TextField.

We developers don't work for Apple, but we are a critical part of the app development eco-system. The folks who produce the developer tools and the libraries are not perfect but they try really hard to get as close as they can to that goal. We, 3rd party developers and hobbiests, play an important role in helping close that gap even more. 

And just in case you think that you don't need to report bugs like these, that someone else will, don't bet on it. This Feedback was marked as: 

           Recent Similar Reports:None 

While a bunch of reports on the same bug from multiple developers can help draw more attention to the really hard to find or solve problems, even more powerful is a simple bit of sample code that clearly reproduces the problem - pure gold for the engineer trying to find the issue. Be clear, be concise, be polite. 

I feel great when a bug like this gets fixed. I helped someone elses app shine because it wasn't hobbled by this bug. I helped another developer not waste hours tracking this same bug down in order to find a work-around. I helped an Apple Developer Tools Engineer get a little closer to their goal and feel justifiable pride in producing a product just a little better than it was the day before.

Also, thank you to @MartinAtElitappar on the HackingWithSwift+ forums who helped validate my conclusion that this was a bug and who encouraged me to report it to Apple.

(LU9)

No comments:

Post a Comment