# Question about chapter 18 first ios and swiftUI app

**URL:** <https://forums.kodeco.com/t/question-about-chapter-18-first-ios-and-swiftui-app/202791>\
**Category:** Swift\
**Tags:** ios\
**Created:** [March 5, 2024, 1:38am UTC](https://forums.kodeco.com/t/question-about-chapter-18-first-ios-and-swiftui-app/202791 "2024-03-05T01:38:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ionisme](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@ionisme](https://forums.kodeco.com/u/ionisme)\
**Post date:** [March 5, 2024, 1:38am UTC](https://forums.kodeco.com/t/question-about-chapter-18-first-ios-and-swiftui-app/202791/1 "2024-03-05T01:38:50Z")

</div>

@State private var game: Game = Game()

what is the Game before the = sign needed?

---

<div class="post-metadata">

**Author:** ![szymczyk](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/szymczyk/32/105896_2.png) [@szymczyk](https://forums.kodeco.com/u/szymczyk)\
**Post date:** [March 5, 2024, 9:20pm UTC](https://forums.kodeco.com/t/question-about-chapter-18-first-ios-and-swiftui-app/202791/2 "2024-03-05T21:20:34Z")

</div>

In your example you don’t need to specify the type for `game` because you call `Game()` to assign its value. You could declare `game` as the following:

```auto
@State private var game = Game()

```

While you don’t have to specify the data type for `game`, specifying the type for variables makes it very clear what the data type is for each variable.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [August 18, 2024, 5:39pm UTC](https://forums.kodeco.com/t/question-about-chapter-18-first-ios-and-swiftui-app/202791/3 "2024-08-18T17:39:02Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
