Skip to content

Commit

Permalink
Fix errors in demo projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
WenchaoD committed Oct 8, 2018
1 parent 76796f0 commit 252736f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Example-Objc/FSCalendar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
30A495521DCAD9E6000B2F31 /* FSCalendarWeekdayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarWeekdayView.h; sourceTree = "<group>"; };
30A495531DCAD9E6000B2F31 /* FSCalendarWeekdayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarWeekdayView.m; sourceTree = "<group>"; };
30B0BABF1B8D8E22004B9476 /* FSCalendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendar.h; sourceTree = "<group>"; };
30B0BAC01B8D8E22004B9476 /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FSCalendar.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
30B0BAC01B8D8E22004B9476 /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FSCalendar.m; sourceTree = "<group>"; };
30B0BAC11B8D8E22004B9476 /* FSCalendarAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarAppearance.h; sourceTree = "<group>"; };
30B0BAC21B8D8E22004B9476 /* FSCalendarAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarAppearance.m; sourceTree = "<group>"; };
30B0BAC31B8D8E22004B9476 /* FSCalendarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = FSCalendarCell.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
Expand Down
12 changes: 0 additions & 12 deletions Example-Swift/FSCalendarSwiftExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
303478391DB520C8007BBD2E /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 303478381DB520C8007BBD2E /* TableViewController.swift */; };
305282C91E1608A100CC2877 /* FSCalendarScopeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 305282C81E1608A100CC2877 /* FSCalendarScopeViewController.swift */; };
30D458E91DB4E2DB00B163C7 /* LoadViewExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30D458E81DB4E2DB00B163C7 /* LoadViewExampleViewController.swift */; };
30F4C9391E07C3AD00D2EC4D /* FSCalendar+Deprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C9181E07C3AD00D2EC4D /* FSCalendar+Deprecated.m */; };
30F4C93A1E07C3AD00D2EC4D /* FSCalendar.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C91A1E07C3AD00D2EC4D /* FSCalendar.m */; };
30F4C93C1E07C3AD00D2EC4D /* FSCalendarAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C91E1E07C3AD00D2EC4D /* FSCalendarAppearance.m */; };
30F4C93D1E07C3AD00D2EC4D /* FSCalendarCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C9201E07C3AD00D2EC4D /* FSCalendarCalculator.m */; };
Expand All @@ -25,10 +24,8 @@
30F4C9431E07C3AD00D2EC4D /* FSCalendarDelegationProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C92C1E07C3AD00D2EC4D /* FSCalendarDelegationProxy.m */; };
30F4C9441E07C3AD00D2EC4D /* FSCalendarExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C92F1E07C3AD00D2EC4D /* FSCalendarExtensions.m */; };
30F4C9451E07C3AD00D2EC4D /* FSCalendarHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C9311E07C3AD00D2EC4D /* FSCalendarHeaderView.m */; };
30F4C9461E07C3AD00D2EC4D /* FSCalendarScopeHandle.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C9331E07C3AD00D2EC4D /* FSCalendarScopeHandle.m */; };
30F4C9471E07C3AD00D2EC4D /* FSCalendarStickyHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C9351E07C3AD00D2EC4D /* FSCalendarStickyHeader.m */; };
30F4C9481E07C3AD00D2EC4D /* FSCalendarWeekdayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F4C9371E07C3AD00D2EC4D /* FSCalendarWeekdayView.m */; };
30F4C9491E07C3AD00D2EC4D /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 30F4C9381E07C3AD00D2EC4D /* Info.plist */; };
EE0954AD1B97DDE0007F6964 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0954AC1B97DDE0007F6964 /* AppDelegate.swift */; };
EE0954AF1B97DDE0007F6964 /* InterfaceBuilderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0954AE1B97DDE0007F6964 /* InterfaceBuilderViewController.swift */; };
EE0954B21B97DDE0007F6964 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EE0954B01B97DDE0007F6964 /* Main.storyboard */; };
Expand Down Expand Up @@ -58,7 +55,6 @@
303478381DB520C8007BBD2E /* TableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = "<group>"; };
305282C81E1608A100CC2877 /* FSCalendarScopeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FSCalendarScopeViewController.swift; sourceTree = "<group>"; };
30D458E81DB4E2DB00B163C7 /* LoadViewExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadViewExampleViewController.swift; sourceTree = "<group>"; };
30F4C9181E07C3AD00D2EC4D /* FSCalendar+Deprecated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FSCalendar+Deprecated.m"; sourceTree = "<group>"; };
30F4C9191E07C3AD00D2EC4D /* FSCalendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendar.h; sourceTree = "<group>"; };
30F4C91A1E07C3AD00D2EC4D /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendar.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
30F4C91D1E07C3AD00D2EC4D /* FSCalendarAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarAppearance.h; sourceTree = "<group>"; };
Expand All @@ -82,8 +78,6 @@
30F4C92F1E07C3AD00D2EC4D /* FSCalendarExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarExtensions.m; sourceTree = "<group>"; };
30F4C9301E07C3AD00D2EC4D /* FSCalendarHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarHeaderView.h; sourceTree = "<group>"; };
30F4C9311E07C3AD00D2EC4D /* FSCalendarHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarHeaderView.m; sourceTree = "<group>"; };
30F4C9321E07C3AD00D2EC4D /* FSCalendarScopeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarScopeHandle.h; sourceTree = "<group>"; };
30F4C9331E07C3AD00D2EC4D /* FSCalendarScopeHandle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarScopeHandle.m; sourceTree = "<group>"; };
30F4C9341E07C3AD00D2EC4D /* FSCalendarStickyHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarStickyHeader.h; sourceTree = "<group>"; };
30F4C9351E07C3AD00D2EC4D /* FSCalendarStickyHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarStickyHeader.m; sourceTree = "<group>"; };
30F4C9361E07C3AD00D2EC4D /* FSCalendarWeekdayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarWeekdayView.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -140,8 +134,6 @@
30F4C9261E07C3AD00D2EC4D /* FSCalendarCollectionViewLayout.m */,
30F4C9301E07C3AD00D2EC4D /* FSCalendarHeaderView.h */,
30F4C9311E07C3AD00D2EC4D /* FSCalendarHeaderView.m */,
30F4C9321E07C3AD00D2EC4D /* FSCalendarScopeHandle.h */,
30F4C9331E07C3AD00D2EC4D /* FSCalendarScopeHandle.m */,
30F4C9341E07C3AD00D2EC4D /* FSCalendarStickyHeader.h */,
30F4C9351E07C3AD00D2EC4D /* FSCalendarStickyHeader.m */,
30F4C9361E07C3AD00D2EC4D /* FSCalendarWeekdayView.h */,
Expand All @@ -159,7 +151,6 @@
30F4C92D1E07C3AD00D2EC4D /* FSCalendarDynamicHeader.h */,
30F4C92E1E07C3AD00D2EC4D /* FSCalendarExtensions.h */,
30F4C92F1E07C3AD00D2EC4D /* FSCalendarExtensions.m */,
30F4C9181E07C3AD00D2EC4D /* FSCalendar+Deprecated.m */,
30F4C9381E07C3AD00D2EC4D /* Info.plist */,
);
name = FSCalendar;
Expand Down Expand Up @@ -311,7 +302,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
30F4C9491E07C3AD00D2EC4D /* Info.plist in Resources */,
EE0954B21B97DDE0007F6964 /* Main.storyboard in Resources */,
EE0954B71B97DDE0007F6964 /* LaunchScreen.xib in Resources */,
EE0954B41B97DDE0007F6964 /* Images.xcassets in Resources */,
Expand Down Expand Up @@ -341,7 +331,6 @@
30F4C93F1E07C3AD00D2EC4D /* FSCalendarCollectionView.m in Sources */,
F953947A1F26BF07005B83E5 /* LunarFormatter.swift in Sources */,
30F4C9471E07C3AD00D2EC4D /* FSCalendarStickyHeader.m in Sources */,
30F4C9461E07C3AD00D2EC4D /* FSCalendarScopeHandle.m in Sources */,
30F4C9451E07C3AD00D2EC4D /* FSCalendarHeaderView.m in Sources */,
303478391DB520C8007BBD2E /* TableViewController.swift in Sources */,
F916F3911E1E57DD00F01811 /* FSCalendarTransitionCoordinator.m in Sources */,
Expand All @@ -354,7 +343,6 @@
30F4C93E1E07C3AD00D2EC4D /* FSCalendarCell.m in Sources */,
30D458E91DB4E2DB00B163C7 /* LoadViewExampleViewController.swift in Sources */,
30031AAA1DCEA83200FC34FE /* DIYCalendarCell.swift in Sources */,
30F4C9391E07C3AD00D2EC4D /* FSCalendar+Deprecated.m in Sources */,
EE0954AD1B97DDE0007F6964 /* AppDelegate.swift in Sources */,
EE0954AF1B97DDE0007F6964 /* InterfaceBuilderViewController.swift in Sources */,
30F4C9421E07C3AD00D2EC4D /* FSCalendarDelegationFactory.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
300036ED1D9252CB00C795DE /* FSCalendar+Deprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036CD1D9252CB00C795DE /* FSCalendar+Deprecated.m */; };
300036EF1D9252CB00C795DE /* FSCalendar.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036D11D9252CB00C795DE /* FSCalendar.m */; };
300036F11D9252CB00C795DE /* FSCalendarAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036D51D9252CB00C795DE /* FSCalendarAppearance.m */; };
300036F21D9252CB00C795DE /* FSCalendarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036D71D9252CB00C795DE /* FSCalendarCell.m */; };
300036F31D9252CB00C795DE /* FSCalendarCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036D91D9252CB00C795DE /* FSCalendarCollectionView.m */; };
300036F81D9252CB00C795DE /* FSCalendarScopeHandle.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036E41D9252CB00C795DE /* FSCalendarScopeHandle.m */; };
300036F91D9252CB00C795DE /* FSCalendarStickyHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 300036E61D9252CB00C795DE /* FSCalendarStickyHeader.m */; };
300036FA1D9252CB00C795DE /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 300036E71D9252CB00C795DE /* Info.plist */; };
3055B1CE1DA933D0002AFA13 /* FSCalendarExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3055B1CD1DA933D0002AFA13 /* FSCalendarExtensions.m */; };
30623F6D1DC1F45600FA31B3 /* FSCalendarCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 30623F6C1DC1F45600FA31B3 /* FSCalendarCollectionViewLayout.m */; };
3091756F1D7EBD4100BBEB79 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3091756E1D7EBD4100BBEB79 /* main.m */; };
Expand Down Expand Up @@ -62,7 +59,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
300036CD1D9252CB00C795DE /* FSCalendar+Deprecated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "FSCalendar+Deprecated.m"; sourceTree = "<group>"; };
300036D01D9252CB00C795DE /* FSCalendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendar.h; sourceTree = "<group>"; };
300036D11D9252CB00C795DE /* FSCalendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendar.m; sourceTree = "<group>"; };
300036D41D9252CB00C795DE /* FSCalendarAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarAppearance.h; sourceTree = "<group>"; };
Expand All @@ -72,8 +68,6 @@
300036D81D9252CB00C795DE /* FSCalendarCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarCollectionView.h; sourceTree = "<group>"; };
300036D91D9252CB00C795DE /* FSCalendarCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarCollectionView.m; sourceTree = "<group>"; };
300036DC1D9252CB00C795DE /* FSCalendarDynamicHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarDynamicHeader.h; sourceTree = "<group>"; };
300036E31D9252CB00C795DE /* FSCalendarScopeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarScopeHandle.h; sourceTree = "<group>"; };
300036E41D9252CB00C795DE /* FSCalendarScopeHandle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarScopeHandle.m; sourceTree = "<group>"; };
300036E51D9252CB00C795DE /* FSCalendarStickyHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSCalendarStickyHeader.h; sourceTree = "<group>"; };
300036E61D9252CB00C795DE /* FSCalendarStickyHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSCalendarStickyHeader.m; sourceTree = "<group>"; };
300036E71D9252CB00C795DE /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -151,8 +145,6 @@
30A07C061DCAF7FD0071F025 /* FSCalendarHeaderView.m */,
30F10DCD1DCAECF5008B41E3 /* FSCalendarWeekdayView.h */,
30F10DCE1DCAECF5008B41E3 /* FSCalendarWeekdayView.m */,
300036E31D9252CB00C795DE /* FSCalendarScopeHandle.h */,
300036E41D9252CB00C795DE /* FSCalendarScopeHandle.m */,
300036E51D9252CB00C795DE /* FSCalendarStickyHeader.h */,
300036E61D9252CB00C795DE /* FSCalendarStickyHeader.m */,
30F4C94A1E07C3DF00D2EC4D /* FSCalendarDelegationFactory.h */,
Expand All @@ -167,7 +159,6 @@
30A33A0D1DB1CA8D0039BEA3 /* FSCalendarConstants.m */,
3055B1CC1DA933D0002AFA13 /* FSCalendarExtensions.h */,
3055B1CD1DA933D0002AFA13 /* FSCalendarExtensions.m */,
300036CD1D9252CB00C795DE /* FSCalendar+Deprecated.m */,
300036E71D9252CB00C795DE /* Info.plist */,
);
name = FSCalendar;
Expand Down Expand Up @@ -331,7 +322,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
300036FA1D9252CB00C795DE /* Info.plist in Resources */,
30EDD2961D98C93B009D6CA3 /* Image.xcassets in Resources */,
309175AE1D7EBD6100BBEB79 /* MainInterface.storyboard in Resources */,
);
Expand All @@ -357,11 +347,9 @@
300036F91D9252CB00C795DE /* FSCalendarStickyHeader.m in Sources */,
30A33A0E1DB1CA8D0039BEA3 /* FSCalendarConstants.m in Sources */,
30623F6D1DC1F45600FA31B3 /* FSCalendarCollectionViewLayout.m in Sources */,
300036ED1D9252CB00C795DE /* FSCalendar+Deprecated.m in Sources */,
F916F3941E1E583900F01811 /* FSCalendarTransitionCoordinator.m in Sources */,
300036F31D9252CB00C795DE /* FSCalendarCollectionView.m in Sources */,
3055B1CE1DA933D0002AFA13 /* FSCalendarExtensions.m in Sources */,
300036F81D9252CB00C795DE /* FSCalendarScopeHandle.m in Sources */,
30F10DCF1DCAECF5008B41E3 /* FSCalendarWeekdayView.m in Sources */,
309175AB1D7EBD6100BBEB79 /* TodayViewController.m in Sources */,
30948A8D1DC78AE200DA02C9 /* FSCalendarCalculator.m in Sources */,
Expand Down
17 changes: 16 additions & 1 deletion Example-TodayExtension1/TodayExtension/TodayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ - (void)widgetActiveDisplayModeDidChange:(NCWidgetDisplayMode)activeDisplayMode
self.prevButton.hidden = YES;
self.nextButton.hidden = YES;
}
self.preferredContentSize = CGSizeMake(320, self.calendarHeight.constant);
}

- (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler
Expand All @@ -78,7 +79,6 @@ - (UIEdgeInsets)widgetMarginInsetsForProposedMarginInsets:(UIEdgeInsets)defaultM
- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated
{
self.calendarHeight.constant = CGRectGetHeight(bounds);
self.preferredContentSize = CGSizeMake(320, self.calendarHeight.constant);
[self.view layoutIfNeeded];
}

Expand Down Expand Up @@ -110,4 +110,19 @@ - (void)calendar:(FSCalendar *)calendar didSelectDate:(NSDate *)date atMonthPosi
}
}

- (IBAction)prevClicked:(id)sender
{
NSCalendarUnit unit = (self.calendar.scope==FSCalendarScopeMonth) ? NSCalendarUnitMonth : NSCalendarUnitWeekOfYear;
NSDate *prevPage = [self.gregorian dateByAddingUnit:unit value:-1 toDate:self.calendar.currentPage options:0];
[self.calendar setCurrentPage:prevPage animated:YES];

}

- (IBAction)nextClicked:(id)sender
{
NSCalendarUnit unit = (self.calendar.scope==FSCalendarScopeMonth) ? NSCalendarUnitMonth : NSCalendarUnitWeekOfYear;
NSDate *nextPage = [self.gregorian dateByAddingUnit:unit value:1 toDate:self.calendar.currentPage options:0];
[self.calendar setCurrentPage:nextPage animated:YES];
}

@end
Loading

0 comments on commit 252736f

Please sign in to comment.