Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion DACircularProgress/DALabeledCircularProgressView.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@

@implementation DALabeledCircularProgressView

- (UILabel *)progressLabel
{
if (_progressLabel == nil) {
_progressLabel = [[UILabel alloc] init];
[self addSubview:_progressLabel];
}
return _progressLabel;
}

- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
Expand All @@ -28,6 +37,11 @@ - (id)initWithCoder:(NSCoder *)aDecoder
return self;
}

- (void)setFrame:(CGRect)frame
{
[super setFrame:frame];
[self initializeLabel];
}

#pragma mark - Internal methods

Expand All @@ -37,7 +51,7 @@ - (id)initWithCoder:(NSCoder *)aDecoder
*/
- (void)initializeLabel
{
self.progressLabel = [[UILabel alloc] initWithFrame:self.bounds];
self.progressLabel.frame = self.bounds;
self.progressLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
self.progressLabel.textAlignment = NSTextAlignmentCenter;
self.progressLabel.backgroundColor = [UIColor clearColor];
Expand Down