Quantcast
Channel: Active questions tagged uipickerview - Stack Overflow
Viewing all articles
Browse latest Browse all 592

Anonymous closure arguments cannot be used inside a closure that has explicit arguments

$
0
0

So I'm trying to create a Picker in SwiftUI that uses every item of an array. Xcode says "Anonymous closure arguments cannot be used inside a closure that has explicit arguments" when I try to let it use the item of the array (as visible in the code)

import SwiftUIstruct TimerPicker: View {    @State var selectedTime = 0    let availableMinutes = Array(1 ... 59)    private let pickerStyle = SegmentedPickerStyle()    var body: some View {        VStack {            Picker(selection: $selectedTime, label: Text("")) {                ForEach(0 ..< availableMinutes.count) {_ in                    Text("\(self.availableMinutes[$0]) min")                }            }            .labelsHidden()        }    }

Thanks in advance for every answer.


Viewing all articles
Browse latest Browse all 592

Trending Articles