# \#initialisation

**URL:** https://forums.swift.org/tag/initialisation/1085.md

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

---

## [Variadic initializers can't be default initializers?](https://forums.swift.org/t/variadic-initializers-cant-be-default-initializers/86686)

<div class="topic-metadata">

**Author:** [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Replies:** 3\
**Last updated:** [May 13, 2026, 11:09pm UTC](https://forums.swift.org/t/variadic-initializers-cant-be-default-initializers/86686 "2026-05-13T23:09:46Z")

</div>

Here's my code: extension MyType: SetAlgebra { //... public init\<each S: StringProtocol\>(\_ string: repeat each S) { var result = \[String\]() for s in repeat each string { result.append(s.decomposedStri…

---

## [An optional initializer was treated as definitive?!](https://forums.swift.org/t/an-optional-initializer-was-treated-as-definitive/85058)

<div class="topic-metadata">

**Author:** [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Replies:** 0\
**Last updated:** [March 1, 2026, 12:17am UTC](https://forums.swift.org/t/an-optional-initializer-was-treated-as-definitive/85058 "2026-03-01T00:17:01Z")

</div>

May be related to this old post. This is from my testing code: // Invalid should fail // // Replacing the second "initializer" with "NameToken" will make // "digitStarter" to be \`NameToken\` \_instead\_ of \`NameToken?\`, //…

---

## [Preview for struct with custom codable initializer](https://forums.swift.org/t/preview-for-struct-with-custom-codable-initializer/79200)

<div class="topic-metadata">

**Author:** [@danusrasmus](https://forums.swift.org/u/danusrasmus)\
**Replies:** 3\
**Last updated:** [April 10, 2025, 7:20pm UTC](https://forums.swift.org/t/preview-for-struct-with-custom-codable-initializer/79200 "2025-04-10T19:20:57Z")

</div>

I need to create a valid preview for UserView, which means I need to parse in an single User, which struct looks like this: struct User: Codable, Hashable { var id: UUID var isActive: Bool var name: String …

---

## [Arrays and Initialisation: Bug or "feature"? (and some interesting array trickery!)](https://forums.swift.org/t/arrays-and-initialisation-bug-or-feature-and-some-interesting-array-trickery/77644)

<div class="topic-metadata">

**Author:** [@geotech](https://forums.swift.org/u/geotech)\
**Replies:** 6\
**Last updated:** [February 4, 2025, 12:09pm UTC](https://forums.swift.org/t/arrays-and-initialisation-bug-or-feature-and-some-interesting-array-trickery/77644 "2025-02-04T12:09:21Z")

</div>

So is this a bug or feature or I am not understanding the rules! I create a variable: @State public var thisSite: bores The error I get when I create a variable is: Return from initializer without initializing all stor…
