Minor differences in creation syntax.
Let's create a small inner class in Kotlin:
class OuterClass(
val param: String
) {
fun parentFunc() {}
inner class InnerClass {
fun useSomeFunction() {
println("[email protected] == ${this@OuterClass.param}")
}
}
}
private fun example() {
val inner = OuterClass("12").InnerClass()
}
In Swift, the syntax for creating an instance of the inner class changes slightly, you need to explicitly pass the parent class to the constructor:
let _ = OuterClass.InnerClass(OuterClass(param: "1323"))