2626
2727
2828@interface MBProgressHUD () {
29- // Depricated
29+ // Deprecated
3030 UIColor *_activityIndicatorColor;
3131 CGFloat _opacity;
3232}
@@ -142,7 +142,7 @@ - (void)showAnimated:(BOOL)animated {
142142 [self .minShowTimer invalidate ];
143143 self.useAnimation = animated;
144144 self.finished = NO ;
145- // If the grace time is set postpone the HUD display
145+ // If the grace time is set, postpone the HUD display
146146 if (self.graceTime > 0.0 ) {
147147 NSTimer *timer = [NSTimer timerWithTimeInterval: self .graceTime target: self selector: @selector (handleGraceTimer: ) userInfo: nil repeats: NO ];
148148 [[NSRunLoop currentRunLoop ] addTimer: timer forMode: NSRunLoopCommonModes ];
@@ -159,8 +159,8 @@ - (void)hideAnimated:(BOOL)animated {
159159 [self .graceTimer invalidate ];
160160 self.useAnimation = animated;
161161 self.finished = YES ;
162- // If the minShow time is set, calculate how long the hud was shown,
163- // and pospone the hiding operation if necessary
162+ // If the minShow time is set, calculate how long the HUD was shown,
163+ // and postpone the hiding operation if necessary
164164 if (self.minShowTime > 0.0 && self.showStarted ) {
165165 NSTimeInterval interv = [[NSDate date ] timeIntervalSinceDate: self .showStarted];
166166 if (interv < self.minShowTime ) {
@@ -242,7 +242,7 @@ - (void)hideUsingAnimation:(BOOL)animated {
242242}
243243
244244- (void )animateIn : (BOOL )animatingIn withType : (MBProgressHUDAnimation)type completion : (void (^)(BOOL finished))completion {
245- // Automatically determine the correct
245+ // Automatically determine the correct zoom animation type
246246 if (type == MBProgressHUDAnimationZoom) {
247247 type = animatingIn ? MBProgressHUDAnimationZoomIn : MBProgressHUDAnimationZoomOut;
248248 }
@@ -501,7 +501,7 @@ - (void)updateConstraints {
501501 NSMutableArray *subviews = [NSMutableArray arrayWithObjects: self .topSpacer, self .label, self .detailsLabel, self .button, self .bottomSpacer, nil ];
502502 if (self.indicator ) [subviews insertObject: self .indicator atIndex: 1 ];
503503
504- // Remove existing constraintes
504+ // Remove existing constraints
505505 [self removeConstraints: self .constraints];
506506 [topSpacer removeConstraints: topSpacer.constraints];
507507 [bottomSpacer removeConstraints: bottomSpacer.constraints];
@@ -560,7 +560,7 @@ - (void)updateConstraints {
560560 // First, ensure spacing to bezel edge
561561 [bezelConstraints addObject: [NSLayoutConstraint constraintWithItem: view attribute: NSLayoutAttributeTop relatedBy: NSLayoutRelationEqual toItem: bezel attribute: NSLayoutAttributeTop multiplier: 1 .f constant: 0 .f]];
562562 } else if (idx == subviews.count - 1 ) {
563- // Last, ensure spacigin to bezel edge
563+ // Last, ensure spacing to bezel edge
564564 [bezelConstraints addObject: [NSLayoutConstraint constraintWithItem: view attribute: NSLayoutAttributeBottom relatedBy: NSLayoutRelationEqual toItem: bezel attribute: NSLayoutAttributeBottom multiplier: 1 .f constant: 0 .f]];
565565 }
566566 if (idx > 0 ) {
@@ -593,8 +593,8 @@ - (void)updatePaddingConstraints {
593593 UIView *secondView = (UIView *)padding.secondItem ;
594594 BOOL firstVisible = !firstView.hidden && !CGSizeEqualToSize (firstView.intrinsicContentSize , CGSizeZero);
595595 BOOL secondVisible = !secondView.hidden && !CGSizeEqualToSize (secondView.intrinsicContentSize , CGSizeZero);
596- // Set if both views are visible of if there's a visible view on top that yet doesn't have padding
597- // added relative to the current view
596+ // Set if both views are visible or if there's a visible view on top that doesn't have padding
597+ // added relative to the current view yet
598598 padding.constant = (firstVisible && (secondVisible || hasVisibleAncestors)) ? MBDefaultPadding : 0 .f ;
599599 hasVisibleAncestors |= secondVisible;
600600 }];
@@ -1362,16 +1362,16 @@ - (instancetype)initWithFrame:(CGRect)frame {
13621362
13631363- (void )layoutSubviews {
13641364 [super layoutSubviews ];
1365- // Fully rounded corners.
1365+ // Fully rounded corners
13661366 CGFloat height = CGRectGetHeight (self.bounds );
13671367 self.layer .cornerRadius = ceil (height / 2 .f );
13681368}
13691369
13701370- (CGSize)intrinsicContentSize {
1371- // Only show, if we have associated control events.
1371+ // Only show if we have associated control events
13721372 if (self.allControlEvents == 0 ) return CGSizeZero;
13731373 CGSize size = [super intrinsicContentSize ];
1374- // Add some side padding.
1374+ // Add some side padding
13751375 size.width += 20 .f ;
13761376 return size;
13771377}
@@ -1380,7 +1380,7 @@ - (CGSize)intrinsicContentSize {
13801380
13811381- (void )setTitleColor : (UIColor *)color forState : (UIControlState)state {
13821382 [super setTitleColor: color forState: state];
1383- // Update related colors.
1383+ // Update related colors
13841384 [self setHighlighted: self .highlighted];
13851385 self.layer .borderColor = color.CGColor ;
13861386}
0 commit comments