# Closure

Closure is a programming technique for implementing lexically scoped name binding in a language with first-class functions; a procedure retains the environment that was current when it was created.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Swift Closures in Kotlin Multiplatform - Ben Whitley

DevFeed: [Swift Closures in Kotlin Multiplatform - Ben Whitley](<https://devfeed.tech/articles/swift-closures-in-kotlin-multiplatform-ben-whitley-38323.md>)

Original publisher: [Read original article](<https://touchlab.co/swift-closures-kotlin-multiplatform>)

Published: 2020-06-11T19:11:25Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [cycles](<https://devfeed.tech/tags/cycles.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [swift](<https://devfeed.tech/tags/swift.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains how Swift closures are used on the iOS side of Kotlin Multiplatform projects and how they can create strong reference cycles. It describes how Automatic Reference Counting manages memory and why weak references to self may be needed when a closure captures a ViewController.

### Source excerpt

When working on the iOS side of Kotlin Multiplatform, it's helpful to understand Swift closures to update UI and avoid strong reference cycles.