I could really use some help with macOS UI work for this Mastodon client I'm working on. I'm struggling ridiculously with the core concept of NSTableView cell resizing.
@eurasierboy ahhh doing it in iOS is so much easier though, ahahaha. The Cocoa API has not only been left to rot, but is badly documented as well, and actually has broken parts since it "evolved" that nobody has documented either.
Some things like "intrinsic height doesn't work unless you do view.stringValue = view.stringValue before checking it" is seriously voodoo nightmares.
I think, as in iOS UITableView, you would use implement NSTableViewDelegate with tableView(_:heightOfRow).
I'm sure you probably have already found this, but Ray Wenderlich has a NSTableView tutorial here:
@erico it doesn't behave as it's documented at all, as it was designed before auto-layout was implemented, and they interact in such insane ways you need to be really in tune with the intricacies to get it to work consistently.
I have it "working", but it doesn't work properly on resize, and some toots will be the wrong size for no reason, while others are fine...
@erico I appreciate the feedback but I have also searched for this for the last almost two weeks in Google as well, and tried very many things, lol.
The problem is that height measurement is so very inconsistent none of these approaches work, as I have no fucking idea what the random lifecycles are that are fighting each other.
@LimbClock my problem isn't rubber duck rant targets, but actual intricate day-in-day-out knowledge of the broken that is Cocoa.
So much extra knowledge is needed that isn't documented, particularly around dynamic resizing of NSTableViews as they introduced auto-layout long after they designed these interfaces.
Here's something that accommodates dynamic heights under auto layout:
OK, here's something from Ray W on doing it with iOS UITableViews. Maybe this will help.
@charlag right, so I use OpenAPI for literally everything now, and I have a Kotlin output.
You might want to play with it.
tl;dr you define a REST API in a YAML file, run it through a script, and get a Retrofit/OkHttp typesafe API + models out of it. xD
... and I haven't published the generator to github yet and only just realised omg.
@charlag btw, Kotlin is going native, targeting LLVM and planning to natively support Objective C libraries, so Kotlin for iOS is coming soon!.