# \#binding

**URL:** https://forums.swift.org/tag/binding/611.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [How to think properly about binding memory](https://forums.swift.org/t/how-to-think-properly-about-binding-memory/81841)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 4\
**Last updated:** [September 4, 2025, 12:24pm UTC](https://forums.swift.org/t/how-to-think-properly-about-binding-memory/81841 "2025-09-04T12:24:20Z")

</div>

I’m trying to use the compression\_stream type from the Compression framework, and I have some questions about the concept of binding raw memory to a type. compression\_stream requires that I set its src\_ptr property, whic…

---

## [@Binding in an ObservableObject](https://forums.swift.org/t/binding-in-an-observableobject/71421)

<div class="topic-metadata">

**Author:** [@Kilian](https://forums.swift.org/u/Kilian)\
**Replies:** 2\
**Last updated:** [April 23, 2024, 6:47pm UTC](https://forums.swift.org/t/binding-in-an-observableobject/71421 "2024-04-23T18:47:40Z")

</div>

What do you think about adding a @Binding to an ObservableObject for a NavigationPath? final class AuthenticationCoordinator: ObservableObject { @Binding var navigationPath: NavigationPath init( navigati…

---

## [Passing around references to SwiftUI Bindings in places that are not Views](https://forums.swift.org/t/passing-around-references-to-swiftui-bindings-in-places-that-are-not-views/65281)

<div class="topic-metadata">

**Author:** [@johngorenfeld](https://forums.swift.org/u/johngorenfeld)\
**Replies:** 2\
**Last updated:** [April 11, 2024, 7:12am UTC](https://forums.swift.org/t/passing-around-references-to-swiftui-bindings-in-places-that-are-not-views/65281 "2024-04-11T07:12:04Z")

</div>

New to the forum and I hope this is an appropriate question. To understand SwiftUI better under the hood, I am experimenting with passing around Bindings outside of Views. This is probably a bad idea. But I am hoping it…

---

## [Changing a binding variable from a secondary thread](https://forums.swift.org/t/changing-a-binding-variable-from-a-secondary-thread/70059)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 1\
**Last updated:** [February 15, 2024, 4:57pm UTC](https://forums.swift.org/t/changing-a-binding-variable-from-a-secondary-thread/70059 "2024-02-15T16:57:41Z")

</div>

Not sure if this is a SwiftUI question or not: struct S { var value = 0 } func foo(\_ x: Binding\<S\>) { DispatchQueue(label: "queue").asyncAfter(deadline: .now() + 1) { dispatchPrecondition(condition: .notOnQ…

---

## [Binding\<T\> accesses wrapped value on init](https://forums.swift.org/t/binding-t-accesses-wrapped-value-on-init/59720)

<div class="topic-metadata">

**Author:** [@gadirom](https://forums.swift.org/u/gadirom)\
**Replies:** 8\
**Last updated:** [August 17, 2022, 4:12pm UTC](https://forums.swift.org/t/binding-t-accesses-wrapped-value-on-init/59720 "2022-08-17T16:12:09Z")

</div>

Hi all! I've noticed this today, and I'm not sure it's correct behaviour. Though in most cases it doesn't cause any trouble, in one particular case it can. Let's say we have to have a binding to an optional which is n…

---

## [Binding to a variable bug?](https://forums.swift.org/t/binding-to-a-variable-bug/53680)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 2\
**Last updated:** [November 25, 2021, 6:11am UTC](https://forums.swift.org/t/binding-to-a-variable-bug/53680 "2021-11-25T06:11:17Z")

</div>

Looks like bug to me: struct Foo { static var bar: Int = 0 } let binding1: Binding\<Int\> = .init { Foo.bar } set: { Foo.bar = $0 } // ok let binding2: Binding\<Int\> = $Foo.bar // Error: Cannot find '$Foo' in scope o…
