i know that the extension is for to extend types for which you do not have access to the original source code but some developers use extension in a class that themselves make it .
sorry for my english :(
example :
class Category: Mappable {
var PostCategoryId: Int?
var Name: String?
private(set) var Slug: String?
private(set) var PostCategoryParentId: Int?
private(set) var PostCategoryParentPath: String?
var childCategories: [Category]?
var parentCategory: Category?
init() {
}
}
extension Category {
enum CategoryId: Int {
case Comedy = 4
case Action = 6
case Animation = 10
}
}