When to use enums inside classes [on hold]
up vote
-1
down vote
favorite
I have a code that looks like this:
class PermissionsManager {
static let shared = PermissionsManager()
public enum PermissionType {
case contacts
case calendar
}
}
This got me thinking, while syntactically this is allowed, when are the times you would want to nest an enum inside a class? Is it a good practice in this instance?
object-oriented swift enum
put on hold as off-topic by VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-1
down vote
favorite
I have a code that looks like this:
class PermissionsManager {
static let shared = PermissionsManager()
public enum PermissionType {
case contacts
case calendar
}
}
This got me thinking, while syntactically this is allowed, when are the times you would want to nest an enum inside a class? Is it a good practice in this instance?
object-oriented swift enum
put on hold as off-topic by VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a code that looks like this:
class PermissionsManager {
static let shared = PermissionsManager()
public enum PermissionType {
case contacts
case calendar
}
}
This got me thinking, while syntactically this is allowed, when are the times you would want to nest an enum inside a class? Is it a good practice in this instance?
object-oriented swift enum
I have a code that looks like this:
class PermissionsManager {
static let shared = PermissionsManager()
public enum PermissionType {
case contacts
case calendar
}
}
This got me thinking, while syntactically this is allowed, when are the times you would want to nest an enum inside a class? Is it a good practice in this instance?
object-oriented swift enum
object-oriented swift enum
asked 2 days ago
avismara
1376
1376
put on hold as off-topic by VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger 2 days ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." – VisualMelon, BCdotWEB, Martin R, t3chb0t, Mathias Ettinger
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes