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

I was developing an abstract & generic base class where the generic parameter defines the type of an abstract field. This field would be initialized by inherited classes, so I applied the 'lateinit' modifier to it which caused 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”