DALabeledCircularProgressView.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // DALabeledCircularProgressView.m
  3. // DACircularProgressExample
  4. //
  5. // Created by Josh Sklar on 4/8/14.
  6. // Copyright (c) 2014 Shout Messenger. All rights reserved.
  7. //
  8. #import "DALabeledCircularProgressView.h"
  9. @implementation DALabeledCircularProgressView
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. [self initializeLabel];
  15. }
  16. return self;
  17. }
  18. - (id)initWithCoder:(NSCoder *)aDecoder
  19. {
  20. self = [super initWithCoder:aDecoder];
  21. if (self) {
  22. [self initializeLabel];
  23. }
  24. return self;
  25. }
  26. #pragma mark - Internal methods
  27. /**
  28. Creates and initializes
  29. -[DALabeledCircularProgressView progressLabel].
  30. */
  31. - (void)initializeLabel
  32. {
  33. self.progressLabel = [[UILabel alloc] initWithFrame:self.bounds];
  34. self.progressLabel.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
  35. self.progressLabel.textAlignment = NSTextAlignmentCenter;
  36. self.progressLabel.backgroundColor = [UIColor clearColor];
  37. [self addSubview:self.progressLabel];
  38. }
  39. @end