Browse Questions
  • Use .onTapGesture for standard taps, and .onSimultaneousGesture when you need two gestures to fire together without one cancelling the other.
  • CI/CD automates building, testing, and distributing your app on every code push.
  • VStack renders all its children immediately.
  • Secure Message is a stateless asymmetric primitive that encrypts or signs a single payload using your private key and the peer's public key, making it a natural fit for request/response APIs.

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