I have two enum's for the table. In the 1st, I list the headings for the first section, in the 2nd, I list the icons for the first section. How can I combine them into one enum
enum cellSectionOne:Int, CaseIterable
{
case cellOne
case cellTwo
var titleCellSectionOne:String
{
switch self {
case .cellOne:
return "cellOne"
case .cellTwo:
return "cellTwo"
}
}
}
enum cellIconSectionOne:Int, CaseIterable {
case cellOneIcon
case cellTwoIcon
var icon: UIImage {
switch self {
case .cellOneIcon:
return UIImage(named: "iconOne.png")!
case .cellTwoIcon:
return UIImage(named: "iconTwo.png")!
}
}
}