Browse Questions
  • LLDB is the debugger built into Xcode.
  • All three separate concerns between data, UI, and logic — but they differ in how the middle layer connects to the view.
  • VStack renders all its children immediately.
  • SPM is Apple's built-in dependency manager for Swift.

Answer: VStack renders all its children immediately. LazyVStack only renders views as they become visible on screen — essential for large lists.

Code Example:

// VStack — all 1000 rows created immediately
ScrollView {
    VStack {
        ForEach(0..<1000) { i in
            ExpensiveRow(index: i)  // all 1000 created at once ❌
        }
    }
}

// LazyVStack — only visible rows created
ScrollView {
    LazyVStack {
        ForEach(0..<1000) { i in
            ExpensiveRow(index: i)  // only ~20 visible rows created ✅
        }
    }
}

Rule of thumb:

  • Use VStack for small fixed lists (under ~50 items)
  • Use LazyVStack inside ScrollView for dynamic or large data sets
  • List uses lazy loading automatically