1
resposta

Inserindo a tabela no projeto

Quando vou em identify and type e adiciono MealsTableViewController ele não reconhece. Retorna : Editor placeholder in source file

import UIKit

class MealsTableViewController : UITableViewController {

    var meals = [Meal(name: "Salada", happiness: 2),
                 Meal(name: "Sopa", happiness: 5)]

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return meals.count
    }

    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let row = indexPath.row
        let meal = meals[row]
        let cell = UITableViewCell(style: <#T##UITableViewCellStyle#>, reuseIdentifier: nil)
        cell.textLabel!.text = meal.name
    }

}
1 resposta

Viktor,

no Identify and Type, no campo Name você deve colocar MealsTableViewController.swift e não apenas MealsTableViewController.

é necessária a identificação do tipo .swift no nome.

Ve se isso resolve, por gentileza.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software