Let's say we got a super class named BaseViewController
, in whose .h
file defined a enum as the following.
typedef NS_ENUM(NSUInteger, SectionType) {
SectionTypeUserName,
SectionTypeUserAddress,
...
SectionTypeUserPets
}
This enum is the type of the section in a table view.
Now, I got another view controller named ASubViewController
which is inherited from BaseViewController
.
Because the section type now is a little bit different like the below, how to insert a new element at the head of if.
typedef NS_ENUM(NSUInteger, SectionType) { SectionTypeUserTitle, // Just insert this line SectionTypeUserName, SectionTypeUserAddress, ... SectionTypeUserPets }
Because nothing of the rest code need any modification. The defualt setting is enough.
So how to implement it?