Your First iOS App: Data Flow in SwiftUI

Jun 25 2026 · Swift 6, iOS 26, Xcode 26

Lesson 07: Create a Model

Create a Model

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

OK, let’s learn how we can put the theory of App Architecture into practice, by creating a simple data model for Bullseye.

struct Game {

}
struct Game {
  var target: Int = 37
}
  var score: Int = 0
  var round: Int = 1
@State private var game: Game = Game()
Text(String(game.target))
func points(sliderValue: Int) -> Int {
  return 999
}
Text(
  """
  The slider's value is \(roundedValue).
  You scored \(game.points(sliderValue: roundedValue)) points this round.
  """
)
See forum comments
Cinema mode Download course materials from Github
Previous: Intro to App Architecture Next: Conclusion