# What changed about initialising instance variables?

**URL:** <https://forums.swift.org/t/what-changed-about-initialising-instance-variables/73765>\
**Category:** Using Swift\
**Tags:** init\
**Created:** [August 7, 2024, 1:07pm UTC](https://forums.swift.org/t/what-changed-about-initialising-instance-variables/73765 "2024-08-07T13:07:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![eskimo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/eskimo/32/13558_2.png) [@eskimo](https://forums.swift.org/u/eskimo)\
**Post date:** [August 8, 2024, 8:47am UTC](https://forums.swift.org/t/what-changed-about-initialising-instance-variables/73765/2 "2024-08-08T08:47:27Z")

</div>

Which version of Xcode 16 beta is this? And are you in Swift 6 language mode?

I tried replicating your problem with Xcode 16.0b5 and I saw two different results:

- In Swift 5 mode the code compiled just fine.

- In Swift 6 mode I got a concurrency error which I think makes sense [1].

My code is below.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

[1] It’s centred on whether `init()` is main-actor-isolated or not. Indeed, it’s exactly [this issue](https://forums.swift.org/t/unexpected-error-with-implementing-init-in-a-subclass/73776).

* * *

```swift
import UIKit

@MainActor
class Repository {
    static let shared = Repository()
}

class SelectorController: UITableViewController {
    
    private let repository = Repository.shared
    
    init() {
        super.init(style: .grouped)
    }
    
    required init?(coder: NSCoder) {
        fatalError()
    }
}

```

---

_[View the full topic](https://forums.swift.org/t/what-changed-about-initialising-instance-variables/73765)._
