diff --git a/Example/Base.lproj/Main_iPhone.storyboard b/Example/Base.lproj/Main_iPhone.storyboard index c14d478a..a903a2ff 100644 --- a/Example/Base.lproj/Main_iPhone.storyboard +++ b/Example/Base.lproj/Main_iPhone.storyboard @@ -267,9 +267,8 @@ - + - @@ -395,7 +394,6 @@ - diff --git a/Example/LoadViewExampleViewController.m b/Example/LoadViewExampleViewController.m index 569df3ee..db9fd4ca 100644 --- a/Example/LoadViewExampleViewController.m +++ b/Example/LoadViewExampleViewController.m @@ -50,13 +50,14 @@ - (void)viewDidLoad [super viewDidLoad]; [self.calendar selectDate:[self.calendar tomorrowOfDate:[NSDate date]]]; - + /* dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.calendar setScope:FSCalendarScopeWeek animated:YES]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.calendar setScope:FSCalendarScopeMonth animated:YES]; }); }); + */ } diff --git a/FSCalendar.podspec b/FSCalendar.podspec index 8828de27..d8c8c8b0 100644 --- a/FSCalendar.podspec +++ b/FSCalendar.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "FSCalendar" - s.version = "2.0.0.beta" + s.version = "2.0.0" s.summary = "Designed to build the best iOS calendar control." s.homepage = "https://github.com/WenchaoD/FSCalendar" diff --git a/FSCalendar/FSCalendar+IBExtension.h b/FSCalendar/FSCalendar+IBExtension.h index 26c5e0a1..f3b4101b 100644 --- a/FSCalendar/FSCalendar+IBExtension.h +++ b/FSCalendar/FSCalendar+IBExtension.h @@ -11,8 +11,6 @@ #import "FSCalendar.h" #import "FSCalendarConstance.h" -#if TARGET_INTERFACE_BUILDER - IB_DESIGNABLE @interface FSCalendar (IBExtension) @@ -51,10 +49,11 @@ IB_DESIGNABLE @property (assign, nonatomic) IBInspectable FSCalendarCellShape cellShape; @property (assign, nonatomic) IBInspectable BOOL useVeryShortWeekdaySymbols; -// For IB Preview. Not actually affect. +#if TARGET_INTERFACE_BUILDER + @property (assign, nonatomic) IBInspectable BOOL fakeSubtitles; @property (assign, nonatomic) IBInspectable NSInteger fakedSelectedDay; -@end - #endif + +@end diff --git a/FSCalendar/FSCalendar+IBExtension.m b/FSCalendar/FSCalendar+IBExtension.m index 14d6a918..ce6699b5 100644 --- a/FSCalendar/FSCalendar+IBExtension.m +++ b/FSCalendar/FSCalendar+IBExtension.m @@ -8,8 +8,6 @@ #import "FSCalendar+IBExtension.h" -#if TARGET_INTERFACE_BUILDER - @implementation FSCalendar (IBExtension) #pragma mark - adjustsFontSizeToFitContentSize @@ -294,6 +292,8 @@ - (BOOL)useVeryShortWeekdaySymbols #pragma GCC diagnostic pop } +#if TARGET_INTERFACE_BUILDER + #pragma mark - fakeSubtitles - (void)setFakeSubtitles:(BOOL)fakeSubtitles @@ -318,6 +318,8 @@ - (NSInteger)fakedSelectedDay return self.appearance.fakedSelectedDay; } +#endif + #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -365,5 +367,3 @@ - (CGFloat)headerTitleTextSize #pragma GCC diagnostic pop @end - -#endif diff --git a/FSCalendar/FSCalendar.m b/FSCalendar/FSCalendar.m index b3d64b60..bf003e5b 100644 --- a/FSCalendar/FSCalendar.m +++ b/FSCalendar/FSCalendar.m @@ -385,11 +385,13 @@ - (void)layoutSublayersOfLayer:(CALayer *)layer } } +#if TARGET_INTERFACE_BUILDER - (void)prepareForInterfaceBuilder { NSDate *date = [NSDate date]; [self selectDate:[self dateWithYear:[self yearOfDate:date] month:[self monthOfDate:date] day:_appearance.fakedSelectedDay?:1]]; } +#endif - (CGSize)sizeThatFits:(CGSize)size { @@ -980,6 +982,9 @@ - (CGFloat)preferredRowHeight CGFloat weekdayHeight = self.preferredWeekdayHeight; CGFloat contentHeight = self.fs_height-headerHeight-weekdayHeight; CGFloat padding = weekdayHeight*0.1; + if (self.collectionViewLayout.scrollDirection == UICollectionViewScrollDirectionHorizontal) { + padding = FSCalendarFloor(padding); + } if (!self.floatingMode) { switch (_scope) { case FSCalendarScopeMonth: { diff --git a/FSCalendar/FSCalendarAnimator.m b/FSCalendar/FSCalendarAnimator.m index 38cfbca0..04fe1171 100644 --- a/FSCalendar/FSCalendarAnimator.m +++ b/FSCalendar/FSCalendarAnimator.m @@ -258,13 +258,13 @@ - (void)performScopeTransitionFromScope:(FSCalendarScope)fromScope toScope:(FSCa self.calendar.daysContainer.clipsToBounds = YES; if (animated) { - - CGFloat duration = 0.3; // Perform alpha animation + CGFloat duration = 0.3; CABasicAnimation *opacity = [CABasicAnimation animationWithKeyPath:@"opacity"]; opacity.duration = duration; opacity.fromValue = @0; opacity.toValue = @1; + opacity.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; [self.collectionView.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger idx, BOOL *stop) { if (CGRectContainsPoint(self.collectionView.bounds, cell.center)) { BOOL shouldPerformAlpha = NO; diff --git a/FSCalendar/FSCalendarAppearance.h b/FSCalendar/FSCalendarAppearance.h index 65aac69a..9cfaa21a 100644 --- a/FSCalendar/FSCalendarAppearance.h +++ b/FSCalendar/FSCalendarAppearance.h @@ -74,10 +74,14 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) { @property (assign, nonatomic) FSCalendarCaseOptions caseOptions; @property (assign, nonatomic) BOOL adjustsFontSizeToFitContentSize; +#if TARGET_INTERFACE_BUILDER + // For preview only @property (assign, nonatomic) BOOL fakeSubtitles; @property (assign, nonatomic) NSInteger fakedSelectedDay; +#endif + - (void)invalidateAppearance; @end diff --git a/FSCalendar/Info.plist b/FSCalendar/Info.plist index cfdee347..7e7479f0 100644 --- a/FSCalendar/Info.plist +++ b/FSCalendar/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.0.beta + 2.0.0 CFBundleSignature ???? CFBundleVersion