Permalink
Browse files

Add -initWithCoder: to SSIndicatorLabel

  • Loading branch information...
1 parent ff2b88b commit cbea69e73ca0430d8b54a05fd56ae9c127db2a57 @aaronbrethorst aaronbrethorst committed Dec 4, 2011
View
@@ -11,6 +11,7 @@
@interface SSIndicatorLabel (PrivateMethods)
+ (CGSize)indicatorSize;
+ (CGFloat)padding;
+- (void)configureView;
@end
@implementation SSIndicatorLabel
@@ -59,21 +60,31 @@ - (void)dealloc {
- (id)initWithFrame:(CGRect)rect {
if ((self = [super initWithFrame:rect])) {
- self.clipsToBounds = YES;
-
- _textLabel = [[UILabel alloc] initWithFrame:CGRectZero];
- [self addSubview:_textLabel];
-
- _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectZero];
- [_activityIndicatorView startAnimating];
- [self addSubview:_activityIndicatorView];
-
- _loading = NO;
- [self layoutSubviews];
+ [self configureView];
}
return self;
}
+- (id)initWithCoder:(NSCoder *)aDecoder {
+ if ((self = [super initWithCoder:aDecoder])) {
+ [self configureView];
+ }
+ return self;
+}
+
+- (void)configureView {
+ self.clipsToBounds = YES;
+
+ _textLabel = [[UILabel alloc] initWithFrame:CGRectZero];
+ [self addSubview:_textLabel];
+
+ _activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectZero];
+ [_activityIndicatorView startAnimating];
+ [self addSubview:_activityIndicatorView];
+
+ _loading = NO;
+ [self layoutSubviews];
+}
- (void)layoutSubviews {
CGRect rect = self.frame;

0 comments on commit cbea69e

Please sign in to comment.