Skip to content

Commit

Permalink
Bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
WenchaoD committed May 24, 2017
1 parent 2cb596e commit 26ee038
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FSCalendar.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "FSCalendar"
s.version = "2.7.7"
s.version = "2.7.8"
s.summary = "A superiorly awesome iOS7+ calendar control, compatible with Objective-C and Swift."

s.homepage = "https://github.com/WenchaoD/FSCalendar"
Expand Down
5 changes: 2 additions & 3 deletions FSCalendar/FSCalendar.m
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ - (void)prepareForInterfaceBuilder
NSDateComponents *components = [self.gregorian components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:date];
components.day = _appearance.fakedSelectedDay?:1;
[_selectedDates addObject:[self.gregorian dateFromComponents:components]];
[self reloadVisibleCells];
[self.collectionView reloadData];
}
#endif

Expand Down Expand Up @@ -808,7 +808,6 @@ - (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identi
if ([identifier isEqualToString:FSCalendarBlankCellReuseIdentifier]) {
[NSException raise:FSCalendarInvalidArgumentsExceptionName format:@"Do not use %@ as the cell reuse identifier.", identifier];
}
[self.collectionView registerClass:nil forCellWithReuseIdentifier:FSCalendarDefaultCellReuseIdentifier];
[self.collectionView registerClass:cellClass forCellWithReuseIdentifier:identifier];

}
Expand Down Expand Up @@ -1075,7 +1074,7 @@ - (void)setDelegate:(id<FSCalendarDelegate>)delegate
- (void)reloadData
{
_needsRequestingBoundingDates = YES;
if ([self requestBoundingDatesIfNecessary]) {
if ([self requestBoundingDatesIfNecessary] || !self.collectionView.indexPathsForVisibleItems.count) {
[self invalidateHeaders];
[self.collectionView reloadData];
} else {
Expand Down
4 changes: 0 additions & 4 deletions FSCalendar/FSCalendarHeaderView.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ - (void)setScrollOffset:(CGFloat)scrollOffset animated:(BOOL)animated

- (void)scrollToOffset:(CGFloat)scrollOffset animated:(BOOL)animated
{
if (CGSizeEqualToSize(self.collectionView.contentSize, CGSizeZero)) {
_needsAdjustingMonthPosition = YES;
return;
}
if (self.scrollDirection == UICollectionViewScrollDirectionHorizontal) {
CGFloat step = self.collectionView.fs_width*((self.scrollDirection==UICollectionViewScrollDirectionHorizontal)?0.5:1);
[_collectionView setContentOffset:CGPointMake((scrollOffset+0.5)*step, 0) animated:animated];
Expand Down
2 changes: 1 addition & 1 deletion FSCalendar/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.7.7</string>
<string>2.7.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 26ee038

Please sign in to comment.