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.

Please boost.

@piecritic hey, I'm an ex-iOS dev but I may help
@charlag every part of that toot is perfect.
@piecritic my journey was Android -> iOS (Swift!) -> (for the short time) Android -> iOS and Android (another guy leaves) and now I'm going to do Android only in another place
@charlag my company does Kotlin on Android to make it not totally suck. :)
@piecritic yeah, I brought Kotlin here too and it rocks. I miss some protocol stuff from Swift and that optional types are not real but apart from that it rocks, so many good design decisions

@charlag don't buy into that lie. Kotlin nullable types are real in Kotlin, as much as Swift nullable types are real in Swift.

Objective C can break those constraints just as well as Java can in Kotlin.

@piecritic I didn't mean that you can break it. Ofc you can. I meant that there's actually no optional types at runtime and you cannot make optional type from non-optional by hand
@charlag you've broken me. What do you mean by "cannot make optional type from non-optional by hand" at runtime?
@piecritic sorry, I probably hurry too much and cannot explain stuff properly.
suppose you have
let x = "Masto!"
How do you make a String? from x?
In Swift, you can
Optional(x)
in Kotlin, you cannot, there's no
enum Optional<T> { ... }

@charlag I thought that might be what you are saying, but I can't think of the use case.

If you really need that you can just do this:

fun String.optional(): String? {
return this
}

@piecritic there was one case when I wanted to use Rx like that

someNetworkRequest()
.map { Optional(t) }
.onErrorJustReturn(nil)
.filter { it != nil }

but I had to go with something like
.onErrorResumeNext(Observable.empty())

@charlag why were you passing an optional out of a map? I usually use flatMap to get _rid_ of optionals in Rx.

In RxSwift, RxOptional's filterNil.

@charlag btw, I can keep an eye out for Kotlin opportunities for you if you like. Tell me which continent you exist within and I'll ping you. :D
@piecritic oh my, that sounds awesome. I live in St. Petersburg, Russia but I would love to go remote (our move out of here)
@charlag ha, my first iOS contractor was from Ukraine and is now in the UK (which I made terrible ISO puns about).
@charlag when hiring Kotlin devs, we could only find people in Russia, Ukraine or Vietnam. Nowhere else!

@charlag there's a better reason for it actually.

https://en.wikipedia.org/wiki/Kotlin_Island

;)

@piecritic yeah, yeah, I know :D No one calls it by island name here, tho, but by city name, Kronshtadt.
And lighthouse on the kotlinlang.org is from there ofc
@charlag you should create a kapt implementation of an optional enum that overrides all instances of Type? in a codebase and call it Kronshtadt just to spite everyone.
@piecritic totally! 😂
@charlag how often do the apps you work on rely on HTTP APIs for a majority of functionality?
@piecritic oh almost always I guess? I worked with awful API here...

@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

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

... and I haven't published the generator to github yet and only just realised omg.

@piecritic that's pretty cool, thanks for sharing!
@charlag yeah! It saved me about 1 month of real work time, and took about 1 week of real work to implement!
@piecritic automation rocks!

@charlag lol 33% of my iOS codebase is generated. Ever done localisation on iOS? ... yeah.

So I went around and it's awesome.

@charlag tl;dr my localisation library/generator can support Sami languages even if iOS doesn't. ;)
@piecritic !!
sorry, I think I have to work, was nice to talk
@charlag haha fucking timezones xD enjoy your day.
@charlag the best part is you aren't shitting a brick about accidentally implementing the API slightly wrong, because if it broke, the template is broken, or the generator is broken _on every platform at the same time_, so the bug is found really fast.
@charlag so I have one input, that can output a Swift, Kotlin and JS API. I generate my server's test API from the same specification that i use for mapping my routes to functions on Node.js... so many layers of self-testing.
@charlag but yeah, I didn't really think about the lack of a real Option type (like what Rust and Swift have) until you just said it.