swiftwatchkitwkinterfacetable

swift - populating WKInterfaceTable


following this tutorial... here

for (index, labelText) in stringData.enumerate() {
        let row = myTable.rowControllerAtIndex(index) 
        as! MyRowController
        row.myLabel.setText(labelText)

getting an error message that says:

Value of type '[String]' has no member 'enumerate'

is there a Swift code update change?


Solution

  • That's a really old tutorial, the function you're looking for is called enumerated now.

    for (index, labelText) in stringData.enumerated() {
        ...
    }