if let position = selected.index(of: item)if let position = selected.index(of: item)Oi Raphael, tudo bem?
Tem como você postar o resto do código do seu ViewController pra gente dar uma olhada?
Abs.
import UIKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
    // Pegando conteudo do textdield
    @IBOutlet var nameField : UITextField?
    @IBOutlet var felicidadeField : UITextField?
    var delegate : AddMealDelegate?
    var selected = Array<Item>()
    var items = [Item(name: "Lasanha", calories: 10.0),
                 Item(name: "Brownie", calories: 5.0),
                 Item(name: "chocolate", calories: 7.0),
                 Item(name: "Tomate", calories: 1.0),
                 Item(name: "Sanduiche", calories: 50.0)
                ]
    // selecionando e deselecionando os itens da cedula
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if let cell = tableView.cellForRow(at: indexPath){
            if (cell.accessoryType == UITableViewCellAccessoryType.none){
                cell.accessoryType = UITableViewCellAccessoryType.checkmark
                let item = items[indexPath.row]
                selected.append(item)
                } else {
                        cell.accessoryType = UITableViewCellAccessoryType.none
                        let item = items[indexPath.row]
                if let position = selected.index(of: item) {
                        selected.remove(at: position)
                }
        }
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return items.count
    }
    // formatando a cedula do main storyboard 
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let row = indexPath.row
        let item = items[row]
        let cell = UITableViewCell(style: UITableViewCellStyle.default , reuseIdentifier: nil)
        cell.textLabel!.text = item.name
        return cell
    }
   // Criando a função do buttom
    @IBAction func add(){
        if(nameField == nil || felicidadeField == nil){
            return
        }
        let name:String = nameField!.text!
        if let hapiness = Int(felicidadeField!.text!){
            let meal = Meal(name: name, hapiness: hapiness, items : selected)
        print("comi \(meal.name) e fiquei com felicidade \(meal.hapiness) e \(meal.items) !")
            if(delegate == nil){
                return
            }
            delegate!.add(meal)
            if let navigation = navigationController {
                navigation.popViewController(animated: true)
            }
        }
    }
}Raphael, tudo bem?
Você pode obter a posição de um elemento no array comparando algum atributo. Nesse caso por exemplo pelo nome da refeição:
if let position = selected.index(where: { $0.name == item.name }) {
    selected.remove(at: position)
}Abs.
Boa tarde, obrigado pela resposta !
No caso preciso remover o checkmark do item da cédula caso ele esteja marcado ,irei precisar refazer esse código para todas as posições do Array?
Oi Raphael,
Na verdade esse where é justamente para percorrer todo array (selected) e verificar qual refeição tem o mesmo nome da que você selecionou na TableView.
Assim que o método encontrar, ele entra no if e remove o objeto do array.
Caso tenha ficado alguma dúvida, pode mandar.
Abs.