Use .background(Color.yellow) to place yellow behind everything.
Step 2: Create blue overlay with 50% opacity
Use Rectangle().fill(Color.blue.opacity(0.5)) as overlay base.
Step 3: Add red border around blue overlay
Use .overlay(Rectangle().stroke(Color.red, lineWidth: 2)) on the blue rectangle to add border.
Final Answer:
Layers blue fill with red border as overlay on yellow background. -> Option A
Quick Check:
Background yellow, overlay blue with red border = Text("Label")
.background(Color.yellow)
.overlay(Rectangle().fill(Color.blue.opacity(0.5)).overlay(Rectangle().stroke(Color.red, lineWidth: 2))) [OK]
Quick Trick:Use nested overlays for border on colored overlays [OK]
Common Mistakes:
Applying border inside fill incorrectly
Using .background inside overlay incorrectly
Not layering border on top of fill
Master "SwiftUI Layout" in iOS Swift
9 interactive learning modes - each teaches the same concept differently