NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

Is there an update for this .frame(maxWidth: .infinity)?

Forums > SwiftUI

Is there an update for this .frame(maxWidth: .infinity)?

Please see error message below, for it did not show on Tutorial. The item in question, is that I will have use for .frame(maxWidth: infinity) late on this week. Why am I getting a alert for this (

struct ContentView: View {
    var body: some View {
        ScrollView(.vertical) {
            VStack(spacing: 10) {
                ForEach(0..<100) {
                    Text("item \($0)")
            .frame(maxWidth: .infinity) 
            // ????SwiftUI: Invalid frame dimension (negative or non-finite).


Hacking with Swift is sponsored by Fernando Olivares

SPONSORED Ever ask for help and your reviewer immediately notices issues you missed? Fernando Olivares is a 10-year veteran from Big Nerd Ranch and Lambda School who can help hone your app building skills, and he's just launched a new book that does just that – use the code "hacking" to save $5!

Buy the book

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

Not logged in

Log in

Link copied to your pasteboard.