Skip to content

Problem when initializing LITabControl #8

@renfeisong

Description

@renfeisong

Hi Mark,

LITabControl's design is great, especially the idea that including the actual item into each segment. But when I was testing LITabControl, I found that in order for it to initialize properly, the super's -initWithFrame: has to be called. However, when being initialized from the storyboard, -initWithCoder is called instead of the -initWithFrame. As a result, the control won't work.

As a temporary solution, I added the -initWithCoder method like below:

- (instancetype)initWithCoder:(NSCoder *)coder {
    if (self = [super initWithCoder:coder]) {
        self = [super initWithFrame:self.frame];
        [self configureSubviews];
    }

    return self;
}

The code above looks really odd, but it seems to solve the problem for now. Any new ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions