diff --git a/FSCalendar.podspec b/FSCalendar.podspec index 529df734..1f33dc49 100644 --- a/FSCalendar.podspec +++ b/FSCalendar.podspec @@ -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" diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index 2d706e8d..8e967b88 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -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 @@ -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]; } @@ -1075,7 +1074,7 @@ - (void)setDelegate:(id)delegate - (void)reloadData { _needsRequestingBoundingDates = YES; - if ([self requestBoundingDatesIfNecessary]) { + if ([self requestBoundingDatesIfNecessary] || !self.collectionView.indexPathsForVisibleItems.count) { [self invalidateHeaders]; [self.collectionView reloadData]; } else { diff --git a/FSCalendar/FSCalendarHeaderView.m b/FSCalendar/FSCalendarHeaderView.m index 0abe8409..d7c386bf 100644 --- a/FSCalendar/FSCalendarHeaderView.m +++ b/FSCalendar/FSCalendarHeaderView.m @@ -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]; diff --git a/FSCalendar/Info.plist b/FSCalendar/Info.plist index 53e18c22..d69045c7 100644 --- a/FSCalendar/Info.plist +++ b/FSCalendar/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.7.7 + 2.7.8 CFBundleSignature ???? CFBundleVersion