I managed to break the splitter on the right side of the middle column last time I worked on Stream. How? I have no idea what I did to break it. After beating my head against the wall for a half hour I finally found it. I’d set the width of the rightmost column to a fixed value. Duh! Don’t do that if you want things to automagically resize. Fixed. ✅
I need to sit down and read about state management with SwiftUI because it’s clear to me I’m too stupid to use it. 😄
I want to do what I though was a simple thing. I just want to hide, or change the background color of, my read/unread dot. The iPhone app just updates a value in a view model to be true or false and the UI is updated, easy peasy. It’s using UIKit instead of SwiftUI so it’s something I’m very familiar with.
Is it that easy in SwiftUI? Probably, but I don’t currently understand how to change a simple boolean value and convince the UI to refresh itself. I thought, like a big dummy, that I could make a boolean value on the View, decorate it with @State, and by calling toggle() on it, it would cuase the UI to update. Nope. Didn’t work. 😳
I’ve tried a few things to make it happen and it’s obvious I don’t understand how to do it. So… it’s time to go sit down and read how to do it. The View I’m trying to update is hosted in an NSHostingView and I can’t imagine that has anything to do with it? Do I need to using @Binding and @State together in a way I haven’t tried? Or, perhaps, I need use something completely different. ❌
Pretty big fail on my part today. Which is pretty frustrating. I have such little time to work on it that I need to have productive days. Failure is part of the process. I’ll figure it out and be better for it.
I guess I did manage to fix a bug. That’s a good thing. Just not enough.
Time to go home and make a Turkey sandwich. 🦃