iOS Tutorial Error

Hi, I'm new to Swift and Xcode and have just started following the Apple iOS tutorial (Tutorial link). I get an error in the first lesson to do with the ProgressView:

initializer 'init(value:total:)' requires that 'Int' conform to 'BinaryFloatingPoint'

Here is the code:

import SwiftUI

struct MeetingView: View {

    var body: some View {

        VStack {

            ProgressView(value: 5, total: 15)

            HStack {

                Text("Seconds Elapsed")

            }

        }

    }

}



struct MeetingView_Previews: PreviewProvider {

    static var previews: some View {

        MeetingView()

    }

}```

Thanks for your help in advance.
Answered by Claude31 in 678299022

Replace with:

ProgressView(value: 5.0, total: 15)

Doing so, value is a Float, which pleases the compiler.

Accepted Answer

Replace with:

ProgressView(value: 5.0, total: 15)

Doing so, value is a Float, which pleases the compiler.

iOS Tutorial Error
 
 
Q