Extension of Swift like Kotlin
protocol Kotlin {}
extension Kotlin {
func lets<R>(_ closure: (Self) -> R) -> R {
return closure(self)
}
func apply(closure: (Self) -> Void) -> Self {
closure(self)
return self
}
}
extension Int: Kotlin {}
extension NSObject: Kotlin {}