Skip to content

Files

Latest commit

fb5d049 · Nov 16, 2023

History

History
28 lines (20 loc) · 600 Bytes

Inline functions.md

File metadata and controls

28 lines (20 loc) · 600 Bytes

Inline functions

Inline functions are in the .h file, they can be called. However, they are regular functions and not inlined.

Explanations

Let's describe an inline function in Kotlin:

// InlineFunction.kt

inline fun inlineFunction(action: () -> Unit) {
    println("InlineFunction.inlineFunction() begin")
    action()
    println("InlineFunction.inlineFunction() end")
}

In Swift, this function is also available, it can be called without problems:

InlineFunctionKt.inlineFunction {
    print("I'm inside inline!!!")
}

Table of contents