Now we need directly use initializer of *Ks types to instantiate it. Their names could be so big, so to improve readability we could use this sort of construction to decrease usage of long type names. Example:
Now:
class VeryBigNameOfViewModel {
sealed class State {
data class Success(val data : String, val someOtherData : Int) : State()
object Loading : State()
}
}
class Controller : UIViewController {
...
private func observeState(_ state : VeryBigNameOfViewModel.State) {
switch VeryBigNameOfViewModelStateKs(state) /*not pretty*/ { ...
}
}
Now we need directly use initializer of *Ks types to instantiate it. Their names could be so big, so to improve readability we could use this sort of construction to decrease usage of long type names. Example: Now:
Wish:
Seems that it's not so hard)