im following a tutorial and im making a lock screen that has 4 digits. each digit when entered fills in a circle. there are four circles. right now im at the part where im coding the circles are white until my passcode count is greater than my index. from what im gathering, this newer version doesent like “>” symbol.
the full error messege is as follows
"Type ‘(UnsafePointer?, Int32) → UnsafeMutablePointer?’ (aka ‘(Optional<UnsafePointer>, Int32) → Optional<UnsafeMutablePointer>’) cannot conform to ‘BinaryInteger’ "
is there any way around this?
here is the full code as follows
import SwiftUI
struct PasscodeIndicatorView: View {
@Binding var passcode: String
var body: some View {
HStack(spacing: 32) {
ForEach(0 ..< 4) { Index in
Circle()
.fill(passcode.count > index ? .primary : Color(.white))
.frame(width: 20, height:20)
.overlay {
Circle()
.stroke(.black, lineWidth: 1.0)
}
}
}
}
}
#Preview {
PasscodeIndicatorView(passcode: .constant(“”))
}
Update: I figured it out. appearntly xcode wanted me to capitalize the i in index. im leaving this here incase anyone else runs into this