I'm not sure if this is possible I have looked around, checked online and finally posting this question here what I'm trying to do is,
I have 3 sections in UITableView but third section only appears if my data model is updated
enum Section: Int {
case title, accounts, pending, total
}
in my numberOfSections I currently have,
return (pendingDataModel != nil) ? 3 : 2
is it possible to handle this in computed property of enum? like based on the above condition adding and hiding the case pending
so that I can only use Section.total.rawValue
to get my section's count?
Edit: I have found this answer but this isn't what I want Adding a case to an existing enum with a protocol