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.