I am using Enum in swift I am looking to pass dynamic value, but not sure how to achieve it ?
I want to pass dynamic value in .revisit
case
Here is my code example: –
enum MyEnum: String, CaseIterable {
case revision
case revisit
var getDescription: String {
switch self {
case .revision:
return "Do revision"
case .revisit:
return "You answered 3 Out Of 3 Questions re-start ?" // How to pass dynamic value instead of 3 & 3
}
}
}
By using CaseIterable
I am using it on UITableViewCell
& want to change data of revisit dynamically
2
Answers
Try this:
Better way make pass dynamic value in enum