Work Note: Stream for Mac
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. 🦃
This got me thinking about my choice to use SwiftUI for the table view cells. One thing about that choice is cell reuse is kind of strange. The only way I’ve been able to get them to draw properly is to make a new view, just the SwiftUI part, so it gets laid out properly. I’m fairly certain I could get this working by using SwiftUI’s state mechanism but I decided to try doing a proper cell using AppKit and hook up the constraints manually. I have the cell put together and was working on constraints when I ran out of time for the day.
Worked on

This is a tough one. And it’s only tough because I don’t know AppKit as well as I do UIKit. Yes, Stream is still 100% UIKit and the Mac parts I’ve done are all AppKit. I’m thinking I may do some new features in SwiftUI because I need the practice. I’ve never built anything with SwiftUI.