A Simple Tip for developers writing both Kotlin & Swift

In your day to day programming, do you jump back and forth between writing Kotlin and Swift code as I do? You’ve also probably noticed that you develop muscle memory as you type the keywords. The two languages are quite similar and this lets me be quite productive in both. Yet, there is one set of keywords in particular that gets me every time: Kotlin’s val vs Swift’s let. I often end up typing let for Kotlin code, or val for Swift code.

Continue reading “A Simple Tip for developers writing both Kotlin & Swift”

‘lateinit’ modifier is not allowed on properties of a type with nullable

While developing an abstract & generic base class where the generic parameter defines the type of an abstract field. The field would be initialized by the inherited classes, and so I applied the 'lateinit' modifier to it. This cause an interesting error:'lateinit' modifier is not allowed on properties of a type with nullable 

Continue reading “‘lateinit’ modifier is not allowed on properties of a type with nullable”