Your First iOS App: Data Flow in SwiftUI

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

Lesson 05: Variables

Variables

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

In order to understand how to convert a decimal value to a whole number, you need to understand how variables and data types work in Swift.

var roundedValue: Int = Int(sliderValue)
  message: Text("The slider's value is \(sliderValue), rounded Value is \(roundedValue).")
var roundedValue: Int = Int(sliderValue.rounded())
message: Text("The slider's value is \(roundedValue)."),
See forum comments
Cinema mode Download course materials from Github
Previous: Strings Next: Intro to App Architecture