# Allow Property Wrappers with Multiple Arguments to Defer Initialization when wrappedValue is not Specified

**URL:** <https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319>\
**Category:** Pitches\
**Tags:** propertywrapper\
**Created:** [July 9, 2020, 6:06am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319 "2020-07-09T06:06:36Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![tourultimate](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@tourultimate](https://forums.swift.org/u/tourultimate)\
**Post date:** [May 13, 2021, 2:25pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/21 "2021-05-13T14:25:38Z")

</div>

+1 this would help simplify some code in a package we are developing that wraps a very large C library in Swift.

---

<div class="post-metadata">

**Author:** ![nikitamounier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nikitamounier/32/24825_2.png) [@nikitamounier](https://forums.swift.org/u/nikitamounier)\
**Post date:** [May 31, 2021, 9:38pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/22 "2021-05-31T21:38:21Z")

</div>

This would be really great – now that we're able to use property wrappers in function and closure parameters, this would go even further in improving the model. For instance, this could become a really valuable feature for @mbrandonw's and @stephencelis 's [Composable Architecture](https://github.com/pointfreeco/swift-composable-architecture) which is becoming increasingly popular (and for good reason!). For SwiftUI views, in TCA you pass down the store as a property, and then at each view create a "view store" which chisels away the store and the store's state to the bare essentials a view needs to do the job, for both ergonomics and performance. You can either do this using `WithViewStore`, or by using an `@ObservedObject var viewStore` and custom initialisation logic.

However, both of these methods have their own issues, which are talked about in [this thread](https://forums.swift.org/t/wrappedstore-property-wrapper-to-get-rid-of-boilerplate/49058). If we were able to defer initialization like proposed here, a new and really expressive syntax could be enabled:

```swift
@ViewStore(state: ViewState.init) var store: Store<AppState, AppAction>

```

or

```swift
@ViewStore(state: \.someState, action: AppAction.someAction) var store: Store<AppState, AppAction>

```

while being able to pass down the store from the parent view.  
As @hborla specified, this hopefully should be straightforward to implement, and could enable some really great APIs.

Big +1

---

<div class="post-metadata">

**Author:** ![mattcurtis](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mattcurtis/32/18493_2.png) [@mattcurtis](https://forums.swift.org/u/mattcurtis)\
**Post date:** [June 2, 2021, 1:22pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/23 "2021-06-02T13:22:06Z")

</div>

+1 — this would be a huge boon to the usefulness and ergonomics of property wrappers

---

<div class="post-metadata">

**Author:** ![YuAo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/yuao/32/9871_2.png) [@YuAo](https://forums.swift.org/u/YuAo)\
**Post date:** [June 25, 2021, 10:11am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/24 "2021-06-25T10:11:16Z")

</div>

+1

---

<div class="post-metadata">

**Author:** ![Objective\_Cesar](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/objective_cesar/32/18310_2.png) [@Objective\_Cesar](https://forums.swift.org/u/Objective_Cesar)\
**Post date:** [June 26, 2021, 8:37pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/25 "2021-06-26T20:37:14Z")

</div>

+1 … in my opinion this is a good chance to get rid of some boiler plate. Often we find some workarounds for things we need to do often. I like the approach of making things more convenient as long as it does not contradict a general understanding of how code “should” look like.  
I think this proposal is a good example of how a little change can make a difference.

---

<div class="post-metadata">

**Author:** ![nikitamounier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nikitamounier/32/24825_2.png) [@nikitamounier](https://forums.swift.org/u/nikitamounier)\
**Post date:** [July 13, 2021, 9:08am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/26 "2021-07-13T09:08:49Z")

</div>

Agreed!

---

<div class="post-metadata">

**Author:** ![nikitamounier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nikitamounier/32/24825_2.png) [@nikitamounier](https://forums.swift.org/u/nikitamounier)\
**Post date:** [August 14, 2021, 1:55am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/27 "2021-08-14T01:55:57Z")

</div>

Any possibility of getting some more traction on this? Although I’m planning to, I don’t have time right now to learn C++ and the compiler to implement this feature myself, but it seems like it could be really useful for many people, and a natural extension of property wrappers.

---

<div class="post-metadata">

**Author:** ![amritpan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/amritpan/32/39281_2.png) [@amritpan](https://forums.swift.org/u/amritpan)\
**Post date:** [September 10, 2021, 7:10pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/28 "2021-09-10T19:10:42Z")

</div>

Hey everyone, I'm currently working on the implementation for this pitch and we will hopefully graduate this to a proposal very soon!

---

<div class="post-metadata">

**Author:** ![charlie.computer](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/charlie.computer/32/24530_2.png) [@charlie.computer](https://forums.swift.org/u/charlie.computer)\
**Post date:** [November 10, 2022, 3:25pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/29 "2022-11-10T15:25:31Z")

</div>

Any news on this, @amritpan?

---

<div class="post-metadata">

**Author:** ![nknr](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nknr/32/23119_2.png) [@nknr](https://forums.swift.org/u/nknr)\
**Post date:** [December 1, 2022, 10:25am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/30 "2022-12-01T10:25:36Z")

</div>

+1 would be really useful

---

<div class="post-metadata">

**Author:** ![mickeyl](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mickeyl/32/12258_2.png) [@mickeyl](https://forums.swift.org/u/mickeyl)\
**Post date:** [December 1, 2022, 10:39am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/31 "2022-12-01T10:39:00Z")

</div>

It's been two and a half years now… @amritpan you still working on that?

---

<div class="post-metadata">

**Author:** ![amritpan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/amritpan/32/39281_2.png) [@amritpan](https://forums.swift.org/u/amritpan)\
**Post date:** [December 1, 2022, 4:42pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/32 "2022-12-01T16:42:51Z")

</div>

The plan was to integrate this into [another pitch involving property wrapper initialization](https://forums.swift.org/t/pitch-refining-property-wrapper-related-initialization/52049/2) and have it go through the review process together. Unfortunately, I ran aground in the implementation of the other pitch and that has held this up.

I certainly understand the eagerness to get this integrated into the language! I will attempt to put up the implementation for this specific feature under the experimental flag later this month.

---

<div class="post-metadata">

**Author:** ![hmlongco](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hmlongco/32/5729_2.png) [@hmlongco](https://forums.swift.org/u/hmlongco)\
**Post date:** [February 23, 2023, 3:32am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/33 "2023-02-23T03:32:50Z")

</div>

Yes, please add this. Yesterday would have been great. ;)

I was about to post another thread because I had something like...

```swift
struct ContentView: View {
    @InjectedObject(\.contentViewModel) var model: ContentViewModel
    var body: some View { ... }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        let model1 = ContentViewModel(test: 4)
        ContentView(model: model1) // FAILS WITH TYPE CONVERSION ERROR
    }
}

```

The keyPath injects from a container, but I also want to be able to pass test versions into the view from the preview code as shown.

I'd done something similar with StateObject prior to this, but the two part initialization with the keyPath AND the wrappedValue simply doesn't work.

I can do this If need be...

```swift
struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        let model1 = ContentViewModel(test: 4)
        ContentView(model: InjectedObject(model1)) // WORKS... BUT CLUNKY
    }
}

```

---

<div class="post-metadata">

**Author:** ![elychkouski](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/elychkouski/32/30699_2.png) [@elychkouski](https://forums.swift.org/u/elychkouski)\
**Post date:** [October 9, 2023, 3:05pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/34 "2023-10-09T15:05:46Z")

</div>

+1 for this feature!

---

<div class="post-metadata">

**Author:** ![Stan\_Smida](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stan_smida/32/10999_2.png) [@Stan\_Smida](https://forums.swift.org/u/Stan_Smida)\
**Post date:** [November 3, 2023, 6:35am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/35 "2023-11-03T06:35:21Z")

</div>

Any update on this? It's been 3 years. It is much wanted and great improvement.

---

<div class="post-metadata">

**Author:** ![elychkouski](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/elychkouski/32/30699_2.png) [@elychkouski](https://forums.swift.org/u/elychkouski)\
**Post date:** [November 3, 2023, 9:29am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/36 "2023-11-03T09:29:26Z")

</div>

Yes, this will unblock lots of useful possibilities around wrappers

---

<div class="post-metadata">

**Author:** ![eric-musliner](https://avatars.discourse-cdn.com/v4/letter/e/e19adc/32.png) [@eric-musliner](https://forums.swift.org/u/eric-musliner)\
**Post date:** [August 20, 2025, 12:26am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/37 "2025-08-20T00:26:17Z")

</div>

Is this still on the road map now in 2025? I ran into this limitation with a library I’m building and it would be a great improvement

---

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [August 20, 2025, 1:53am UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/38 "2025-08-20T01:53:59Z")

</div>

Unfortunately there is no public Swift roadmap, and if there is an actual roadmap on the Apple side, property wrappers seem to be pretty far down the list. They don't even support features introduced years ago, like `async` or `throws` getters, nor do they compose well with concurrency. The current suggestion is that most can be replaced with macros, which isn't nearly as easy, but can be much more powerful. I do hope we see some progress, as they're much easier to write than macros.

---

<div class="post-metadata">

**Author:** ![elychkouski](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/elychkouski/32/30699_2.png) [@elychkouski](https://forums.swift.org/u/elychkouski)\
**Post date:** [August 25, 2025, 8:40pm UTC](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319/39 "2025-08-25T20:40:47Z")

</div>

Looks like we need to implement it ourselves if we really want it =\

[Previous page](https://forums.swift.org/t/allow-property-wrappers-with-multiple-arguments-to-defer-initialization-when-wrappedvalue-is-not-specified/38319.md?page=1)
