enumPasta: CaseIterable{ case conchiglie, fusilli, linguine, tagliatelle var name: String { switchself { case .conchiglie: return"Conchiglie" case .fusilli: return"Fusilli" case .linguine: return"Linguine" case .tagliatelle: return"Tagliatelle" } } var shape: String { switchself { case .conchiglie: return"Shells" case .fusilli: return"Twists" case .linguine: return"Long and skinny" case .tagliatelle: return"Long ribbons" } } var image: UIImage { switchself { case .conchiglie: returnUIImage(named: "conchiglie")! case .fusilli: returnUIImage(named: "fusilli")! case .linguine: returnUIImage(named: "linguine")! case .tagliatelle: returnUIImage(named: "tagliatelle")! } } }
// Generate data for the table view var objectsForTableView: [Pasta] = Pasta.allcases ...