Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes local variable shadow warnings when warning -Wshadow is enabled. #337

Merged
merged 1 commit into from
Jun 21, 2016
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions FSCalendar/FSCalendar.m
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
[stickyHeader setNeedsLayout];
NSArray *allKeys = [_stickyHeaderMapTable.dictionaryRepresentation allKeysForObject:stickyHeader];
if (allKeys.count) {
[allKeys enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
[_stickyHeaderMapTable removeObjectForKey:indexPath];
[allKeys enumerateObjectsUsingBlock:^(NSIndexPath *itemIndexPath, NSUInteger idx, BOOL *stop) {
[_stickyHeaderMapTable removeObjectForKey:itemIndexPath];
}];
}
[_stickyHeaderMapTable setObject:stickyHeader forKey:indexPath];
Expand Down
24 changes: 12 additions & 12 deletions FSCalendar/FSCalendarAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,16 @@ - (FSCalendarTransitionAttributes *)transitionAttributes
NSDate *focusedDate = self.calendar.selectedDate;

if (focusedDate) {
UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]];
CGPoint focuedCenter = attributes.center;
UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]];
CGPoint focuedCenter = itemAttributes.center;
if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) {
switch (self.collectionViewLayout.scrollDirection) {
case UICollectionViewScrollDirectionHorizontal: {
focusedRowNumber = attributes.indexPath.item%6;
focusedRowNumber = itemAttributes.indexPath.item%6;
break;
}
case UICollectionViewScrollDirectionVertical: {
focusedRowNumber = attributes.indexPath.item/7;
focusedRowNumber = itemAttributes.indexPath.item/7;
break;
}
}
Expand All @@ -374,16 +374,16 @@ - (FSCalendarTransitionAttributes *)transitionAttributes
if (!focusedDate) {
focusedDate = self.calendar.today;
if (focusedDate) {
UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]];
CGPoint focuedCenter = attributes.center;
UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]];
CGPoint focuedCenter = itemAttributes.center;
if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) {
switch (self.collectionViewLayout.scrollDirection) {
case UICollectionViewScrollDirectionHorizontal: {
focusedRowNumber = attributes.indexPath.item%6;
focusedRowNumber = itemAttributes.indexPath.item%6;
break;
}
case UICollectionViewScrollDirectionVertical: {
focusedRowNumber = attributes.indexPath.item/7;
focusedRowNumber = itemAttributes.indexPath.item/7;
break;
}
}
Expand Down Expand Up @@ -418,8 +418,8 @@ - (FSCalendarTransitionAttributes *)transitionAttributes
if (self.calendar.focusOnSingleSelectedDate) {
NSDate *focusedDate = self.calendar.selectedDate;
if (focusedDate) {
UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]];
CGPoint focuedCenter = attributes.center;
UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]];
CGPoint focuedCenter = itemAttributes.center;
if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) {
firstDayOfMonth = [self.calendar beginingOfMonthOfDate:focusedDate];
} else {
Expand All @@ -429,8 +429,8 @@ - (FSCalendarTransitionAttributes *)transitionAttributes
if (!focusedDate) {
focusedDate = self.calendar.today;
if (focusedDate) {
UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]];
CGPoint focuedCenter = attributes.center;
UICollectionViewLayoutAttributes *itemAttributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]];
CGPoint focuedCenter = itemAttributes.center;
if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) {
firstDayOfMonth = [self.calendar beginingOfMonthOfDate:focusedDate];
}
Expand Down
12 changes: 6 additions & 6 deletions FSCalendar/FSCalendarCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ - (void)configureCell
_shapeLayer.path = path;
}

CGColorRef fillColor = self.colorForCellFill.CGColor;
if (!CGColorEqualToColor(_shapeLayer.fillColor, fillColor)) {
_shapeLayer.fillColor = fillColor;
CGColorRef cellFillColor = self.colorForCellFill.CGColor;
if (!CGColorEqualToColor(_shapeLayer.fillColor, cellFillColor)) {
_shapeLayer.fillColor = cellFillColor;
}

CGColorRef borderColor = self.colorForCellBorder.CGColor;
if (!CGColorEqualToColor(_shapeLayer.strokeColor, borderColor)) {
_shapeLayer.strokeColor = borderColor;
CGColorRef cellBorderColor = self.colorForCellBorder.CGColor;
if (!CGColorEqualToColor(_shapeLayer.strokeColor, cellBorderColor)) {
_shapeLayer.strokeColor = cellBorderColor;
}

}
Expand Down
14 changes: 7 additions & 7 deletions FSCalendar/FSCalendarEventIndicator.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ - (void)layoutSublayersOfLayer:(CALayer *)layer
_needsAdjustingViewFrame = NO;
CGFloat diameter = MIN(MIN(self.fs_width, self.fs_height),FSCalendarMaximumEventDotDiameter);
for (int i = 0; i < self.eventLayers.count; i++) {
CALayer *layer = self.eventLayers[i];
layer.hidden = i >= self.numberOfEvents;
if (!layer.hidden) {
layer.frame = CGRectMake(2*i*diameter, (self.fs_height-diameter)*0.5, diameter, diameter);
layer.cornerRadius = diameter * 0.5;
CALayer *eventLayer = self.eventLayers[i];
eventLayer.hidden = i >= self.numberOfEvents;
if (!eventLayer.hidden) {
eventLayer.frame = CGRectMake(2*i*diameter, (self.fs_height-diameter)*0.5, diameter, diameter);
eventLayer.cornerRadius = diameter * 0.5;
}
}
}
Expand All @@ -89,9 +89,9 @@ - (void)layoutSublayersOfLayer:(CALayer *)layer
if (i < colors.count) {
lastColor = colors[i];
}
CALayer *layer = self.eventLayers[i];
CALayer *eventLayer = self.eventLayers[i];
UIImage *dotImage = [self dotImageWithColor:lastColor diameter:diameter];
layer.contents = (id)dotImage.CGImage;
eventLayer.contents = (id)dotImage.CGImage;
}
}
}
Expand Down