# Chapter 6 Dependency Injection not working

**URL:** <https://forums.kodeco.com/t/chapter-6-dependency-injection-not-working/132592>\
**Category:** SwiftUI by Tutorials\
**Created:** [February 12, 2021, 9:22pm UTC](https://forums.kodeco.com/t/chapter-6-dependency-injection-not-working/132592 "2021-02-12T21:22:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marvmax](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/marvmax/32/107222_2.png) [@marvmax](https://forums.kodeco.com/u/marvmax)\
**Post date:** [February 12, 2021, 9:22pm UTC](https://forums.kodeco.com/t/chapter-6-dependency-injection-not-working/132592/1 "2021-02-12T21:22:03Z")

</div>

I’m getting an error on the init injection dependency. Here’s the code in having problem with  
**init** (keyboardHandler: KeyboardFollower) {  
**self**.keyboardhandler = keyboardhandler  
}  
And the error is  
‘self’ used before all stored properties are initialized  
There is a red underline under the equal sign.

---

<div class="post-metadata">

**Author:** ![marvmax](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/marvmax/32/107222_2.png) [@marvmax](https://forums.kodeco.com/u/marvmax)\
**Post date:** [February 12, 2021, 9:26pm UTC](https://forums.kodeco.com/t/chapter-6-dependency-injection-not-working/132592/2 "2021-02-12T21:26:40Z")

</div>

Oh. I guess I should say that this is in Chapter 6

---

<div class="post-metadata">

**Author:** ![cgoodyear](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/cgoodyear/32/106524_2.png) [@cgoodyear](https://forums.kodeco.com/u/cgoodyear)\
**Post date:** [February 17, 2021, 8:23pm UTC](https://forums.kodeco.com/t/chapter-6-dependency-injection-not-working/132592/3 "2021-02-17T20:23:35Z")

</div>

Is keyboardhandler supposed to be the same as keyboardHandler?

---

<div class="post-metadata">

**Author:** ![jeden](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jeden/32/110971_2.png) [@jeden](https://forums.kodeco.com/u/jeden)\
**Post date:** [March 21, 2021, 4:07pm UTC](https://forums.kodeco.com/t/chapter-6-dependency-injection-not-working/132592/4 "2021-03-21T16:07:45Z")

</div>

Hi @marvmax,

sorry for replying so late - it looks you’re referencing variables that don’t exist, it should be:

```auto
init(keyboardHandler: KeyboardFollower) {
    self.keyboardHandler = keyboardHandler
}

```

Note the camel case format of the variable names, with the 2nd word in uppercase. Please let me know if that fixes your issue.
