diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..02b9aef Binary files /dev/null and b/.DS_Store differ diff --git a/BaseLibrary/BaseLibrary.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist b/BaseLibrary/BaseLibrary.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist index 576fb51..bc9f858 100644 --- a/BaseLibrary/BaseLibrary.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/BaseLibrary/BaseLibrary.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,12 @@ BaseLibrary.xcscheme orderHint - 0 + 6 + + BaseLibrary.xcscheme_^#shared#^_ + + orderHint + 6 diff --git a/Verdnaturaventas/.DS_Store b/Verdnaturaventas/.DS_Store new file mode 100644 index 0000000..f1ecbb7 Binary files /dev/null and b/Verdnaturaventas/.DS_Store differ diff --git a/Verdnaturaventas/Podfile b/Verdnaturaventas/Podfile index c367ba8..dbe368c 100644 --- a/Verdnaturaventas/Podfile +++ b/Verdnaturaventas/Podfile @@ -2,5 +2,8 @@ use_frameworks! platform :ios, '8.0' pod 'FSCalendar' +target "Verdnaturaventas" do + pod 'Firebase/Core' +end diff --git a/Verdnaturaventas/Podfile.lock b/Verdnaturaventas/Podfile.lock index 135149a..f5592ed 100644 --- a/Verdnaturaventas/Podfile.lock +++ b/Verdnaturaventas/Podfile.lock @@ -1,10 +1,51 @@ PODS: - - FSCalendar (2.0.1) + - Firebase/Core (5.3.0): + - Firebase/CoreOnly + - FirebaseAnalytics (= 5.0.1) + - Firebase/CoreOnly (5.3.0): + - FirebaseCore (= 5.0.4) + - FirebaseAnalytics (5.0.1): + - FirebaseCore (~> 5.0) + - FirebaseInstanceID (~> 3.0) + - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" + - nanopb (~> 0.3) + - FirebaseCore (5.0.4): + - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" + - FirebaseInstanceID (3.1.1): + - FirebaseCore (~> 5.0) + - FSCalendar (2.7.9) + - GoogleToolboxForMac/Defines (2.1.4) + - "GoogleToolboxForMac/NSData+zlib (2.1.4)": + - GoogleToolboxForMac/Defines (= 2.1.4) + - nanopb (0.3.8): + - nanopb/decode (= 0.3.8) + - nanopb/encode (= 0.3.8) + - nanopb/decode (0.3.8) + - nanopb/encode (0.3.8) DEPENDENCIES: + - Firebase/Core - FSCalendar -SPEC CHECKSUMS: - FSCalendar: 18117308f5876a8f6f0fe572085d543580c2c5e5 +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Firebase + - FirebaseAnalytics + - FirebaseCore + - FirebaseInstanceID + - FSCalendar + - GoogleToolboxForMac + - nanopb -COCOAPODS: 0.39.0 +SPEC CHECKSUMS: + Firebase: 68afeeb05461db02d7c9e3215cda28068670f4aa + FirebaseAnalytics: b3628aea54c50464c32c393fb2ea032566e7ecc2 + FirebaseCore: 62f1b792a49bb9e8b4073f24606d2c93ffc352f0 + FirebaseInstanceID: f3f0657372592ecdfdfe2cac604a5a75758376a6 + FSCalendar: a04b09f16f811bc92e82f3cf852a15225233b9d5 + GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f + nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3 + +PODFILE CHECKSUM: 0645cd0766eb63ba97b1572c6e02dd27818977f2 + +COCOAPODS: 1.5.3 diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/CALayer+FSExtension.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/CALayer+FSExtension.h deleted file mode 100644 index d4063b3..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/CALayer+FSExtension.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// CALayer+FSExtension.h -// FSCalendar -// -// Created by dingwenchao on 2/3/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import - -@interface CALayer (FSExtension) - -@property (nonatomic) CGFloat fs_width; -@property (nonatomic) CGFloat fs_height; - -@property (nonatomic) CGFloat fs_top; -@property (nonatomic) CGFloat fs_left; -@property (nonatomic) CGFloat fs_bottom; -@property (nonatomic) CGFloat fs_right; - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/CALayer+FSExtension.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/CALayer+FSExtension.m deleted file mode 100644 index 9ed50a5..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/CALayer+FSExtension.m +++ /dev/null @@ -1,73 +0,0 @@ -// -// CALayer+FSExtension.m -// FSCalendar -// -// Created by dingwenchao on 2/3/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import "CALayer+FSExtension.h" - -@implementation CALayer (FSExtension) - -- (CGFloat)fs_width -{ - return CGRectGetWidth(self.frame); -} - -- (void)setFs_width:(CGFloat)fs_width -{ - self.frame = CGRectMake(self.fs_left, self.fs_top, fs_width, self.fs_height); -} - -- (CGFloat)fs_height -{ - return CGRectGetHeight(self.frame); -} - -- (void)setFs_height:(CGFloat)fs_height -{ - self.frame = CGRectMake(self.fs_left, self.fs_top, self.fs_width, fs_height); -} - -- (CGFloat)fs_top -{ - return CGRectGetMinY(self.frame); -} - -- (void)setFs_top:(CGFloat)fs_top -{ - self.frame = CGRectMake(self.fs_left, fs_top, self.fs_width, self.fs_height); -} - -- (CGFloat)fs_bottom -{ - return CGRectGetMaxY(self.frame); -} - -- (void)setFs_bottom:(CGFloat)fs_bottom -{ - self.fs_top = fs_bottom - self.fs_height; -} - -- (CGFloat)fs_left -{ - return CGRectGetMinX(self.frame); -} - -- (void)setFs_left:(CGFloat)fs_left -{ - self.frame = CGRectMake(fs_left, self.fs_top, self.fs_width, self.fs_height); -} - -- (CGFloat)fs_right -{ - return CGRectGetMaxX(self.frame); -} - -- (void)setFs_right:(CGFloat)fs_right -{ - self.fs_left = self.fs_right - self.fs_width; -} - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+Deprecated.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+Deprecated.m new file mode 100644 index 0000000..d699489 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+Deprecated.m @@ -0,0 +1,247 @@ +// +// FSCalendar+Deprecated.m +// FSCalendar +// +// Created by dingwenchao on 4/29/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendar.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarDynamicHeader.h" + +#pragma mark - Deprecate + +@implementation FSCalendar (Deprecated) + +@dynamic identifier, lineHeightMultiplier; + +- (void)setShowsPlaceholders:(BOOL)showsPlaceholders +{ + self.placeholderType = showsPlaceholders ? FSCalendarPlaceholderTypeFillSixRows : FSCalendarPlaceholderTypeNone; +} + +- (BOOL)showsPlaceholders +{ + return self.placeholderType == FSCalendarPlaceholderTypeFillSixRows; +} + +#pragma mark - Public methods + +- (NSInteger)yearOfDate:(NSDate *)date +{ + if (!date) return NSNotFound; + NSDateComponents *component = [self.gregorian components:NSCalendarUnitYear fromDate:date]; + return component.year; +} + +- (NSInteger)monthOfDate:(NSDate *)date +{ + if (!date) return NSNotFound; + NSDateComponents *component = [self.gregorian components:NSCalendarUnitMonth + fromDate:date]; + return component.month; +} + +- (NSInteger)dayOfDate:(NSDate *)date +{ + if (!date) return NSNotFound; + NSDateComponents *component = [self.gregorian components:NSCalendarUnitDay + fromDate:date]; + return component.day; +} + +- (NSInteger)weekdayOfDate:(NSDate *)date +{ + if (!date) return NSNotFound; + NSDateComponents *component = [self.gregorian components:NSCalendarUnitWeekday fromDate:date]; + return component.weekday; +} + +- (NSInteger)weekOfDate:(NSDate *)date +{ + if (!date) return NSNotFound; + NSDateComponents *component = [self.gregorian components:NSCalendarUnitWeekOfYear fromDate:date]; + return component.weekOfYear; +} + +- (NSDate *)dateByIgnoringTimeComponentsOfDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = [self.gregorian components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:date]; + return [self.gregorian dateFromComponents:components]; +} + +- (NSDate *)tomorrowOfDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = [self.gregorian components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; + components.day++; + components.hour = FSCalendarDefaultHourComponent; + return [self.gregorian dateFromComponents:components]; +} + +- (NSDate *)yesterdayOfDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = [self.gregorian components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; + components.day--; + components.hour = FSCalendarDefaultHourComponent; + return [self.gregorian dateFromComponents:components]; +} + +- (NSDate *)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day +{ + NSDateComponents *components = self.components; + components.year = year; + components.month = month; + components.day = day; + components.hour = FSCalendarDefaultHourComponent; + NSDate *date = [self.gregorian dateFromComponents:components]; + components.year = NSIntegerMax; + components.month = NSIntegerMax; + components.day = NSIntegerMax; + components.hour = NSIntegerMax; + return date; +} + +- (NSDate *)dateByAddingYears:(NSInteger)years toDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = self.components; + components.year = years; + NSDate *d = [self.gregorian dateByAddingComponents:components toDate:date options:0]; + components.year = NSIntegerMax; + return d; +} + +- (NSDate *)dateBySubstractingYears:(NSInteger)years fromDate:(NSDate *)date +{ + if (!date) return nil; + return [self dateByAddingYears:-years toDate:date]; +} + +- (NSDate *)dateByAddingMonths:(NSInteger)months toDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = self.components; + components.month = months; + NSDate *d = [self.gregorian dateByAddingComponents:components toDate:date options:0]; + components.month = NSIntegerMax; + return d; +} + +- (NSDate *)dateBySubstractingMonths:(NSInteger)months fromDate:(NSDate *)date +{ + return [self dateByAddingMonths:-months toDate:date]; +} + +- (NSDate *)dateByAddingWeeks:(NSInteger)weeks toDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = self.components; + components.weekOfYear = weeks; + NSDate *d = [self.gregorian dateByAddingComponents:components toDate:date options:0]; + components.weekOfYear = NSIntegerMax; + return d; +} + +- (NSDate *)dateBySubstractingWeeks:(NSInteger)weeks fromDate:(NSDate *)date +{ + return [self dateByAddingWeeks:-weeks toDate:date]; +} + +- (NSDate *)dateByAddingDays:(NSInteger)days toDate:(NSDate *)date +{ + if (!date) return nil; + NSDateComponents *components = self.components; + components.day = days; + NSDate *d = [self.gregorian dateByAddingComponents:components toDate:date options:0]; + components.day = NSIntegerMax; + return d; +} + +- (NSDate *)dateBySubstractingDays:(NSInteger)days fromDate:(NSDate *)date +{ + return [self dateByAddingDays:-days toDate:date]; +} + +- (NSInteger)yearsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate +{ + NSDateComponents *components = [self.gregorian components:NSCalendarUnitYear + fromDate:fromDate + toDate:toDate + options:0]; + return components.year; +} + +- (NSInteger)monthsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate +{ + NSDateComponents *components = [self.gregorian components:NSCalendarUnitMonth + fromDate:fromDate + toDate:toDate + options:0]; + return components.month; +} + +- (NSInteger)weeksFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate +{ + NSDateComponents *components = [self.gregorian components:NSCalendarUnitWeekOfYear + fromDate:fromDate + toDate:toDate + options:0]; + return components.weekOfYear; +} + +- (NSInteger)daysFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate +{ + NSDateComponents *components = [self.gregorian components:NSCalendarUnitDay + fromDate:fromDate + toDate:toDate + options:0]; + return components.day; +} + +- (BOOL)isDate:(NSDate *)date1 equalToDate:(NSDate *)date2 toCalendarUnit:(FSCalendarUnit)unit +{ + switch (unit) { + case FSCalendarUnitMonth: + return [self.gregorian isDate:date1 equalToDate:date2 toUnitGranularity:NSCalendarUnitMonth]; + case FSCalendarUnitWeekOfYear: + return [self.gregorian isDate:date1 equalToDate:date2 toUnitGranularity:NSCalendarUnitYear]; + case FSCalendarUnitDay: + return [self.gregorian isDate:date1 inSameDayAsDate:date2]; + } + return NO; +} + +- (BOOL)isDateInToday:(NSDate *)date +{ + return [self isDate:date equalToDate:[NSDate date] toCalendarUnit:FSCalendarUnitDay]; +} + +- (void)setIdentifier:(NSString *)identifier +{ + NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:identifier]; + [self setValue:gregorian forKey:@"gregorian"]; + [self fs_performSelector:NSSelectorFromString(@"invalidateDateTools") withObjects:nil, nil]; + + if ([[self valueForKey:@"hasValidateVisibleLayout"] boolValue]) { + [self reloadData]; + } + [self fs_setVariable:[self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:self.minimumDate options:0] forKey:@"_minimumDate"]; + [self fs_setVariable:[self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:self.currentPage options:0] forKey:@"_currentPage"]; + [self fs_performSelector:NSSelectorFromString(@"scrollToPageForDate:animated") withObjects:self.today, @NO, nil]; +} + +- (NSString *)identifier +{ + return self.gregorian.calendarIdentifier; +} + +- (void)setLineHeightMultiplier:(CGFloat)lineHeightMultiplier +{ + self.rowHeight = FSCalendarStandardRowHeight*MAX(1, FSCalendarDeviceIsIPad*1.5); +} + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+IBExtension.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+IBExtension.h deleted file mode 100644 index 9b18a9e..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+IBExtension.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// FSCalendar+IBExtension.h -// FSCalendar -// -// Created by Wenchao Ding on 8/14/15. -// Copyright © 2016 Wenchao Ding. All rights reserved. -// -// 注意: 这些方法仅仅为了在IB中使用,不建议直接调用。这些方法在calendar.appearance中使用。如: calendar.appearance.eventColor -// Warning: For IB usage only. Directly calling these methods is deprecated. Use calendar.appearance(FSCalendarAppearance) instead - -#import "FSCalendar.h" -#import "FSCalendarConstance.h" - -IB_DESIGNABLE -@interface FSCalendar (IBExtension) - -@property (assign, nonatomic) IBInspectable BOOL adjustsFontSizeToFitContentSize; -@property (assign, nonatomic) IBInspectable CGFloat titleTextSize; -@property (assign, nonatomic) IBInspectable CGFloat subtitleTextSize; -@property (assign, nonatomic) IBInspectable CGFloat weekdayTextSize; -@property (assign, nonatomic) IBInspectable CGFloat headerTitleTextSize; - -@property (strong, nonatomic) IBInspectable UIColor *eventColor; -@property (strong, nonatomic) IBInspectable UIColor *weekdayTextColor; - -@property (strong, nonatomic) IBInspectable UIColor *headerTitleColor; -@property (strong, nonatomic) IBInspectable NSString *headerDateFormat; -@property (assign, nonatomic) IBInspectable CGFloat headerMinimumDissolvedAlpha; - -@property (strong, nonatomic) IBInspectable UIColor *titleDefaultColor; -@property (strong, nonatomic) IBInspectable UIColor *titleSelectionColor; -@property (strong, nonatomic) IBInspectable UIColor *titleTodayColor; -@property (strong, nonatomic) IBInspectable UIColor *titlePlaceholderColor; -@property (strong, nonatomic) IBInspectable UIColor *titleWeekendColor; - -@property (strong, nonatomic) IBInspectable UIColor *subtitleDefaultColor; -@property (strong, nonatomic) IBInspectable UIColor *subtitleSelectionColor; -@property (strong, nonatomic) IBInspectable UIColor *subtitleTodayColor; -@property (strong, nonatomic) IBInspectable UIColor *subtitlePlaceholderColor; -@property (strong, nonatomic) IBInspectable UIColor *subtitleWeekendColor; - -@property (strong, nonatomic) IBInspectable UIColor *selectionColor; -@property (strong, nonatomic) IBInspectable UIColor *todayColor; -@property (strong, nonatomic) IBInspectable UIColor *todaySelectionColor; - -@property (strong, nonatomic) IBInspectable UIColor *borderDefaultColor; -@property (strong, nonatomic) IBInspectable UIColor *borderSelectionColor; - -@property (assign, nonatomic) IBInspectable FSCalendarCellShape cellShape; -@property (assign, nonatomic) IBInspectable BOOL useVeryShortWeekdaySymbols; - -@property (assign, nonatomic) IBInspectable BOOL fakeSubtitles; -@property (assign, nonatomic) IBInspectable NSInteger fakedSelectedDay; - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+IBExtension.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+IBExtension.m deleted file mode 100644 index 33bf403..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar+IBExtension.m +++ /dev/null @@ -1,378 +0,0 @@ -// -// FSCalendar+IBExtension.m -// FSCalendar -// -// Created by Wenchao Ding on 8/14/15. -// Copyright © 2016 Wenchao Ding. All rights reserved. -// - -#import "FSCalendar+IBExtension.h" - -@implementation FSCalendar (IBExtension) -#if !TARGET_INTERFACE_BUILDER -@dynamic fakedSelectedDay,fakeSubtitles; -#endif - -#pragma mark - adjustsFontSizeToFitContentSize - -- (void)setAdjustsFontSizeToFitContentSize:(BOOL)adjustsFontSizeToFitContentSize -{ - self.appearance.adjustsFontSizeToFitContentSize = adjustsFontSizeToFitContentSize; -} - -- (BOOL)adjustsFontSizeToFitContentSize -{ - return self.appearance.adjustsFontSizeToFitContentSize; -} - -#pragma mark - eventColor - -- (void)setEventColor:(UIColor *)eventColor -{ - self.appearance.eventColor = eventColor; -} - -- (UIColor *)eventColor -{ - return self.appearance.eventColor; -} - -#pragma mark - weekdayTextColor - -- (void)setWeekdayTextColor:(UIColor *)weekdayTextColor -{ - self.appearance.weekdayTextColor = weekdayTextColor; -} - -- (UIColor *)weekdayTextColor -{ - return self.appearance.weekdayTextColor; -} - -#pragma mark - headerTitleColor - -- (void)setHeaderTitleColor:(UIColor *)headerTitleColor -{ - self.appearance.headerTitleColor = headerTitleColor; -} - -- (UIColor *)headerTitleColor -{ - return self.appearance.headerTitleColor; -} - -#pragma mark - headerDateFormat - -- (void)setHeaderDateFormat:(NSString *)headerDateFormat -{ - self.appearance.headerDateFormat = headerDateFormat; -} - -- (NSString *)headerDateFormat -{ - return self.appearance.headerDateFormat; -} - -#pragma mark - headerMinimumDissolvedAlpha - -- (void)setHeaderMinimumDissolvedAlpha:(CGFloat)headerMinimumDissolvedAlpha -{ - self.appearance.headerMinimumDissolvedAlpha = headerMinimumDissolvedAlpha; -} - -- (CGFloat)headerMinimumDissolvedAlpha -{ - return self.appearance.headerMinimumDissolvedAlpha; -} - -#pragma mark - titleDefaultColor - -- (void)setTitleDefaultColor:(UIColor *)titleDefaultColor -{ - self.appearance.titleDefaultColor = titleDefaultColor; -} - -- (UIColor *)titleDefaultColor -{ - return self.appearance.titleDefaultColor; -} - -#pragma mark - titleSelectionColor - -- (void)setTitleSelectionColor:(UIColor *)titleSelectionColor -{ - self.appearance.titleSelectionColor = titleSelectionColor; -} - -- (UIColor *)titleSelectionColor -{ - return self.appearance.titleSelectionColor; -} - -#pragma mark - titleTodayColor - -- (void)setTitleTodayColor:(UIColor *)titleTodayColor -{ - self.appearance.titleTodayColor = titleTodayColor; -} - -- (UIColor *)titleTodayColor -{ - return self.appearance.titleTodayColor; -} - -#pragma mark - titlePlaceholderColor - -- (void)setTitlePlaceholderColor:(UIColor *)titlePlaceholderColor -{ - self.appearance.titlePlaceholderColor = titlePlaceholderColor; -} - -- (UIColor *)titlePlaceholderColor -{ - return self.appearance.titlePlaceholderColor; -} - -#pragma mark - titleWeekendColor - -- (void)setTitleWeekendColor:(UIColor *)titleWeekendColor -{ - self.appearance.titleWeekendColor = titleWeekendColor; -} - -- (UIColor *)titleWeekendColor -{ - return self.appearance.titleWeekendColor; -} - -#pragma mark - subtitleDefaultColor - -- (void)setSubtitleDefaultColor:(UIColor *)subtitleDefaultColor -{ - self.appearance.subtitleDefaultColor = subtitleDefaultColor; -} - -- (UIColor *)subtitleDefaultColor -{ - return self.appearance.subtitleDefaultColor; -} - -#pragma mark - subtitleSelectionColor - -- (void)setSubtitleSelectionColor:(UIColor *)subtitleSelectionColor -{ - self.appearance.subtitleSelectionColor = subtitleSelectionColor; -} - -- (UIColor *)subtitleSelectionColor -{ - return self.appearance.subtitleSelectionColor; -} - -#pragma mark - subtitleTodayColor - -- (void)setSubtitleTodayColor:(UIColor *)subtitleTodayColor -{ - self.appearance.subtitleTodayColor = subtitleTodayColor; -} - -- (UIColor *)subtitleTodayColor -{ - return self.appearance.subtitleTodayColor; -} - -#pragma mark - subtitlePlaceholderColor - -- (void)setSubtitlePlaceholderColor:(UIColor *)subtitlePlaceholderColor -{ - self.appearance.subtitlePlaceholderColor = subtitlePlaceholderColor; -} - -- (UIColor *)subtitlePlaceholderColor -{ - return self.appearance.subtitlePlaceholderColor; -} - -#pragma mark - subtitleWeekendColor - -- (void)setSubtitleWeekendColor:(UIColor *)subtitleWeekendColor -{ - self.appearance.subtitleWeekendColor = subtitleWeekendColor; -} - -- (UIColor *)subtitleWeekendColor -{ - return self.appearance.subtitleWeekendColor; -} - -#pragma mark - selectionColor - -- (void)setSelectionColor:(UIColor *)selectionColor -{ - self.appearance.selectionColor = selectionColor; -} - -- (UIColor *)selectionColor -{ - return self.appearance.selectionColor; -} - -#pragma mark - todayColor - -- (void)setTodayColor:(UIColor *)todayColor -{ - self.appearance.todayColor = todayColor; -} - -- (UIColor *)todayColor -{ - return self.appearance.todayColor; -} - -#pragma mark - todaySelectionColor - -- (void)setTodaySelectionColor:(UIColor *)todaySelectionColor -{ - self.appearance.todaySelectionColor = todaySelectionColor; -} - -- (UIColor *)todaySelectionColor -{ - return self.appearance.todaySelectionColor; -} - -#pragma mark - borderDefaultColor - -- (void)setBorderDefaultColor:(UIColor *)borderDefaultColor -{ - self.appearance.borderDefaultColor = borderDefaultColor; -} - -- (UIColor *)borderDefaultColor -{ - return self.appearance.borderDefaultColor; -} - -#pragma mark - borderSelectionColor - -- (void)setBorderSelectionColor:(UIColor *)borderSelectionColor -{ - self.appearance.borderSelectionColor = borderSelectionColor; -} - -- (UIColor *)borderSelectionColor -{ - return self.appearance.borderSelectionColor; -} - -#pragma mark - cellStyle - -- (void)setCellShape:(FSCalendarCellShape)cellShape -{ - self.appearance.cellShape = cellShape; -} - -- (FSCalendarCellShape)cellShape -{ - return self.appearance.cellShape; -} - -#pragma mark - useVeryShortWeekdaySymbols - -- (void)setUseVeryShortWeekdaySymbols:(BOOL)useVeryShortWeekdaySymbols -{ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - self.appearance.useVeryShortWeekdaySymbols = useVeryShortWeekdaySymbols; -#pragma GCC diagnostic pop -} - -- (BOOL)useVeryShortWeekdaySymbols -{ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - return self.appearance.useVeryShortWeekdaySymbols; -#pragma GCC diagnostic pop -} - - -#pragma mark - fakeSubtitles - -- (void)setFakeSubtitles:(BOOL)fakeSubtitles -{ -#if TARGET_INTERFACE_BUILDER - self.appearance.fakeSubtitles = fakeSubtitles; -#endif -} - -#if TARGET_INTERFACE_BUILDER -- (BOOL)fakeSubtitles -{ - return self.appearance.fakeSubtitles; -} -#endif - -#pragma mark - fakedSelectedDay - -- (void)setFakedSelectedDay:(NSInteger)fakedSelectedDay -{ -#if TARGET_INTERFACE_BUILDER - self.appearance.fakedSelectedDay = fakedSelectedDay; -#endif -} - - -#if TARGET_INTERFACE_BUILDER -- (NSInteger)fakedSelectedDay -{ - return self.appearance.fakedSelectedDay; -} -#endif - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - -- (void)setTitleTextSize:(CGFloat)titleTextSize -{ - self.appearance.titleTextSize = titleTextSize; -} - -- (CGFloat)titleTextSize -{ - return self.appearance.titleTextSize; -} - - -- (void)setSubtitleTextSize:(CGFloat)subtitleTextSize -{ - self.appearance.subtitleTextSize = subtitleTextSize; -} - -- (CGFloat)subtitleTextSize -{ - return self.appearance.subtitleTextSize; -} - -- (void)setWeekdayTextSize:(CGFloat)weekdayTextSize -{ - self.appearance.weekdayTextSize = weekdayTextSize; -} - -- (CGFloat)weekdayTextSize -{ - return self.appearance.weekdayTextSize; -} - -- (void)setHeaderTitleTextSize:(CGFloat)headerTitleTextSize -{ - self.appearance.headerTitleTextSize = headerTitleTextSize; -} - -- (CGFloat)headerTitleTextSize -{ - return self.appearance.headerTitleTextSize; -} - -#pragma GCC diagnostic pop - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.h index c86d649..6455fb1 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.h @@ -7,22 +7,20 @@ // // https://github.com/WenchaoD // +// FSCalendar is a superior awesome calendar control with high performance, high customizablility and very simple usage. +// +// @see FSCalendarDataSource +// @see FSCalendarDelegate +// @see FSCalendarDelegateAppearance +// @see FSCalendarAppearance +// #import #import "FSCalendarAppearance.h" -#import "FSCalendarConstance.h" - -/** - * FSCalendar is a superior awesome calendar control with high performance, high customizablility and very simple usage. - * - * @warning All NSDate instances used in the calendar should be managed by the DateTools category. See FSCalendar+DateTools. - * - * @see FSCalendarDataSource - * @see FSCalendarDelegate - * @see FSCalendarDelegateAppearance - * @see FSCalendarAppearance - * @see FSCalendar+DateTools - */ +#import "FSCalendarConstants.h" +#import "FSCalendarCell.h" +#import "FSCalendarWeekdayView.h" +#import "FSCalendarHeaderView.h" //! Project version number for FSCalendar. FOUNDATION_EXPORT double FSCalendarVersionNumber; @@ -40,10 +38,18 @@ typedef NS_ENUM(NSUInteger, FSCalendarScrollDirection) { FSCalendarScrollDirectionHorizontal }; -typedef NS_ENUM(NSUInteger, FSCalendarUnit) { - FSCalendarUnitMonth = NSCalendarUnitMonth, - FSCalendarUnitWeekOfYear = NSCalendarUnitWeekOfYear, - FSCalendarUnitDay = NSCalendarUnitDay +typedef NS_ENUM(NSUInteger, FSCalendarPlaceholderType) { + FSCalendarPlaceholderTypeNone = 0, + FSCalendarPlaceholderTypeFillHeadTail = 1, + FSCalendarPlaceholderTypeFillSixRows = 2 +}; + +typedef NS_ENUM(NSUInteger, FSCalendarMonthPosition) { + FSCalendarMonthPositionPrevious, + FSCalendarMonthPositionCurrent, + FSCalendarMonthPositionNext, + + FSCalendarMonthPositionNotFound = NSNotFound }; NS_ASSUME_NONNULL_BEGIN @@ -51,12 +57,17 @@ NS_ASSUME_NONNULL_BEGIN @class FSCalendar; /** - * FSCalendarDataSource is a source set of FSCalendar. The basic job is to provide event、subtitle and min/max day to display for calendar. + * FSCalendarDataSource is a source set of FSCalendar. The basic role is to provide event、subtitle and min/max day to display, or customized day cell for the calendar. */ @protocol FSCalendarDataSource @optional +/** + * Asks the dataSource for a title for the specific date as a replacement of the day text + */ +- (nullable NSString *)calendar:(FSCalendar *)calendar titleForDate:(NSDate *)date; + /** * Asks the dataSource for a subtitle for the specific date under the day text. */ @@ -77,11 +88,15 @@ NS_ASSUME_NONNULL_BEGIN */ - (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar; +/** + * Asks the data source for a cell to insert in a particular data of the calendar. + */ +- (__kindof FSCalendarCell *)calendar:(FSCalendar *)calendar cellForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position; + /** * Asks the dataSource the number of event dots for a specific date. * * @see - * * - (UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorForDate:(NSDate *)date; * - (NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorsForDate:(NSDate *)date; */ @@ -103,56 +118,70 @@ NS_ASSUME_NONNULL_BEGIN @optional /** - * Asks the delegate whether the specific date is allowed to be selected by tapping. + Asks the delegate whether the specific date is allowed to be selected by tapping. */ -- (BOOL)calendar:(FSCalendar *)calendar shouldSelectDate:(NSDate *)date; +- (BOOL)calendar:(FSCalendar *)calendar shouldSelectDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)monthPosition; /** - * Tells the delegate a date in the calendar is selected by tapping. + Tells the delegate a date in the calendar is selected by tapping. */ -- (void)calendar:(FSCalendar *)calendar didSelectDate:(NSDate *)date; +- (void)calendar:(FSCalendar *)calendar didSelectDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)monthPosition; /** - * Asks the delegate whether the specific date is allowed to be deselected by tapping. + Asks the delegate whether the specific date is allowed to be deselected by tapping. */ -- (BOOL)calendar:(FSCalendar *)calendar shouldDeselectDate:(NSDate *)date; +- (BOOL)calendar:(FSCalendar *)calendar shouldDeselectDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)monthPosition; /** - * Tells the delegate a date in the calendar is deselected by tapping. + Tells the delegate a date in the calendar is deselected by tapping. */ -- (void)calendar:(FSCalendar *)calendar didDeselectDate:(NSDate *)date; +- (void)calendar:(FSCalendar *)calendar didDeselectDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)monthPosition; + /** - * Tells the delegate the calendar is about to change the bounding rect. + Tells the delegate the calendar is about to change the bounding rect. */ - (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated; /** - * Tells the delegate the calendar is about to change the current page. + Tells the delegate that the specified cell is about to be displayed in the calendar. + */ +- (void)calendar:(FSCalendar *)calendar willDisplayCell:(FSCalendarCell *)cell forDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)monthPosition; + +/** + Tells the delegate the calendar is about to change the current page. */ - (void)calendarCurrentPageDidChange:(FSCalendar *)calendar; /** - * These functions are deprecated + These functions are deprecated */ - (void)calendarCurrentScopeWillChange:(FSCalendar *)calendar animated:(BOOL)animated FSCalendarDeprecated(-calendar:boundingRectWillChange:animated:); - (void)calendarCurrentMonthDidChange:(FSCalendar *)calendar FSCalendarDeprecated(-calendarCurrentPageDidChange:); +- (BOOL)calendar:(FSCalendar *)calendar shouldSelectDate:(NSDate *)date FSCalendarDeprecated(-calendar:shouldSelectDate:atMonthPosition:);- (void)calendar:(FSCalendar *)calendar didSelectDate:(NSDate *)date FSCalendarDeprecated(-calendar:didSelectDate:atMonthPosition:); +- (BOOL)calendar:(FSCalendar *)calendar shouldDeselectDate:(NSDate *)date FSCalendarDeprecated(-calendar:shouldDeselectDate:atMonthPosition:); +- (void)calendar:(FSCalendar *)calendar didDeselectDate:(NSDate *)date FSCalendarDeprecated(-calendar:didDeselectDate:atMonthPosition:); @end /** - * FSCalendarDelegateAppearance determines the fonts and colors of components in the calendar, but more specificly. Basely, if you need to make a global customization of appearance of the calendar, use FSCalendarAppearance. But if you need different appearance for different day, use FSCalendarDelegateAppearance. + * FSCalendarDelegateAppearance determines the fonts and colors of components in the calendar, but more specificly. Basically, if you need to make a global customization of appearance of the calendar, use FSCalendarAppearance. But if you need different appearance for different days, use FSCalendarDelegateAppearance. * * @see FSCalendarAppearance */ -@protocol FSCalendarDelegateAppearance +@protocol FSCalendarDelegateAppearance @optional +/** + * Asks the delegate for a fill color in unselected state for the specific date. + */ +- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance fillDefaultColorForDate:(NSDate *)date; + /** * Asks the delegate for a fill color in selected state for the specific date. */ -- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance selectionColorForDate:(NSDate *)date; +- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance fillSelectionColorForDate:(NSDate *)date; /** * Asks the delegate for day text color in unselected state for the specific date. @@ -175,14 +204,14 @@ NS_ASSUME_NONNULL_BEGIN - (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance subtitleSelectionColorForDate:(NSDate *)date; /** - * Asks the delegate for single event color for the specific date. + * Asks the delegate for event colors for the specific date. */ -- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorForDate:(NSDate *)date; +- (nullable NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventDefaultColorsForDate:(NSDate *)date; /** - * Asks the delegate for multiple event colors for the specific date. + * Asks the delegate for multiple event colors in selected state for the specific date. */ -- (nullable NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorsForDate:(NSDate *)date; +- (nullable NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventSelectionColorsForDate:(NSDate *)date; /** * Asks the delegate for a border color in unselected state for the specific date. @@ -195,15 +224,39 @@ NS_ASSUME_NONNULL_BEGIN - (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance borderSelectionColorForDate:(NSDate *)date; /** - * Asks the delegate for a shape for the specific date. + * Asks the delegate for an offset for day text for the specific date. */ -- (FSCalendarCellShape)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance cellShapeForDate:(NSDate *)date; +- (CGPoint)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance titleOffsetForDate:(NSDate *)date; /** - * This function is deprecated + * Asks the delegate for an offset for subtitle for the specific date. */ -- (FSCalendarCellStyle)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance cellStyleForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:cellShapeForDate:); +- (CGPoint)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance subtitleOffsetForDate:(NSDate *)date; +/** + * Asks the delegate for an offset for image for the specific date. + */ +- (CGPoint)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance imageOffsetForDate:(NSDate *)date; + +/** + * Asks the delegate for an offset for event dots for the specific date. + */ +- (CGPoint)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventOffsetForDate:(NSDate *)date; + + +/** + * Asks the delegate for a border radius for the specific date. + */ +- (CGFloat)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance borderRadiusForDate:(NSDate *)date; + +/** + * These functions are deprecated + */ +- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance fillColorForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:fillDefaultColorForDate:); +- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance selectionColorForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:fillSelectionColorForDate:); +- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:eventDefaultColorsForDate:); +- (nullable NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorsForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:eventDefaultColorsForDate:); +- (FSCalendarCellShape)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance cellShapeForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:borderRadiusForDate:); @end #pragma mark - Primary @@ -222,9 +275,9 @@ IB_DESIGNABLE @property (weak, nonatomic) IBOutlet id dataSource; /** - * A special mark will be put on today of the calendar + * A special mark will be put on 'today' of the calendar. */ -@property (strong, nonatomic) NSDate *today; +@property (nullable, strong, nonatomic) NSDate *today; /** * The current page of calendar @@ -240,16 +293,7 @@ IB_DESIGNABLE * * calendar.locale = [NSLocale localeWithLocaleIdentifier:@"zh-CN"]; */ -@property (strong, nonatomic) NSLocale *locale; - -/** - * Represents the NSCalendarIdentifier of calendar. Default is NSCalendarIdentifierGregorian. - * - * e.g. To display a Persian calendar - * - * calendar.identifier = NSCalendarIdentifierPersian; - */ -@property (strong, nonatomic) NSString *identifier; +@property (copy, nonatomic) NSLocale *locale; /** * The scroll direction of FSCalendar. @@ -268,330 +312,319 @@ IB_DESIGNABLE @property (assign, nonatomic) FSCalendarScope scope; /** - * The index of the first weekday of the calendar. Give a '2' to make Monday in the first column. + A UIPanGestureRecognizer instance which enables the control of scope on the whole day-area. Not available if the scrollDirection is vertical. + + @deprecated Use -handleScopeGesture: instead + + e.g. + + UIPanGestureRecognizer *scopeGesture = [[UIPanGestureRecognizer alloc] initWithTarget:calendar action:@selector(handleScopeGesture:)]; + [calendar addGestureRecognizer:scopeGesture]; + + @see DIYExample + @see FSCalendarScopeExample + */ +@property (readonly, nonatomic) UIPanGestureRecognizer *scopeGesture FSCalendarDeprecated(handleScopeGesture:); + +/** + * A UILongPressGestureRecognizer instance which enables the swipe-to-choose feature of the calendar. + * + * e.g. + * + * calendar.swipeToChooseGesture.enabled = YES; + */ +@property (readonly, nonatomic) UILongPressGestureRecognizer *swipeToChooseGesture; + +/** + * The placeholder type of FSCalendar. Default is FSCalendarPlaceholderTypeFillSixRows. + * + * e.g. To hide all placeholder of the calendar + * + * calendar.placeholderType = FSCalendarPlaceholderTypeNone; + */ +#if TARGET_INTERFACE_BUILDER +@property (assign, nonatomic) IBInspectable NSUInteger placeholderType; +#else +@property (assign, nonatomic) FSCalendarPlaceholderType placeholderType; +#endif + +/** + The index of the first weekday of the calendar. Give a '2' to make Monday in the first column. */ @property (assign, nonatomic) IBInspectable NSUInteger firstWeekday; /** - * The height of month header of the calendar. Give a '0' to remove the header. + The height of month header of the calendar. Give a '0' to remove the header. */ @property (assign, nonatomic) IBInspectable CGFloat headerHeight; /** - * The height of weekday header of the calendar. + The height of weekday header of the calendar. */ @property (assign, nonatomic) IBInspectable CGFloat weekdayHeight; /** - * A Boolean value that determines whether users can select a date. + The weekday view of the calendar + */ +@property (strong, nonatomic) FSCalendarWeekdayView *calendarWeekdayView; + +/** + The header view of the calendar + */ +@property (strong, nonatomic) FSCalendarHeaderView *calendarHeaderView; + +/** + A Boolean value that determines whether users can select a date. */ @property (assign, nonatomic) IBInspectable BOOL allowsSelection; /** - * A Boolean value that determines whether users can select more than one date. + A Boolean value that determines whether users can select more than one date. */ @property (assign, nonatomic) IBInspectable BOOL allowsMultipleSelection; /** - * A Boolean value that determines whether paging is enabled for the calendar. + A Boolean value that determines whether paging is enabled for the calendar. */ @property (assign, nonatomic) IBInspectable BOOL pagingEnabled; /** - * A Boolean value that determines whether scrolling is enabled for the calendar. + A Boolean value that determines whether scrolling is enabled for the calendar. */ @property (assign, nonatomic) IBInspectable BOOL scrollEnabled; /** - * A Boolean value that determines whether scoping animation is centered a visible selected date. Default is YES. + A Boolean value that determines whether the calendar should show a handle for control the scope. Default is NO; + + @deprecated Use -handleScopeGesture: instead + + e.g. + + UIPanGestureRecognizer *scopeGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self.calendar action:@selector(handleScopeGesture:)]; + scopeGesture.delegate = ... + [anyOtherView addGestureRecognizer:scopeGesture]; + + @see FSCalendarScopeExample + */ -@property (assign, nonatomic) IBInspectable BOOL focusOnSingleSelectedDate; +@property (assign, nonatomic) IBInspectable BOOL showsScopeHandle FSCalendarDeprecated(handleScopeGesture:); /** - * A Boolean value that determines whether the calendar should show days out of month. Default is YES. + The row height of the calendar if paging enabled is NO.; */ -@property (assign, nonatomic) IBInspectable BOOL showsPlaceholders; +@property (assign, nonatomic) IBInspectable CGFloat rowHeight; +/** + The calendar appearance used to control the global fonts、colors .etc + */ @property (readonly, nonatomic) FSCalendarAppearance *appearance; /** - * A date object representing the minimum day enable、visible and selectable. (read-only) + A date object representing the minimum day enable、visible and selectable. (read-only) */ @property (readonly, nonatomic) NSDate *minimumDate; /** - * A date object representing the maximum day enable、visible and selectable. (read-only) + A date object representing the maximum day enable、visible and selectable. (read-only) */ @property (readonly, nonatomic) NSDate *maximumDate; /** - * A date object identifying the section of the selected date. (read-only) + A date object identifying the section of the selected date. (read-only) */ -@property (readonly, nonatomic) NSDate *selectedDate; +@property (nullable, readonly, nonatomic) NSDate *selectedDate; /** - * The dates representing the selected dates. (read-only) + The dates representing the selected dates. (read-only) */ -@property (readonly, nonatomic) NSArray *selectedDates; +@property (readonly, nonatomic) NSArray *selectedDates; /** - * Reload the dates and appearance of the calendar. + Reload the dates and appearance of the calendar. */ - (void)reloadData; /** - * Change the scope of the calendar. Make sure `-calendar:boundingRectWillChange:animated` is correctly adopted. - * - * @param scope The target scope to change. - * @param animated YES if you want to animate the scoping; NO if the change should be immediate. + Change the scope of the calendar. Make sure `-calendar:boundingRectWillChange:animated` is correctly adopted. + + @param scope The target scope to change. + @param animated YES if you want to animate the scoping; NO if the change should be immediate. */ - (void)setScope:(FSCalendarScope)scope animated:(BOOL)animated; /** - * Selects a given date in the calendar. - * - * @param date A date in the calendar. + Selects a given date in the calendar. + + @param date A date in the calendar. */ -- (void)selectDate:(NSDate *)date; +- (void)selectDate:(nullable NSDate *)date; /** - * Selects a given date in the calendar, optionally scrolling the date to visible area. - * - * @param date A date in the calendar. - * @param scrollToDate A Boolean value that determines whether the calendar should scroll to the selected date to visible area. + Selects a given date in the calendar, optionally scrolling the date to visible area. + + @param date A date in the calendar. + @param scrollToDate A Boolean value that determines whether the calendar should scroll to the selected date to visible area. */ -- (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate; +- (void)selectDate:(nullable NSDate *)date scrollToDate:(BOOL)scrollToDate; /** - * Deselects a given date of the calendar. - * @param date A date in the calendar. + Deselects a given date of the calendar. + + @param date A date in the calendar. */ - (void)deselectDate:(NSDate *)date; /** - * Change the current page of the calendar. - * - * @param currentPage Representing weekOfYear in week mode, or month in month mode. - * @param animated YES if you want to animate the change in position; NO if it should be immediate. + Changes the current page of the calendar. + + @param currentPage Representing weekOfYear in week mode, or month in month mode. + @param animated YES if you want to animate the change in position; NO if it should be immediate. */ - (void)setCurrentPage:(NSDate *)currentPage animated:(BOOL)animated; +/** + Register a class for use in creating new calendar cells. + + @param cellClass The class of a cell that you want to use in the calendar. + @param identifier The reuse identifier to associate with the specified class. This parameter must not be nil and must not be an empty string. + */ +- (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identifier; + +/** + Returns a reusable calendar cell object located by its identifier. + + @param identifier The reuse identifier for the specified cell. This parameter must not be nil. + @param date The specific date of the cell. + @return A valid FSCalendarCell object. + */ +- (__kindof FSCalendarCell *)dequeueReusableCellWithIdentifier:(NSString *)identifier forDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position; + +/** + Returns the calendar cell for the specified date. + + @param date The date of the cell + @param position The month position for the cell + @return An object representing a cell of the calendar, or nil if the cell is not visible or date is out of range. + */ +- (nullable FSCalendarCell *)cellForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position; + + +/** + Returns the date of the specified cell. + + @param cell The cell object whose date you want. + @return The date of the cell or nil if the specified cell is not in the calendar. + */ +- (nullable NSDate *)dateForCell:(FSCalendarCell *)cell; + +/** + Returns the month position of the specified cell. + + @param cell The cell object whose month position you want. + @return The month position of the cell or FSCalendarMonthPositionNotFound if the specified cell is not in the calendar. + */ +- (FSCalendarMonthPosition)monthPositionForCell:(FSCalendarCell *)cell; + + +/** + Returns an array of visible cells currently displayed by the calendar. + + @return An array of FSCalendarCell objects. If no cells are visible, this method returns an empty array. + */ +- (NSArray<__kindof FSCalendarCell *> *)visibleCells; + +/** + Returns the frame for a non-placeholder cell relative to the super view of the calendar. + + @param date A date is the calendar. + */ +- (CGRect)frameForDate:(NSDate *)date; + +/** + An action selector for UIPanGestureRecognizer instance to control the scope transition + + @param sender A UIPanGestureRecognizer instance which controls the scope of the calendar + */ +- (void)handleScopeGesture:(UIPanGestureRecognizer *)sender; + @end -#pragma mark - DateTools -/** - * Job for this category: - * - * 1. Manage date object simplier、faster - * 2. Bring date object into a no-timezone system. - * - * @warning All NSDate instances used in the calendar should be created by: - * - * - (NSDate *)dateFromString:(NSString *)string format:(NSString *)format; - * - (NSDate *)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day; - * - */ -@interface FSCalendar (DateTools) +IB_DESIGNABLE +@interface FSCalendar (IBExtension) -/** - * Returns the number of year of the given date - */ -- (NSInteger)yearOfDate:(NSDate *)date; +#if TARGET_INTERFACE_BUILDER -/** - * Returns the number of month of the given date - */ -- (NSInteger)monthOfDate:(NSDate *)date; +@property (assign, nonatomic) IBInspectable CGFloat titleTextSize; +@property (assign, nonatomic) IBInspectable CGFloat subtitleTextSize; +@property (assign, nonatomic) IBInspectable CGFloat weekdayTextSize; +@property (assign, nonatomic) IBInspectable CGFloat headerTitleTextSize; -/** - * Returns the number of day of the given date - */ -- (NSInteger)dayOfDate:(NSDate *)date; +@property (strong, nonatomic) IBInspectable UIColor *eventDefaultColor; +@property (strong, nonatomic) IBInspectable UIColor *eventSelectionColor; +@property (strong, nonatomic) IBInspectable UIColor *weekdayTextColor; -/** - * Returns the number of weekday of the given date - */ -- (NSInteger)weekdayOfDate:(NSDate *)date; +@property (strong, nonatomic) IBInspectable UIColor *headerTitleColor; +@property (strong, nonatomic) IBInspectable NSString *headerDateFormat; +@property (assign, nonatomic) IBInspectable CGFloat headerMinimumDissolvedAlpha; -/** - * Returns the number of weekOfYear of the given date - */ -- (NSInteger)weekOfDate:(NSDate *)date; +@property (strong, nonatomic) IBInspectable UIColor *titleDefaultColor; +@property (strong, nonatomic) IBInspectable UIColor *titleSelectionColor; +@property (strong, nonatomic) IBInspectable UIColor *titleTodayColor; +@property (strong, nonatomic) IBInspectable UIColor *titlePlaceholderColor; +@property (strong, nonatomic) IBInspectable UIColor *titleWeekendColor; -/** - * Returns the number of hour of the given date - */ -- (NSInteger)hourOfDate:(NSDate *)date; +@property (strong, nonatomic) IBInspectable UIColor *subtitleDefaultColor; +@property (strong, nonatomic) IBInspectable UIColor *subtitleSelectionColor; +@property (strong, nonatomic) IBInspectable UIColor *subtitleTodayColor; +@property (strong, nonatomic) IBInspectable UIColor *subtitlePlaceholderColor; +@property (strong, nonatomic) IBInspectable UIColor *subtitleWeekendColor; -/** - * Returns the number of minite of the given date - */ -- (NSInteger)miniuteOfDate:(NSDate *)date; +@property (strong, nonatomic) IBInspectable UIColor *selectionColor; +@property (strong, nonatomic) IBInspectable UIColor *todayColor; +@property (strong, nonatomic) IBInspectable UIColor *todaySelectionColor; -/** - * Returns the number of seconds of the given date - */ -- (NSInteger)secondOfDate:(NSDate *)date; +@property (strong, nonatomic) IBInspectable UIColor *borderDefaultColor; +@property (strong, nonatomic) IBInspectable UIColor *borderSelectionColor; -/** - * Returns the number of rows of the given month - */ -- (NSInteger)numberOfRowsInMonth:(NSDate *)month; +@property (assign, nonatomic) IBInspectable CGFloat borderRadius; +@property (assign, nonatomic) IBInspectable BOOL useVeryShortWeekdaySymbols; -/** - * Zeronizing hour、minute and second components of the given date - */ -- (NSDate *)dateByIgnoringTimeComponentsOfDate:(NSDate *)date; +@property (assign, nonatomic) IBInspectable BOOL fakeSubtitles; +@property (assign, nonatomic) IBInspectable BOOL fakeEventDots; +@property (assign, nonatomic) IBInspectable NSInteger fakedSelectedDay; -/** - * Returns the first day of month of the given date - */ -- (NSDate *)beginingOfMonthOfDate:(NSDate *)date; - -/** - * Returns the last day of month of the given date - */ -- (NSDate *)endOfMonthOfDate:(NSDate *)date; - -/** - * Returns the first day of week of the given date - */ -- (NSDate *)beginingOfWeekOfDate:(NSDate *)date; - -/** - * Returns the middle day of week of the given date - */ -- (NSDate *)middleOfWeekFromDate:(NSDate *)date; - -/** - * Returns the next day of the given date - */ -- (NSDate *)tomorrowOfDate:(NSDate *)date; - -/** - * Returns the previous day of the given date - */ -- (NSDate *)yesterdayOfDate:(NSDate *)date; - -/** - * Returns the number of days in the month of the given date - */ -- (NSInteger)numberOfDatesInMonthOfDate:(NSDate *)date; - -/** - * Instantiating a date by given string and date format. - * - * e.g. - * - * NSDate *date = [calendar dateFromString:@"2000-10-10" format:@"yyyy-MM-dd"]; - */ -- (NSDate *)dateFromString:(NSString *)string format:(NSString *)format; - -/** - * Instantiating a date by given numbers of year、month and day. - * - * e.g. - * - * NSDate *date = [calendar dateWithYear:2000 month:10 day:10]; - */ -- (NSDate *)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day; - -/** - * Returns a new NSDate object representing the time calculated by adding given number of year to a given date. - */ -- (NSDate *)dateByAddingYears:(NSInteger)years toDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by substracting given number of year from a given date. - */ -- (NSDate *)dateBySubstractingYears:(NSInteger)years fromDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by adding given number of month to a given date. - */ -- (NSDate *)dateByAddingMonths:(NSInteger)months toDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by substracting given number of month from a given date. - */ -- (NSDate *)dateBySubstractingMonths:(NSInteger)months fromDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by adding given number of week to a given date. - */ -- (NSDate *)dateByAddingWeeks:(NSInteger)weeks toDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by substracting given number of week from a given date. - */ -- (NSDate *)dateBySubstractingWeeks:(NSInteger)weeks fromDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by adding given number of day to a given date. - */ -- (NSDate *)dateByAddingDays:(NSInteger)days toDate:(NSDate *)date; - -/** - * Returns a new NSDate object representing the time calculated by substracting given number of day from a given date. - */ -- (NSDate *)dateBySubstractingDays:(NSInteger)days fromDate:(NSDate *)date; - -/** - * Returns the year-difference between the given dates - */ -- (NSInteger)yearsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; - -/** - * Returns the month-difference between the given dates - */ -- (NSInteger)monthsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; - -/** - * Returns the day-difference between the given dates - */ -- (NSInteger)daysFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; - -/** - * Returns the week-difference between the given dates - */ -- (NSInteger)weeksFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; - -/** - * Returns whether two dates are equal to a given unit of calendar. - */ -- (BOOL)isDate:(NSDate *)date1 equalToDate:(NSDate *)date2 toCalendarUnit:(FSCalendarUnit)unit; - -/** - * Returns whether the given date is in 'today' of the calendar. - */ -- (BOOL)isDateInToday:(NSDate *)date; - -/** - * Returns a string representation of a given date formatted using a specific date format. - */ -- (NSString *)stringFromDate:(NSDate *)date format:(NSString *)format; - -/** - * Returns a string representation of a given date formatted using a yyyy-MM-dd. - */ -- (NSString *)stringFromDate:(NSDate *)date; +#endif @end + #pragma mark - Deprecate -/** - * These attributes and functions are deprecated. - */ @interface FSCalendar (Deprecated) -@property (strong, nonatomic) NSDate *currentMonth FSCalendarDeprecated('currentPage'); -@property (assign, nonatomic) FSCalendarFlow flow FSCalendarDeprecated('scrollDirection'); -- (void)setSelectedDate:(NSDate *)selectedDate FSCalendarDeprecated(-selectDate:); -- (void)setSelectedDate:(NSDate *)selectedDate animate:(BOOL)animate FSCalendarDeprecated(-selectDate:scrollToDate:); -- (BOOL)date:(NSDate *)date sharesSameMonthWithDate:(NSDate *)anotherDate FSCalendarDeprecated(-isDate:equalToDate:toCalendarUnit); -- (BOOL)date:(NSDate *)date sharesSameWeekWithDate:(NSDate *)anotherDate FSCalendarDeprecated(-isDate:equalToDate:toCalendarUnit); -- (BOOL)date:(NSDate *)date sharesSameDayWithDate:(NSDate *)anotherDate FSCalendarDeprecated(-isDate:equalToDate:toCalendarUnit); +@property (assign, nonatomic) CGFloat lineHeightMultiplier FSCalendarDeprecated(rowHeight); +@property (assign, nonatomic) IBInspectable BOOL showsPlaceholders FSCalendarDeprecated('placeholderType'); +@property (strong, nonatomic) NSString *identifier DEPRECATED_MSG_ATTRIBUTE("Changing calendar identifier is NOT RECOMMENDED. "); + +// Use NSCalendar. +- (NSDate *)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day FSCalendarDeprecated([NSDateFormatter dateFromString:]); +- (NSInteger)yearOfDate:(NSDate *)date FSCalendarDeprecated(NSCalendar component:fromDate:]); +- (NSInteger)monthOfDate:(NSDate *)date FSCalendarDeprecated(NSCalendar component:fromDate:]); +- (NSInteger)dayOfDate:(NSDate *)date FSCalendarDeprecated(NSCalendar component:fromDate:]); +- (NSInteger)weekdayOfDate:(NSDate *)date FSCalendarDeprecated(NSCalendar component:fromDate:]); +- (NSInteger)weekOfDate:(NSDate *)date FSCalendarDeprecated(NSCalendar component:fromDate:]); +- (NSDate *)dateByAddingYears:(NSInteger)years toDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateBySubstractingYears:(NSInteger)years fromDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateByAddingMonths:(NSInteger)months toDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateBySubstractingMonths:(NSInteger)months fromDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateByAddingWeeks:(NSInteger)weeks toDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateBySubstractingWeeks:(NSInteger)weeks fromDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateByAddingDays:(NSInteger)days toDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (NSDate *)dateBySubstractingDays:(NSInteger)days fromDate:(NSDate *)date FSCalendarDeprecated([NSCalendar dateByAddingUnit:value:toDate:options:]); +- (BOOL)isDate:(NSDate *)date1 equalToDate:(NSDate *)date2 toCalendarUnit:(FSCalendarUnit)unit FSCalendarDeprecated([NSCalendar -isDate:equalToDate:toUnitGranularity:]); +- (BOOL)isDateInToday:(NSDate *)date FSCalendarDeprecated([NSCalendar -isDateInToday:]); + + @end NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.m index a2b0828..30da90d 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendar.m @@ -7,80 +7,70 @@ // #import "FSCalendar.h" -#import "FSCalendarHeader.h" +#import "FSCalendarHeaderView.h" +#import "FSCalendarWeekdayView.h" #import "FSCalendarStickyHeader.h" -#import "FSCalendarCell.h" -#import "FSCalendarFlowLayout.h" -#import "FSCalendarAnimator.h" +#import "FSCalendarCollectionViewLayout.h" +#import "FSCalendarScopeHandle.h" -#import "UIView+FSExtension.h" -#import "NSString+FSExtension.h" +#import "FSCalendarExtensions.h" #import "FSCalendarDynamicHeader.h" #import "FSCalendarCollectionView.h" +#import "FSCalendarTransitionCoordinator.h" +#import "FSCalendarCalculator.h" +#import "FSCalendarDelegationFactory.h" + +NS_ASSUME_NONNULL_BEGIN + +static inline void FSCalendarAssertDateInBounds(NSDate *date, NSCalendar *calendar, NSDate *minimumDate, NSDate *maximumDate) { + BOOL valid = YES; + NSInteger minOffset = [calendar components:NSCalendarUnitDay fromDate:minimumDate toDate:date options:0].day; + valid &= minOffset >= 0; + if (valid) { + NSInteger maxOffset = [calendar components:NSCalendarUnitDay fromDate:maximumDate toDate:date options:0].day; + valid &= maxOffset <= 0; + } + if (!valid) { + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.dateFormat = @"yyyy/MM/dd"; + [NSException raise:@"FSCalendar date out of bounds exception" format:@"Target date %@ beyond bounds [%@ - %@]", [formatter stringFromDate:date], [formatter stringFromDate:minimumDate], [formatter stringFromDate:maximumDate]]; + } +} + +NS_ASSUME_NONNULL_END + typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { FSCalendarOrientationLandscape, FSCalendarOrientationPortrait }; -@interface FSCalendar (DataSourceAndDelegate) - -- (NSInteger)numberOfEventsForDate:(NSDate *)date; -- (NSString *)subtitleForDate:(NSDate *)date; -- (UIImage *)imageForDate:(NSDate *)date; -- (NSDate *)minimumDateForCalendar; -- (NSDate *)maximumDateForCalendar; - -- (UIColor *)preferredSelectionColorForDate:(NSDate *)date; -- (UIColor *)preferredTitleDefaultColorForDate:(NSDate *)date; -- (UIColor *)preferredTitleSelectionColorForDate:(NSDate *)date; -- (UIColor *)preferredSubtitleDefaultColorForDate:(NSDate *)date; -- (UIColor *)preferredSubtitleSelectionColorForDate:(NSDate *)date; -- (UIColor *)preferredBorderDefaultColorForDate:(NSDate *)date; -- (UIColor *)preferredBorderSelectionColorForDate:(NSDate *)date; -- (id)preferredEventColorForDate:(NSDate *)date; -- (FSCalendarCellShape)preferredCellShapeForDate:(NSDate *)date; - -- (BOOL)shouldSelectDate:(NSDate *)date; -- (void)didSelectDate:(NSDate *)date; -- (BOOL)shouldDeselectDate:(NSDate *)date; -- (void)didDeselectDate:(NSDate *)date; -- (void)currentPageDidChange; -- (BOOL)boundingRectWillChange:(BOOL)animated; - -@end - -@interface FSCalendar () +@interface FSCalendar () { - NSMutableArray *_selectedDates; - NSDate *_minimumDate; - NSDate *_maximumDate; + NSMutableArray *_selectedDates; } -@property (strong, nonatomic) NSMutableArray *weekdays; -@property (strong, nonatomic) NSMapTable *stickyHeaderMapTable; -@property (strong, nonatomic) NSCalendar *calendar; +@property (strong, nonatomic) NSCalendar *gregorian; @property (strong, nonatomic) NSDateFormatter *formatter; @property (strong, nonatomic) NSDateComponents *components; @property (strong, nonatomic) NSTimeZone *timeZone; @property (weak , nonatomic) UIView *contentView; @property (weak , nonatomic) UIView *daysContainer; -@property (weak , nonatomic) CAShapeLayer *maskLayer; @property (weak , nonatomic) UIView *topBorder; @property (weak , nonatomic) UIView *bottomBorder; +@property (weak , nonatomic) FSCalendarScopeHandle *scopeHandle; @property (weak , nonatomic) FSCalendarCollectionView *collectionView; -@property (weak , nonatomic) FSCalendarFlowLayout *collectionViewLayout; -@property (strong, nonatomic) FSCalendarAnimator *animator; +@property (weak , nonatomic) FSCalendarCollectionViewLayout *collectionViewLayout; + +@property (strong, nonatomic) FSCalendarTransitionCoordinator *transitionCoordinator; +@property (strong, nonatomic) FSCalendarCalculator *calculator; -@property (weak , nonatomic) FSCalendarHeader *header; @property (weak , nonatomic) FSCalendarHeaderTouchDeliver *deliver; -@property (assign, nonatomic) BOOL needsAdjustingMonthPosition; @property (assign, nonatomic) BOOL needsAdjustingViewFrame; -@property (assign, nonatomic) BOOL needsAdjustingTextSize; @property (assign, nonatomic) BOOL needsLayoutForWeekMode; -@property (assign, nonatomic) BOOL supressEvent; +@property (assign, nonatomic) BOOL needsRequestingBoundingDates; @property (assign, nonatomic) CGFloat preferredHeaderHeight; @property (assign, nonatomic) CGFloat preferredWeekdayHeight; @property (assign, nonatomic) CGFloat preferredRowHeight; @@ -91,52 +81,52 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { @property (readonly, nonatomic) NSArray *visibleStickyHeaders; @property (readonly, nonatomic) FSCalendarOrientation currentCalendarOrientation; -@property (readonly, nonatomic) id delegateAppearance; +@property (strong, nonatomic) FSCalendarDelegationProxy *dataSourceProxy; +@property (strong, nonatomic) FSCalendarDelegationProxy *delegateProxy; + +@property (strong, nonatomic) NSIndexPath *lastPressedIndexPath; +@property (strong, nonatomic) NSMapTable *visibleSectionHeaders; - (void)orientationDidChange:(NSNotification *)notification; -- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath; -- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath scope:(FSCalendarScope)scope; -- (NSIndexPath *)indexPathForDate:(NSDate *)date; -- (NSIndexPath *)indexPathForDate:(NSDate *)date scope:(FSCalendarScope)scope; - (CGSize)sizeThatFits:(CGSize)size scope:(FSCalendarScope)scope; -- (NSInteger)numberOfHeadPlaceholdersForMonth:(NSDate *)month; - - (void)scrollToDate:(NSDate *)date; - (void)scrollToDate:(NSDate *)date animated:(BOOL)animated; - (void)scrollToPageForDate:(NSDate *)date animated:(BOOL)animated; +- (BOOL)isPageInRange:(NSDate *)page; - (BOOL)isDateInRange:(NSDate *)date; - (BOOL)isDateSelected:(NSDate *)date; - (BOOL)isDateInDifferentPage:(NSDate *)date; -- (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate forPlaceholder:(BOOL)forPlaceholder; +- (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate atMonthPosition:(FSCalendarMonthPosition)monthPosition; - (void)enqueueSelectedDate:(NSDate *)date; - (void)invalidateDateTools; - (void)invalidateLayout; -- (void)invalidateWeekdaySymbols; - (void)invalidateHeaders; -- (void)invalidateAppearanceForCell:(FSCalendarCell *)cell; - -- (void)invalidateWeekdayFont; -- (void)invalidateWeekdayTextColor; +- (void)invalidateAppearanceForCell:(FSCalendarCell *)cell forDate:(NSDate *)date; - (void)invalidateViewFrames; +- (void)handleSwipeToChoose:(UILongPressGestureRecognizer *)pressGesture; + - (void)selectCounterpartDate:(NSDate *)date; - (void)deselectCounterpartDate:(NSDate *)date; - (void)reloadDataForCell:(FSCalendarCell *)cell atIndexPath:(NSIndexPath *)indexPath; -- (void)reloadVisibleCells; + +- (void)adjustMonthPosition; +- (BOOL)requestBoundingDatesIfNecessary; +- (void)configureAppearance; @end @implementation FSCalendar @dynamic selectedDate; -@synthesize scrollDirection = _scrollDirection, firstWeekday = _firstWeekday, appearance = _appearance; +@synthesize scopeGesture = _scopeGesture, swipeToChooseGesture = _swipeToChooseGesture; #pragma mark - Life Cycle && Initialize @@ -159,23 +149,28 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { } - (void)initialize -{ +{ _appearance = [[FSCalendarAppearance alloc] init]; _appearance.calendar = self; - _calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + _gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; _components = [[NSDateComponents alloc] init]; _formatter = [[NSDateFormatter alloc] init]; + _formatter.dateFormat = @"yyyy-MM-dd"; _locale = [NSLocale currentLocale]; _timeZone = [NSTimeZone localTimeZone]; _firstWeekday = 1; [self invalidateDateTools]; - _minimumDate = [self dateWithYear:1970 month:1 day:1]; - _maximumDate = [self dateWithYear:2099 month:12 day:31]; + _today = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:[NSDate date] options:0]; + _currentPage = [self.gregorian fs_firstDayOfMonth:_today]; + + _minimumDate = [self.formatter dateFromString:@"1970-01-01"]; + _maximumDate = [self.formatter dateFromString:@"2099-12-31"]; _headerHeight = FSCalendarAutomaticDimension; _weekdayHeight = FSCalendarAutomaticDimension; + _rowHeight = FSCalendarStandardRowHeight*MAX(1, FSCalendarDeviceIsIPad*1.5); _preferredHeaderHeight = FSCalendarAutomaticDimension; _preferredWeekdayHeight = FSCalendarAutomaticDimension; @@ -184,72 +179,71 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { _scrollDirection = FSCalendarScrollDirectionHorizontal; _scope = FSCalendarScopeMonth; _selectedDates = [NSMutableArray arrayWithCapacity:1]; + _visibleSectionHeaders = [NSMapTable weakToWeakObjectsMapTable]; - _today = [self dateByIgnoringTimeComponentsOfDate:[NSDate date]]; - _currentPage = [self beginingOfMonthOfDate:_today]; _pagingEnabled = YES; _scrollEnabled = YES; _needsAdjustingViewFrame = YES; - _needsAdjustingTextSize = YES; - _needsAdjustingMonthPosition = YES; - _stickyHeaderMapTable = [NSMapTable weakToWeakObjectsMapTable]; + _needsRequestingBoundingDates = YES; _orientation = self.currentCalendarOrientation; - _focusOnSingleSelectedDate = YES; - _showsPlaceholders = YES; + _placeholderType = FSCalendarPlaceholderTypeFillSixRows; + + _dataSourceProxy = [FSCalendarDelegationFactory dataSourceProxy]; + _delegateProxy = [FSCalendarDelegationFactory delegateProxy]; UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero]; contentView.backgroundColor = [UIColor clearColor]; [self addSubview:contentView]; self.contentView = contentView; - CAShapeLayer *maskLayer = [CAShapeLayer layer]; - maskLayer.actions = @{@"path":[NSNull null]}; - contentView.layer.mask = maskLayer; - self.maskLayer = maskLayer; - UIView *daysContainer = [[UIView alloc] initWithFrame:CGRectZero]; daysContainer.backgroundColor = [UIColor clearColor]; + daysContainer.clipsToBounds = YES; [contentView addSubview:daysContainer]; self.daysContainer = daysContainer; - FSCalendarFlowLayout *collectionViewLayout = [[FSCalendarFlowLayout alloc] init]; + FSCalendarCollectionViewLayout *collectionViewLayout = [[FSCalendarCollectionViewLayout alloc] init]; collectionViewLayout.calendar = self; FSCalendarCollectionView *collectionView = [[FSCalendarCollectionView alloc] initWithFrame:CGRectZero - collectionViewLayout:collectionViewLayout]; + collectionViewLayout:collectionViewLayout]; collectionView.dataSource = self; collectionView.delegate = self; collectionView.backgroundColor = [UIColor clearColor]; - collectionView.bounces = YES; collectionView.pagingEnabled = YES; collectionView.showsHorizontalScrollIndicator = NO; collectionView.showsVerticalScrollIndicator = NO; - collectionView.delaysContentTouches = NO; - collectionView.canCancelContentTouches = YES; collectionView.allowsMultipleSelection = NO; - [collectionView registerClass:[FSCalendarCell class] forCellWithReuseIdentifier:@"cell"]; + collectionView.clipsToBounds = YES; + [collectionView registerClass:[FSCalendarCell class] forCellWithReuseIdentifier:FSCalendarDefaultCellReuseIdentifier]; + [collectionView registerClass:[FSCalendarBlankCell class] forCellWithReuseIdentifier:FSCalendarBlankCellReuseIdentifier]; [collectionView registerClass:[FSCalendarStickyHeader class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header"]; [collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"placeholderHeader"]; [daysContainer addSubview:collectionView]; self.collectionView = collectionView; self.collectionViewLayout = collectionViewLayout; - UIView *view = [[UIView alloc] initWithFrame:CGRectZero]; - view.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.25]; - [self addSubview:view]; - self.topBorder = view; - - view = [[UIView alloc] initWithFrame:CGRectZero]; - view.backgroundColor = _topBorder.backgroundColor; - [self addSubview:view]; - self.bottomBorder = view; + if (!FSCalendarInAppExtension) { + + UIView *view = [[UIView alloc] initWithFrame:CGRectZero]; + view.backgroundColor = FSCalendarStandardLineColor; + view.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin; // Stick to top + [self addSubview:view]; + self.topBorder = view; + + view = [[UIView alloc] initWithFrame:CGRectZero]; + view.backgroundColor = FSCalendarStandardLineColor; + view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin; // Stick to bottom + [self addSubview:view]; + self.bottomBorder = view; + + } [self invalidateLayout]; - self.animator = [[FSCalendarAnimator alloc] init]; - self.animator.calendar = self; - self.animator.collectionView = self.collectionView; - self.animator.collectionViewLayout = self.collectionViewLayout; + // Assistants + self.transitionCoordinator = [[FSCalendarTransitionCoordinator alloc] initWithCalendar:self]; + self.calculator = [[FSCalendarCalculator alloc] initWithCalendar:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationDidChange:) name:UIDeviceOrientationDidChangeNotification object:nil]; @@ -257,8 +251,8 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (void)dealloc { - _collectionView.delegate = nil; - _collectionView.dataSource = nil; + self.collectionView.delegate = nil; + self.collectionView.dataSource = nil; [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil]; } @@ -268,7 +262,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (void)setBounds:(CGRect)bounds { [super setBounds:bounds]; - if (!CGRectIsEmpty(bounds) && self.animator.state == FSCalendarTransitionStateIdle) { + if (!CGRectIsEmpty(bounds) && self.transitionCoordinator.state == FSCalendarTransitionStateIdle) { [self invalidateViewFrames]; } } @@ -276,63 +270,87 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (void)setFrame:(CGRect)frame { [super setFrame:frame]; - if (!CGRectIsEmpty(frame) && self.animator.state == FSCalendarTransitionStateIdle) { + if (!CGRectIsEmpty(frame) && self.transitionCoordinator.state == FSCalendarTransitionStateIdle) { [self invalidateViewFrames]; } } +- (void)setValue:(id)value forUndefinedKey:(NSString *)key +{ +#if !TARGET_INTERFACE_BUILDER + if ([key hasPrefix:@"fake"]) { + return; + } +#endif + if (key.length) { + NSString *setter = [NSString stringWithFormat:@"set%@%@:",[key substringToIndex:1].uppercaseString,[key substringFromIndex:1]]; + SEL selector = NSSelectorFromString(setter); + if ([self.appearance respondsToSelector:selector]) { + return [self.appearance setValue:value forKey:key]; + } else if ([self.collectionViewLayout respondsToSelector:selector]) { + return [self.collectionViewLayout setValue:value forKey:key]; + } + } + + return [super setValue:value forUndefinedKey:key]; + +} + - (void)layoutSubviews { [super layoutSubviews]; - _supressEvent = YES; if (_needsAdjustingViewFrame) { + _needsAdjustingViewFrame = NO; - BOOL needsAdjustingBoundingRect = self.scope == FSCalendarScopeMonth && !_showsPlaceholders && !self.hasValidateVisibleLayout; + if (CGSizeEqualToSize(_transitionCoordinator.cachedMonthSize, CGSizeZero)) { + _transitionCoordinator.cachedMonthSize = self.frame.size; + } - _contentView.frame = self.bounds; + BOOL needsAdjustingBoundingRect = (self.scope == FSCalendarScopeMonth) && + (self.placeholderType != FSCalendarPlaceholderTypeFillSixRows) && + !self.hasValidateVisibleLayout; + + if (_scopeHandle) { + CGFloat scopeHandleHeight = self.transitionCoordinator.cachedMonthSize.height*0.08; + _contentView.frame = CGRectMake(0, 0, self.fs_width, self.fs_height-scopeHandleHeight); + _scopeHandle.frame = CGRectMake(0, _contentView.fs_bottom, self.fs_width, scopeHandleHeight); + } else { + _contentView.frame = self.bounds; + } - if (_needsLayoutForWeekMode) _scope = FSCalendarScopeMonth; - CGFloat headerHeight = self.preferredHeaderHeight; CGFloat weekdayHeight = self.preferredWeekdayHeight; CGFloat rowHeight = self.preferredRowHeight; - CGFloat weekdayWidth = self.contentView.fs_width/_weekdays.count; - CGFloat padding = weekdayHeight*0.1; + CGFloat padding = 5; if (self.scrollDirection == UICollectionViewScrollDirectionHorizontal) { - padding = FSCalendarFloor(padding); rowHeight = FSCalendarFloor(rowHeight*2)*0.5; // Round to nearest multiple of 0.5. e.g. (16.8->16.5),(16.2->16.0) } - if (_needsLayoutForWeekMode) _scope = FSCalendarScopeWeek; - - _header.frame = CGRectMake(0, 0, self.fs_width, headerHeight); - [_weekdays enumerateObjectsUsingBlock:^(UILabel *weekdayLabel, NSUInteger index, BOOL *stop) { - weekdayLabel.frame = CGRectMake(index*weekdayWidth, - _header.fs_height, - weekdayWidth, - weekdayHeight); - }]; + self.calendarHeaderView.frame = CGRectMake(0, 0, self.fs_width, headerHeight); + self.calendarWeekdayView.frame = CGRectMake(0, self.calendarHeaderView.fs_bottom, self.contentView.fs_width, weekdayHeight); - _deliver.frame = CGRectMake(_header.fs_left, _header.fs_top, _header.fs_width, headerHeight+weekdayHeight); - _deliver.hidden = _header.hidden; + _deliver.frame = CGRectMake(self.calendarHeaderView.fs_left, self.calendarHeaderView.fs_top, self.calendarHeaderView.fs_width, headerHeight+weekdayHeight); + _deliver.hidden = self.calendarHeaderView.hidden; if (!self.floatingMode) { - switch (_scope) { + switch (self.transitionCoordinator.representingScope) { case FSCalendarScopeMonth: { CGFloat contentHeight = rowHeight*6 + padding*2; - _daysContainer.frame = CGRectMake(0, headerHeight+weekdayHeight, self.fs_width, contentHeight); - _collectionView.frame = _daysContainer.bounds; + CGFloat currentHeight = rowHeight*[self.calculator numberOfRowsInMonth:self.currentPage] + padding*2; + _daysContainer.frame = CGRectMake(0, headerHeight+weekdayHeight, self.fs_width, currentHeight); + _collectionView.frame = CGRectMake(0, 0, _daysContainer.fs_width, contentHeight); if (needsAdjustingBoundingRect) { - self.animator.state = FSCalendarTransitionStateInProgress; - [self boundingRectWillChange:NO]; - self.animator.state = FSCalendarTransitionStateIdle; + self.transitionCoordinator.state = FSCalendarTransitionStateChanging; + CGRect boundingRect = (CGRect){CGPointZero,[self sizeThatFits:self.frame.size]}; + [self.delegateProxy calendar:self boundingRectWillChange:boundingRect animated:NO]; + self.transitionCoordinator.state = FSCalendarTransitionStateIdle; } break; } case FSCalendarScopeWeek: { CGFloat contentHeight = rowHeight + padding*2; _daysContainer.frame = CGRectMake(0, headerHeight+weekdayHeight, self.fs_width, contentHeight); - _collectionView.frame = _daysContainer.bounds; + _collectionView.frame = CGRectMake(0, 0, _daysContainer.fs_width, contentHeight); break; } } @@ -343,64 +361,38 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { _collectionView.frame = _daysContainer.bounds; } + _topBorder.frame = CGRectMake(0, -1, self.fs_width, 1); _bottomBorder.frame = CGRectMake(0, self.fs_height, self.fs_width, 1); + _scopeHandle.fs_bottom = _bottomBorder.fs_top; } - if (_needsAdjustingTextSize) { - _needsAdjustingTextSize = NO; - [_appearance adjustTitleIfNecessary]; - } if (_needsLayoutForWeekMode) { _needsLayoutForWeekMode = NO; - _scope = FSCalendarScopeWeek; - [self.animator performScopeTransitionFromScope:FSCalendarScopeMonth toScope:FSCalendarScopeWeek animated:NO]; - } else { - if (_needsAdjustingMonthPosition) { - _needsAdjustingMonthPosition = NO; - _supressEvent = NO; - BOOL oldValue = [CATransaction disableActions]; - [CATransaction setDisableActions:YES]; - [self scrollToPageForDate:_pagingEnabled?_currentPage:(_currentPage?:self.selectedDate) animated:NO]; - [CATransaction setDisableActions:oldValue]; - } + [self.transitionCoordinator performScopeTransitionFromScope:FSCalendarScopeMonth toScope:FSCalendarScopeWeek animated:NO]; } - _supressEvent = NO; - -} - -- (void)layoutSublayersOfLayer:(CALayer *)layer -{ - [super layoutSublayersOfLayer:layer]; - if (layer == self.layer) { - if (_needsAdjustingViewFrame) { - _needsAdjustingViewFrame = NO; - - CGSize size = [self sizeThatFits:self.frame.size]; - _maskLayer.frame = self.bounds; - _maskLayer.path = [UIBezierPath bezierPathWithRect:(CGRect){CGPointZero,size}].CGPath; - - } - } } #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]]; + NSDateComponents *components = [self.gregorian components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:date]; + components.day = _appearance.fakedSelectedDay?:1; + [_selectedDates addObject:[self.gregorian dateFromComponents:components]]; + [self.collectionView reloadData]; } #endif - (CGSize)sizeThatFits:(CGSize)size { - switch (self.animator.transition) { + switch (self.transitionCoordinator.transition) { case FSCalendarTransitionNone: return [self sizeThatFits:size scope:_scope]; case FSCalendarTransitionWeekToMonth: - if (self.animator.state == FSCalendarTransitionStateInProgress) { + if (self.transitionCoordinator.state == FSCalendarTransitionStateChanging) { return [self sizeThatFits:size scope:FSCalendarScopeMonth]; } case FSCalendarTransitionMonthToWeek: @@ -414,16 +406,18 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { CGFloat headerHeight = self.preferredHeaderHeight; CGFloat weekdayHeight = self.preferredWeekdayHeight; CGFloat rowHeight = self.preferredRowHeight; - CGFloat paddings = weekdayHeight * 0.2; + CGFloat paddings = self.collectionViewLayout.sectionInsets.top + self.collectionViewLayout.sectionInsets.bottom; if (!self.floatingMode) { switch (scope) { case FSCalendarScopeMonth: { - CGFloat height = weekdayHeight + headerHeight + [self numberOfRowsInMonth:_currentPage]*rowHeight + paddings; + CGFloat height = weekdayHeight + headerHeight + [self.calculator numberOfRowsInMonth:_currentPage]*rowHeight + paddings; + height += _scopeHandle.fs_height; return CGSizeMake(size.width, height); } case FSCalendarScopeWeek: { CGFloat height = weekdayHeight + headerHeight + rowHeight + paddings; + height += _scopeHandle.fs_height; return CGSizeMake(size.width, height); } } @@ -437,42 +431,56 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { - if (self.animator.transition == FSCalendarTransitionWeekToMonth) { - return [self monthsFromDate:[self beginingOfMonthOfDate:_minimumDate] toDate:_maximumDate] + 1; - } - switch (_scope) { - case FSCalendarScopeMonth: - return [self monthsFromDate:[self beginingOfMonthOfDate:_minimumDate] toDate:_maximumDate] + 1; - case FSCalendarScopeWeek: - return [self weeksFromDate:[self beginingOfWeekOfDate:_minimumDate] toDate:_maximumDate] + 1; - } + [self requestBoundingDatesIfNecessary]; + return self.calculator.numberOfSections; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - if (self.animator.transition == FSCalendarTransitionWeekToMonth && self.animator.state == FSCalendarTransitionStateInProgress) { - return 42; - } - if (!self.floatingMode) { - switch (_scope) { - case FSCalendarScopeMonth: { - return 42; - } - case FSCalendarScopeWeek: { - return 7; - } - } - } else { - NSDate *currentPage = [self dateByAddingMonths:section toDate:[self beginingOfMonthOfDate:_minimumDate]]; - NSInteger numberOfRows = [self numberOfRowsInMonth:currentPage]; + if (self.floatingMode) { + NSInteger numberOfRows = [self.calculator numberOfRowsInSection:section]; return numberOfRows * 7; } + switch (self.transitionCoordinator.representingScope) { + case FSCalendarScopeMonth: { + return 42; + } + case FSCalendarScopeWeek: { + return 7; + } + } return 7; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - FSCalendarCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + + switch (self.placeholderType) { + case FSCalendarPlaceholderTypeNone: { + if (self.transitionCoordinator.representingScope == FSCalendarScopeMonth && monthPosition != FSCalendarMonthPositionCurrent) { + return [collectionView dequeueReusableCellWithReuseIdentifier:FSCalendarBlankCellReuseIdentifier forIndexPath:indexPath]; + } + break; + } + case FSCalendarPlaceholderTypeFillHeadTail: { + if (self.transitionCoordinator.representingScope == FSCalendarScopeMonth) { + if (indexPath.item >= 7 * [self.calculator numberOfRowsInSection:indexPath.section]) { + return [collectionView dequeueReusableCellWithReuseIdentifier:FSCalendarBlankCellReuseIdentifier forIndexPath:indexPath]; + } + } + break; + } + case FSCalendarPlaceholderTypeFillSixRows: { + break; + } + } + + NSDate *date = [self.calculator dateForIndexPath:indexPath]; + FSCalendarCell *cell = [self.dataSourceProxy calendar:self cellForDate:date atMonthPosition:monthPosition]; + if (!cell) { + cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:FSCalendarDefaultCellReuseIdentifier forIndexPath:indexPath]; + } [self reloadDataForCell:cell atIndexPath:indexPath]; return cell; } @@ -483,147 +491,130 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { if ([kind isEqualToString:UICollectionElementKindSectionHeader]) { FSCalendarStickyHeader *stickyHeader = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header" forIndexPath:indexPath]; stickyHeader.calendar = self; - stickyHeader.month = [self dateByAddingMonths:indexPath.section toDate:[self beginingOfMonthOfDate:_minimumDate]]; + stickyHeader.month = [self.gregorian dateByAddingUnit:NSCalendarUnitMonth value:indexPath.section toDate:[self.gregorian fs_firstDayOfMonth:_minimumDate] options:0]; + self.visibleSectionHeaders[indexPath] = stickyHeader; [stickyHeader setNeedsLayout]; - NSArray *allKeys = [_stickyHeaderMapTable.dictionaryRepresentation allKeysForObject:stickyHeader]; - if (allKeys.count) { - [allKeys enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) { - [_stickyHeaderMapTable removeObjectForKey:indexPath]; - }]; - } - [_stickyHeaderMapTable setObject:stickyHeader forKey:indexPath]; return stickyHeader; } } return [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"placeholderHeader" forIndexPath:indexPath]; } -#pragma mark - - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath +- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingSupplementaryView:(UICollectionReusableView *)view forElementOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath { - FSCalendarCell *cell = (FSCalendarCell *)[collectionView cellForItemAtIndexPath:indexPath]; - cell.dateIsSelected = YES; - [cell performSelecting]; - NSDate *selectedDate = [self dateForIndexPath:indexPath]; - if (!_supressEvent) { - [self didSelectDate:selectedDate]; + if (self.floatingMode) { + if ([elementKind isEqualToString:UICollectionElementKindSectionHeader]) { + self.visibleSectionHeaders[indexPath] = nil; + } } - [self selectCounterpartDate:selectedDate]; } +#pragma mark - + - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath { - FSCalendarCell *cell = (FSCalendarCell *)[collectionView cellForItemAtIndexPath:indexPath]; - if (cell.dateIsPlaceholder) { - if (!_showsPlaceholders) return NO; - if ([self isDateInRange:cell.date]) { - [self selectDate:cell.date scrollToDate:YES forPlaceholder:YES]; - } else if (![self isDate:cell.date equalToDate:_currentPage toCalendarUnit:FSCalendarUnitMonth]){ - [self scrollToPageForDate:cell.date animated:YES]; - } + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + if (self.placeholderType == FSCalendarPlaceholderTypeNone && monthPosition != FSCalendarMonthPositionCurrent) { return NO; } - NSDate *targetDate = [self dateForIndexPath:indexPath]; - if ([self isDateSelected:targetDate]) { - // 这个if几乎不会调用到 - if (self.allowsMultipleSelection) { - if ([self collectionView:collectionView shouldDeselectItemAtIndexPath:indexPath]) { - [collectionView deselectItemAtIndexPath:indexPath animated:YES]; - [self collectionView:collectionView didDeselectItemAtIndexPath:indexPath]; - } - } else { - // 点击了已经选择的日期,直接触发事件 - [self didSelectDate:self.selectedDate]; - } - return NO; - } - BOOL shouldSelect = YES; - if (cell.date && [self isDateInRange:cell.date] && !_supressEvent) { - shouldSelect &= [self shouldSelectDate:cell.date]; - } - if (shouldSelect) { - if (!self.allowsMultipleSelection && self.selectedDate) { - [self deselectDate:self.selectedDate]; - } - } - return shouldSelect && [self isDateInRange:cell.date]; + NSDate *date = [self.calculator dateForIndexPath:indexPath]; + return [self isDateInRange:date] && (![self.delegateProxy respondsToSelector:@selector(calendar:shouldSelectDate:atMonthPosition:)] || [self.delegateProxy calendar:self shouldSelectDate:date atMonthPosition:monthPosition]); } -- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - if (!self.allowsMultipleSelection && self.selectedDate) { - NSIndexPath *selectedIndexPath = [self indexPathForDate:self.selectedDate]; - if (![indexPath isEqual:selectedIndexPath]) { - [self collectionView:collectionView didDeselectItemAtIndexPath:selectedIndexPath]; - return; + NSDate *selectedDate = [self.calculator dateForIndexPath:indexPath]; + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + FSCalendarCell *cell; + if (monthPosition == FSCalendarMonthPositionCurrent) { + cell = (FSCalendarCell *)[collectionView cellForItemAtIndexPath:indexPath]; + } else { + cell = [self cellForDate:selectedDate atMonthPosition:FSCalendarMonthPositionCurrent]; + NSIndexPath *indexPath = [collectionView indexPathForCell:cell]; + if (indexPath) { + [collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; } } - FSCalendarCell *cell = (FSCalendarCell *)[collectionView cellForItemAtIndexPath:indexPath]; - if (cell) { - cell.dateIsSelected = NO; - [cell setNeedsLayout]; + if (![_selectedDates containsObject:selectedDate]) { + cell.selected = YES; + [cell performSelecting]; } - NSDate *selectedDate = cell.date ?: [self dateForIndexPath:indexPath]; - [_selectedDates removeObject:selectedDate]; - [self deselectCounterpartDate:selectedDate]; - [self didDeselectDate:selectedDate]; + [self enqueueSelectedDate:selectedDate]; + [self.delegateProxy calendar:self didSelectDate:selectedDate atMonthPosition:monthPosition]; + [self selectCounterpartDate:selectedDate]; } - (BOOL)collectionView:(UICollectionView *)collectionView shouldDeselectItemAtIndexPath:(NSIndexPath *)indexPath { - if (!self.allowsMultipleSelection) { - NSIndexPath *selectedIndexPath = [self indexPathForDate:self.selectedDate]; - if (![indexPath isEqual:selectedIndexPath]) { - return [self collectionView:collectionView shouldDeselectItemAtIndexPath:selectedIndexPath]; - } + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + if (self.placeholderType == FSCalendarPlaceholderTypeNone && monthPosition != FSCalendarMonthPositionCurrent) { + return NO; } - FSCalendarCell *cell = (FSCalendarCell *)[collectionView cellForItemAtIndexPath:indexPath]; - return [self shouldDeselectDate:(cell.date?:[self dateForIndexPath:indexPath])]; + NSDate *date = [self.calculator dateForIndexPath:indexPath]; + return [self isDateInRange:date] && (![self.delegateProxy respondsToSelector:@selector(calendar:shouldDeselectDate:atMonthPosition:)]||[self.delegateProxy calendar:self shouldDeselectDate:date atMonthPosition:monthPosition]); } -- (void)collectionView:(UICollectionView *)collectionView willDisplaySupplementaryView:(UICollectionReusableView *)view forElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath +- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath { - if ([elementKind isEqualToString:UICollectionElementKindSectionHeader] && [view isKindOfClass:[FSCalendarStickyHeader class]]) { - [view setNeedsLayout]; + NSDate *selectedDate = [self.calculator dateForIndexPath:indexPath]; + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + FSCalendarCell *cell; + if (monthPosition == FSCalendarMonthPositionCurrent) { + cell = (FSCalendarCell *)[collectionView cellForItemAtIndexPath:indexPath]; + } else { + cell = [self cellForDate:selectedDate atMonthPosition:FSCalendarMonthPositionCurrent]; + NSIndexPath *indexPath = [collectionView indexPathForCell:cell]; + if (indexPath) { + [collectionView deselectItemAtIndexPath:indexPath animated:NO]; + } } + cell.selected = NO; + [cell configureAppearance]; + + [_selectedDates removeObject:selectedDate]; + [self.delegateProxy calendar:self didDeselectDate:selectedDate atMonthPosition:monthPosition]; + [self deselectCounterpartDate:selectedDate]; + +} + +- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath +{ + if (![cell isKindOfClass:[FSCalendarCell class]]) { + return; + } + NSDate *date = [self.calculator dateForIndexPath:indexPath]; + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + [self.delegateProxy calendar:self willDisplayCell:(FSCalendarCell *)cell forDate:date atMonthPosition:monthPosition]; } #pragma mark - - (void)scrollViewDidScroll:(UIScrollView *)scrollView { - if (_supressEvent) { - return; - } + if (!self.window) return; if (self.floatingMode && _collectionView.indexPathsForVisibleItems.count) { - if (!self.window) return; // Do nothing on bouncing if (_collectionView.contentOffset.y < 0 || _collectionView.contentOffset.y > _collectionView.contentSize.height-_collectionView.fs_height) { return; } NSDate *currentPage = _currentPage; - CGPoint significantPoint = CGPointMake(_collectionView.fs_width*0.5,MIN(self.preferredRowHeight*2.75, _collectionView.fs_height*0.5)+_collectionView.contentOffset.y); + CGPoint significantPoint = CGPointMake(_collectionView.fs_width*0.5,MIN(self.collectionViewLayout.estimatedItemSize.height*2.75, _collectionView.fs_height*0.5)+_collectionView.contentOffset.y); NSIndexPath *significantIndexPath = [_collectionView indexPathForItemAtPoint:significantPoint]; if (significantIndexPath) { - currentPage = [self dateByAddingMonths:significantIndexPath.section toDate:[self beginingOfMonthOfDate:_minimumDate]]; + currentPage = [self.gregorian dateByAddingUnit:NSCalendarUnitMonth value:significantIndexPath.section toDate:[self.gregorian fs_firstDayOfMonth:_minimumDate] options:0]; } else { - __block FSCalendarStickyHeader *significantHeader = nil; - [_stickyHeaderMapTable.dictionaryRepresentation.allValues enumerateObjectsUsingBlock:^(FSCalendarStickyHeader *header, NSUInteger idx, BOOL *stop) { - if (CGRectContainsPoint(header.frame, significantPoint)) { - significantHeader = header; - *stop = YES; - } - }]; + FSCalendarStickyHeader *significantHeader = [self.visibleStickyHeaders filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(FSCalendarStickyHeader * _Nonnull evaluatedObject, NSDictionary * _Nullable bindings) { + return CGRectContainsPoint(evaluatedObject.frame, significantPoint); + }]].firstObject; if (significantHeader) { currentPage = significantHeader.month; } } - if (![self isDate:currentPage equalToDate:_currentPage toCalendarUnit:FSCalendarUnitMonth]) { + if (![self.gregorian isDate:currentPage equalToDate:_currentPage toUnitGranularity:NSCalendarUnitMonth]) { [self willChangeValueForKey:@"currentPage"]; _currentPage = currentPage; - [self currentPageDidChange]; + [self.delegateProxy calendarCurrentPageDidChange:self]; [self didChangeValueForKey:@"currentPage"]; } @@ -639,7 +630,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { break; } } - _header.scrollOffset = scrollOffset; + _calendarHeaderView.scrollOffset = scrollOffset; } } @@ -648,46 +639,70 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { if (!_pagingEnabled || !_scrollEnabled) { return; } - CGFloat pannedOffset = 0, targetOffset = 0, currentOffset = 0, contentSize = 0; + CGFloat targetOffset = 0, contentSize = 0; switch (_collectionViewLayout.scrollDirection) { case UICollectionViewScrollDirectionHorizontal: { - pannedOffset = [scrollView.panGestureRecognizer translationInView:scrollView].x; targetOffset = targetContentOffset->x; - currentOffset = scrollView.contentOffset.x; contentSize = scrollView.fs_width; break; } case UICollectionViewScrollDirectionVertical: { - pannedOffset = [scrollView.panGestureRecognizer translationInView:scrollView].y; targetOffset = targetContentOffset->y; - currentOffset = scrollView.contentOffset.y; contentSize = scrollView.fs_height; break; } } - BOOL shouldTriggerPageChange = ((pannedOffset < 0 && targetOffset > currentOffset) || - (pannedOffset > 0 && targetOffset < currentOffset)) && _minimumDate; + + NSInteger sections = lrint(targetOffset/contentSize); + NSDate *targetPage = nil; + switch (_scope) { + case FSCalendarScopeMonth: { + NSDate *minimumPage = [self.gregorian fs_firstDayOfMonth:_minimumDate]; + targetPage = [self.gregorian dateByAddingUnit:NSCalendarUnitMonth value:sections toDate:minimumPage options:0]; + break; + } + case FSCalendarScopeWeek: { + NSDate *minimumPage = [self.gregorian fs_firstDayOfWeek:_minimumDate]; + targetPage = [self.gregorian dateByAddingUnit:NSCalendarUnitWeekOfYear value:sections toDate:minimumPage options:0]; + break; + } + } + BOOL shouldTriggerPageChange = [self isDateInDifferentPage:targetPage]; if (shouldTriggerPageChange) { NSDate *lastPage = _currentPage; [self willChangeValueForKey:@"currentPage"]; - switch (_scope) { - case FSCalendarScopeMonth: { - NSDate *minimumPage = [self beginingOfMonthOfDate:_minimumDate]; - _currentPage = [self dateByAddingMonths:targetOffset/contentSize toDate:minimumPage]; - break; - } - case FSCalendarScopeWeek: { - NSDate *minimumPage = [self beginingOfWeekOfDate:_minimumDate]; - _currentPage = [self dateByAddingWeeks:targetOffset/contentSize toDate:minimumPage]; - break; - } - } - [self currentPageDidChange]; - if (!_showsPlaceholders && self.animator.state == FSCalendarTransitionStateIdle) { - [self.animator performBoudingRectTransitionFromMonth:lastPage toMonth:_currentPage duration:0.25]; + _currentPage = targetPage; + [self.delegateProxy calendarCurrentPageDidChange:self]; + if (_placeholderType != FSCalendarPlaceholderTypeFillSixRows) { + [self.transitionCoordinator performBoundingRectTransitionFromMonth:lastPage toMonth:_currentPage duration:0.25]; } [self didChangeValueForKey:@"currentPage"]; } + + // Disable all inner gestures to avoid missing event + [scrollView.gestureRecognizers enumerateObjectsUsingBlock:^(__kindof UIGestureRecognizer * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj != scrollView.panGestureRecognizer) { + obj.enabled = NO; + } + }]; + +} + +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView +{ + // Recover all disabled gestures + [scrollView.gestureRecognizers enumerateObjectsUsingBlock:^(__kindof UIGestureRecognizer * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj != scrollView.panGestureRecognizer) { + obj.enabled = YES; + } + }]; +} + +#pragma mark - + +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer +{ + return YES; } #pragma mark - Notification @@ -699,18 +714,6 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { #pragma mark - Properties -- (void)setAppearance:(FSCalendarAppearance *)appearance -{ - if (_appearance != appearance) { - _appearance = appearance; - } -} - -- (FSCalendarAppearance *)appearance -{ - return _appearance; -} - - (void)setScrollDirection:(FSCalendarScrollDirection)scrollDirection { if (_scrollDirection != scrollDirection) { @@ -720,17 +723,14 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { switch (_scope) { case FSCalendarScopeMonth: { - _supressEvent = YES; - _collectionViewLayout.scrollDirection = (UICollectionViewScrollDirection)scrollDirection; - _header.scrollDirection = _collectionViewLayout.scrollDirection; + _calendarHeaderView.scrollDirection = _collectionViewLayout.scrollDirection; if (self.hasValidateVisibleLayout) { [_collectionView reloadData]; - [_header reloadData]; + [_calendarHeaderView reloadData]; } - _needsAdjustingMonthPosition = YES; + _needsAdjustingViewFrame = YES; [self setNeedsLayout]; - _supressEvent = NO; break; } case FSCalendarScopeWeek: { @@ -740,6 +740,11 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { } } ++ (BOOL)automaticallyNotifiesObserversOfScope +{ + return NO; +} + - (void)setScope:(FSCalendarScope)scope { [self setScope:scope animated:NO]; @@ -749,40 +754,26 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { { if (_firstWeekday != firstWeekday) { _firstWeekday = firstWeekday; + _needsRequestingBoundingDates = YES; [self invalidateDateTools]; - [self invalidateWeekdaySymbols]; - if (self.hasValidateVisibleLayout) { - [_collectionView reloadData]; - } + [self invalidateHeaders]; + [self.collectionView reloadData]; + [self configureAppearance]; } } - (void)setToday:(NSDate *)today { - if ([self daysFromDate:_minimumDate toDate:today] < 0) { - today = _minimumDate.copy; - } else if ([self daysFromDate:_maximumDate toDate:today] > 0) { - today = _maximumDate.copy; + if (!today) { + _today = nil; + } else { + FSCalendarAssertDateInBounds(today,self.gregorian,self.minimumDate,self.maximumDate); + _today = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:today options:0]; } - if (![self isDateInToday:today]) { - _today = [self dateByIgnoringTimeComponentsOfDate:today]; - switch (_scope) { - case FSCalendarScopeMonth: { - _currentPage = [self beginingOfMonthOfDate:today]; - break; - } - case FSCalendarScopeWeek: { - _currentPage = [self beginingOfWeekOfDate:today]; - break; - } - } - _needsAdjustingMonthPosition = YES; - [self setNeedsLayout]; - - [_collectionView.visibleCells makeObjectsPerformSelector:@selector(setDateIsToday:) withObject:@NO]; - [[_collectionView cellForItemAtIndexPath:[self indexPathForDate:today]] setValue:@YES forKey:@"dateIsToday"]; - [_collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; - + if (self.hasValidateVisibleLayout) { + [self.visibleCells makeObjectsPerformSelector:@selector(setDateIsToday:) withObject:nil]; + if (today) [[_collectionView cellForItemAtIndexPath:[self.calculator indexPathForDate:today]] setValue:@YES forKey:@"dateIsToday"]; + [self.visibleCells makeObjectsPerformSelector:@selector(configureAppearance)]; } } @@ -793,17 +784,78 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (void)setCurrentPage:(NSDate *)currentPage animated:(BOOL)animated { - if ([self daysFromDate:_minimumDate toDate:currentPage] < 0) { - currentPage = _minimumDate.copy; - } else if ([self daysFromDate:_maximumDate toDate:currentPage] > 0) { - currentPage = _maximumDate.copy; - } + [self requestBoundingDatesIfNecessary]; if (self.floatingMode || [self isDateInDifferentPage:currentPage]) { - currentPage = [self dateByIgnoringTimeComponentsOfDate:currentPage]; - [self scrollToPageForDate:currentPage animated:animated]; + currentPage = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:currentPage options:0]; + if ([self isPageInRange:currentPage]) { + [self scrollToPageForDate:currentPage animated:animated]; + } } } +- (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identifier +{ + if (!identifier.length) { + [NSException raise:FSCalendarInvalidArgumentsExceptionName format:@"This identifier must not be nil and must not be an empty string."]; + } + if (![cellClass isSubclassOfClass:[FSCalendarCell class]]) { + [NSException raise:@"The cell class must be a subclass of FSCalendarCell." format:@""]; + } + if ([identifier isEqualToString:FSCalendarBlankCellReuseIdentifier]) { + [NSException raise:FSCalendarInvalidArgumentsExceptionName format:@"Do not use %@ as the cell reuse identifier.", identifier]; + } + [self.collectionView registerClass:cellClass forCellWithReuseIdentifier:identifier]; + +} + +- (FSCalendarCell *)dequeueReusableCellWithIdentifier:(NSString *)identifier forDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position; +{ + if (!identifier.length) { + [NSException raise:FSCalendarInvalidArgumentsExceptionName format:@"This identifier must not be nil and must not be an empty string."]; + } + NSIndexPath *indexPath = [self.calculator indexPathForDate:date atMonthPosition:position]; + if (!indexPath) { + [NSException raise:FSCalendarInvalidArgumentsExceptionName format:@"Attempting to dequeue a cell with invalid date."]; + } + FSCalendarCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath]; + return cell; +} + +- (nullable FSCalendarCell *)cellForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position +{ + NSIndexPath *indexPath = [self.calculator indexPathForDate:date atMonthPosition:position]; + return (FSCalendarCell *)[self.collectionView cellForItemAtIndexPath:indexPath]; +} + +- (NSDate *)dateForCell:(FSCalendarCell *)cell +{ + NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell]; + return [self.calculator dateForIndexPath:indexPath]; +} + +- (FSCalendarMonthPosition)monthPositionForCell:(FSCalendarCell *)cell +{ + NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell]; + return [self.calculator monthPositionForIndexPath:indexPath]; +} + +- (NSArray *)visibleCells +{ + return [self.collectionView.visibleCells filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { + return [evaluatedObject isKindOfClass:[FSCalendarCell class]]; + }]]; +} + +- (CGRect)frameForDate:(NSDate *)date +{ + if (!self.superview) { + return CGRectZero; + } + CGRect frame = [_collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calculator indexPathForDate:date]].frame; + frame = [self.superview convertRect:frame fromView:_collectionView]; + return frame; +} + - (void)setHeaderHeight:(CGFloat)headerHeight { if (_headerHeight != headerHeight) { @@ -822,50 +874,18 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { } } -- (void)setDataSource:(id)dataSource -{ - if (![_dataSource isEqual:dataSource]) { - _dataSource = dataSource; - _minimumDate = self.minimumDateForCalendar; - _maximumDate = self.maximumDateForCalendar; - } -} - - (void)setLocale:(NSLocale *)locale { if (![_locale isEqual:locale]) { - _locale = locale; + _locale = locale.copy; [self invalidateDateTools]; - [self invalidateWeekdaySymbols]; + [self configureAppearance]; if (self.hasValidateVisibleLayout) { [self invalidateHeaders]; } } } -- (void)setIdentifier:(NSString *)identifier -{ - if (![identifier isEqualToString:_calendar.calendarIdentifier]) { - self.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:identifier]; - [self invalidateDateTools]; - [self invalidateWeekdaySymbols]; - if (self.hasValidateVisibleLayout) { - [self reloadData]; - } - _minimumDate = [self dateByIgnoringTimeComponentsOfDate:_minimumDate]; - _currentPage = [self dateByIgnoringTimeComponentsOfDate:_currentPage]; - BOOL suppress = _supressEvent; - _supressEvent = YES; - [self scrollToPageForDate:_today animated:NO]; - _supressEvent = suppress; - } -} - -- (NSString *)identifier -{ - return _calendar.calendarIdentifier; -} - - (void)setAllowsMultipleSelection:(BOOL)allowsMultipleSelection { _collectionView.allowsMultipleSelection = allowsMultipleSelection; @@ -901,7 +921,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { _scrollEnabled = scrollEnabled; _collectionView.scrollEnabled = scrollEnabled; - _header.scrollEnabled = scrollEnabled; + _calendarHeaderView.scrollEnabled = scrollEnabled; [self invalidateLayout]; } @@ -913,17 +933,11 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { _orientation = orientation; _needsAdjustingViewFrame = YES; - _needsAdjustingMonthPosition = YES; - _needsAdjustingTextSize = YES; _preferredWeekdayHeight = FSCalendarAutomaticDimension; _preferredRowHeight = FSCalendarAutomaticDimension; _preferredHeaderHeight = FSCalendarAutomaticDimension; - [self.visibleStickyHeaders setValue:@YES forKey:@"needsAdjustingViewFrame"]; - [_collectionView.visibleCells setValue:@YES forKey:@"needsAdjustingViewFrame"]; - [self.visibleStickyHeaders makeObjectsPerformSelector:@selector(setNeedsLayout)]; - [_collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; - _header.needsAdjustingViewFrame = YES; - [_collectionViewLayout invalidateLayout]; + _calendarHeaderView.needsAdjustingMonthPosition = YES; + _calendarHeaderView.needsAdjustingViewFrame = YES; [self setNeedsLayout]; } } @@ -943,8 +957,9 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { if (_headerHeight == FSCalendarAutomaticDimension) { if (_preferredWeekdayHeight == FSCalendarAutomaticDimension) { if (!self.floatingMode) { - CGFloat divider = _scope == FSCalendarScopeMonth ? FSCalendarStandardMonthlyPageHeight : FSCalendarStandardWeeklyPageHeight; - _preferredHeaderHeight = (FSCalendarStandardHeaderHeight/divider)*self.fs_height; + CGFloat DIYider = FSCalendarStandardMonthlyPageHeight; + CGFloat contentHeight = self.transitionCoordinator.cachedMonthSize.height*(1-_showsScopeHandle*0.08); + _preferredHeaderHeight = (FSCalendarStandardHeaderHeight/DIYider)*contentHeight; _preferredHeaderHeight -= (_preferredHeaderHeight-FSCalendarStandardHeaderHeight)*0.5; } else { _preferredHeaderHeight = FSCalendarStandardHeaderHeight*MAX(1, FSCalendarDeviceIsIPad*1.5); @@ -960,8 +975,9 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { if (_weekdayHeight == FSCalendarAutomaticDimension) { if (_preferredWeekdayHeight == FSCalendarAutomaticDimension) { if (!self.floatingMode) { - CGFloat divider = _scope == FSCalendarScopeMonth ? FSCalendarStandardMonthlyPageHeight : FSCalendarStandardWeeklyPageHeight; - _preferredWeekdayHeight = (FSCalendarStandardWeekdayHeight/divider)*self.fs_height; + CGFloat DIYider = FSCalendarStandardMonthlyPageHeight; + CGFloat contentHeight = self.transitionCoordinator.cachedMonthSize.height*(1-_showsScopeHandle*0.08); + _preferredWeekdayHeight = (FSCalendarStandardWeekdayHeight/DIYider)*contentHeight; } else { _preferredWeekdayHeight = FSCalendarStandardWeekdayHeight*MAX(1, FSCalendarDeviceIsIPad*1.5); } @@ -976,100 +992,119 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { if (_preferredRowHeight == FSCalendarAutomaticDimension) { CGFloat headerHeight = self.preferredHeaderHeight; CGFloat weekdayHeight = self.preferredWeekdayHeight; - CGFloat contentHeight = self.fs_height-headerHeight-weekdayHeight; - CGFloat padding = weekdayHeight*0.1; - if (self.collectionViewLayout.scrollDirection == UICollectionViewScrollDirectionHorizontal) { - padding = FSCalendarFloor(padding); - } + CGFloat contentHeight = self.transitionCoordinator.cachedMonthSize.height-headerHeight-weekdayHeight-_scopeHandle.fs_height; + CGFloat padding = 5; if (!self.floatingMode) { - switch (_scope) { - case FSCalendarScopeMonth: { - _preferredRowHeight = _showsPlaceholders ? (contentHeight-padding*2)/6.0 : FSCalendarStandardRowHeight; - break; - } - case FSCalendarScopeWeek: { - _preferredRowHeight = _showsPlaceholders ? contentHeight-padding*2 : FSCalendarStandardRowHeight; - break; - } - } + _preferredRowHeight = (contentHeight-padding*2)/6.0; } else { - _preferredRowHeight = FSCalendarStandardRowHeight*MAX(1, FSCalendarDeviceIsIPad*1.5); + _preferredRowHeight = _rowHeight; } } return _preferredRowHeight; } -- (id)delegateAppearance -{ - if (_delegate && [_delegate conformsToProtocol:@protocol(FSCalendarDelegateAppearance)]) { - return (id)_delegate; - } - return nil; -} - - (BOOL)floatingMode { - return _scrollEnabled && !_pagingEnabled; + return _scope == FSCalendarScopeMonth && _scrollEnabled && !_pagingEnabled; } -#pragma mark - Public +- (void)setShowsScopeHandle:(BOOL)showsScopeHandle +{ + if (_showsScopeHandle != showsScopeHandle) { + _showsScopeHandle = showsScopeHandle; + [self invalidateLayout]; + } +} + +- (UIPanGestureRecognizer *)scopeGesture +{ + if (!_scopeGesture) { + UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self.transitionCoordinator action:@selector(handleScopeGesture:)]; + panGesture.delegate = self.transitionCoordinator; + panGesture.minimumNumberOfTouches = 1; + panGesture.maximumNumberOfTouches = 2; + panGesture.enabled = NO; + [self.daysContainer addGestureRecognizer:panGesture]; + _scopeGesture = panGesture; + } + return _scopeGesture; +} + +- (UILongPressGestureRecognizer *)swipeToChooseGesture +{ + if (!_swipeToChooseGesture) { + UILongPressGestureRecognizer *pressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeToChoose:)]; + pressGesture.enabled = NO; + pressGesture.numberOfTapsRequired = 0; + pressGesture.numberOfTouchesRequired = 1; + pressGesture.minimumPressDuration = 0.7; + [self.daysContainer addGestureRecognizer:pressGesture]; + [self.collectionView.panGestureRecognizer requireGestureRecognizerToFail:pressGesture]; + _swipeToChooseGesture = pressGesture; + } + return _swipeToChooseGesture; +} + +- (void)setDataSource:(id)dataSource +{ + self.dataSourceProxy.delegation = dataSource; +} + +- (id)dataSource +{ + return self.dataSourceProxy.delegation; +} + +- (void)setDelegate:(id)delegate +{ + self.delegateProxy.delegation = delegate; +} + +- (id)delegate +{ + return self.delegateProxy.delegation; +} + +#pragma mark - Public methods - (void)reloadData { - NSDate *minimumDate = self.minimumDateForCalendar; - NSDate *maximumDate = self.maximumDateForCalendar; - if (![self isDate:minimumDate equalToDate:_minimumDate toCalendarUnit:FSCalendarUnitMonth] || ![self isDate:maximumDate equalToDate:_maximumDate toCalendarUnit:FSCalendarUnitMonth]) { - _minimumDate = minimumDate; - _maximumDate = maximumDate; - [_collectionView reloadData]; - [_header.collectionView reloadData]; - [self setNeedsLayout]; - + _needsRequestingBoundingDates = YES; + if ([self requestBoundingDatesIfNecessary] || !self.collectionView.indexPathsForVisibleItems.count) { + [self invalidateHeaders]; + [self.collectionView reloadData]; } else { - [self reloadVisibleCells]; + [UIView performWithoutAnimation:^{ + [self.collectionView reloadItemsAtIndexPaths:self.collectionView.indexPathsForVisibleItems]; + }]; } - - [self invalidateWeekdayFont]; - [self invalidateWeekdayTextColor]; - [self invalidateWeekdaySymbols]; - [self invalidateHeaders]; } - (void)setScope:(FSCalendarScope)scope animated:(BOOL)animated { - if (_scope != scope) { - -#define m_set_scope \ - [self willChangeValueForKey:@"scope"]; \ - _scope = scope; \ - [self didChangeValueForKey:@"scope"]; \ - - if (self.floatingMode) { - m_set_scope - return; - } - - FSCalendarScope prevScope = _scope; - - if (!self.hasValidateVisibleLayout && prevScope == FSCalendarScopeMonth && scope == FSCalendarScopeWeek) { - m_set_scope - _needsLayoutForWeekMode = YES; - [self setNeedsLayout]; - return; - } - - if (self.animator.state == FSCalendarTransitionStateIdle) { - m_set_scope - [self.animator performScopeTransitionFromScope:prevScope toScope:scope animated:animated]; - } - + if (self.floatingMode) return; + if (self.transitionCoordinator.state != FSCalendarTransitionStateIdle) return; + + FSCalendarScope prevScope = _scope; + [self willChangeValueForKey:@"scope"]; + _scope = scope; + [self didChangeValueForKey:@"scope"]; + + if (prevScope == scope) return; + + if (!self.hasValidateVisibleLayout && prevScope == FSCalendarScopeMonth && scope == FSCalendarScopeWeek) { + _needsLayoutForWeekMode = YES; + [self setNeedsLayout]; + } else if (self.transitionCoordinator.state == FSCalendarTransitionStateIdle) { + [self.transitionCoordinator performScopeTransitionFromScope:prevScope toScope:scope animated:animated]; } + } -- (void)setShowsPlaceholders:(BOOL)showsPlaceholders +- (void)setPlaceholderType:(FSCalendarPlaceholderType)placeholderType { - if (_showsPlaceholders != showsPlaceholders) { - _showsPlaceholders = showsPlaceholders; + if (_placeholderType != placeholderType) { + _placeholderType = placeholderType; if (self.hasValidateVisibleLayout) { _preferredRowHeight = FSCalendarAutomaticDimension; [_collectionView reloadData]; @@ -1084,53 +1119,48 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate { - [self selectDate:date scrollToDate:scrollToDate forPlaceholder:NO]; + [self selectDate:date scrollToDate:scrollToDate atMonthPosition:FSCalendarMonthPositionCurrent]; } - (void)deselectDate:(NSDate *)date { - date = [self dateByIgnoringTimeComponentsOfDate:date]; + date = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:date options:0]; if (![_selectedDates containsObject:date]) { return; } [_selectedDates removeObject:date]; - NSIndexPath *indexPath = [self indexPathForDate:date]; + [self deselectCounterpartDate:date]; + NSIndexPath *indexPath = [self.calculator indexPathForDate:date]; if ([_collectionView.indexPathsForSelectedItems containsObject:indexPath]) { [_collectionView deselectItemAtIndexPath:indexPath animated:YES]; FSCalendarCell *cell = (FSCalendarCell *)[_collectionView cellForItemAtIndexPath:indexPath]; - cell.dateIsSelected = NO; - [cell setNeedsLayout]; - [self deselectCounterpartDate:date]; + cell.selected = NO; + [cell configureAppearance]; } } -- (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate forPlaceholder:(BOOL)forPlaceholder +- (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate atMonthPosition:(FSCalendarMonthPosition)monthPosition { - if (!self.allowsSelection) { - return; - } - if ([self daysFromDate:_minimumDate toDate:date] < 0) { - date = _minimumDate.copy; - } else if ([self daysFromDate:_maximumDate toDate:date] > 0) { - date = _maximumDate.copy; - } - NSDate *targetDate = [self dateByIgnoringTimeComponentsOfDate:date]; - NSIndexPath *targetIndexPath = [self indexPathForDate:targetDate]; + if (!self.allowsSelection || !date) return; + + [self requestBoundingDatesIfNecessary]; - BOOL shouldSelect = !_supressEvent; + FSCalendarAssertDateInBounds(date,self.gregorian,self.minimumDate,self.maximumDate); + + NSDate *targetDate = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:date options:0]; + NSIndexPath *targetIndexPath = [self.calculator indexPathForDate:targetDate]; + + BOOL shouldSelect = YES; // 跨月份点击 - if (forPlaceholder) { + if (monthPosition==FSCalendarMonthPositionPrevious||monthPosition==FSCalendarMonthPositionNext) { if (self.allowsMultipleSelection) { - // 处理多选模式 if ([self isDateSelected:targetDate]) { - // 已经选中的日期,是否应该反选,如果不应该,则不切换月份,不选中 - BOOL shouldDeselect = [self shouldDeselectDate:targetDate]; + BOOL shouldDeselect = ![self.delegateProxy respondsToSelector:@selector(calendar:shouldDeselectDate:atMonthPosition:)] || [self.delegateProxy calendar:self shouldDeselectDate:targetDate atMonthPosition:monthPosition]; if (!shouldDeselect) { return; } } else { - // 未选中的日期,判断是否应该选中,不应该选中则不切换月份,不选中 - shouldSelect &= [self shouldSelectDate:targetDate]; + shouldSelect &= (![self.delegateProxy respondsToSelector:@selector(calendar:shouldSelectDate:atMonthPosition:)] || [self.delegateProxy calendar:self shouldSelectDate:targetDate atMonthPosition:monthPosition]); if (!shouldSelect) { return; } @@ -1138,11 +1168,10 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { [self collectionView:_collectionView didSelectItemAtIndexPath:targetIndexPath]; } } else { - // 处理单选模式 - shouldSelect &= [self shouldSelectDate:targetDate]; + shouldSelect &= (![self.delegateProxy respondsToSelector:@selector(calendar:shouldSelectDate:atMonthPosition:)] || [self.delegateProxy calendar:self shouldSelectDate:targetDate atMonthPosition:monthPosition]); if (shouldSelect) { if ([self isDateSelected:targetDate]) { - [self didSelectDate:targetDate]; + [self.delegateProxy calendar:self didSelectDate:targetDate atMonthPosition:monthPosition]; } else { NSDate *selectedDate = self.selectedDate; if (selectedDate) { @@ -1157,30 +1186,33 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { } } else if (![self isDateSelected:targetDate]){ - // 调用代码选中未选中日期 if (self.selectedDate && !self.allowsMultipleSelection) { [self deselectDate:self.selectedDate]; } - [_collectionView selectItemAtIndexPath:targetIndexPath animated:YES scrollPosition:UICollectionViewScrollPositionNone]; + [_collectionView selectItemAtIndexPath:targetIndexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; FSCalendarCell *cell = (FSCalendarCell *)[_collectionView cellForItemAtIndexPath:targetIndexPath]; [cell performSelecting]; [self enqueueSelectedDate:targetDate]; [self selectCounterpartDate:targetDate]; } else if (![_collectionView.indexPathsForSelectedItems containsObject:targetIndexPath]) { - // 调用代码选中已选中日期 [_collectionView selectItemAtIndexPath:targetIndexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; } if (scrollToDate) { - // 如果跨月份点击日期,并且该日期不应该选中,则不跳转页面,其他情况均跳转 - if (forPlaceholder && !shouldSelect) { + if (!shouldSelect) { return; } [self scrollToPageForDate:targetDate animated:YES]; } } +- (void)handleScopeGesture:(UIPanGestureRecognizer *)sender +{ + if (self.floatingMode) return; + [self.transitionCoordinator handleScopeGesture:sender]; +} + #pragma mark - Private methods - (void)scrollToDate:(NSDate *)date @@ -1195,23 +1227,10 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { } animated &= _scrollEnabled; // No animation if _scrollEnabled == NO; - _supressEvent = !animated; - NSDate * targetDate = [self daysFromDate:_minimumDate toDate:date] < 0 ? _minimumDate : date; - targetDate = [self daysFromDate:_maximumDate toDate:targetDate] > 0 ? _maximumDate : targetDate; - NSInteger scrollOffset = 0; - switch (_scope) { - case FSCalendarScopeMonth: { - scrollOffset = [self monthsFromDate:[self beginingOfMonthOfDate:_minimumDate] toDate:targetDate]; - break; - } - case FSCalendarScopeWeek: { - scrollOffset = [self weeksFromDate:[self beginingOfWeekOfDate:_minimumDate] toDate:targetDate]; - break; - } - } + date = [self.calculator safeDateForDate:date]; + NSInteger scrollOffset = [self.calculator indexPathForDate:date atMonthPosition:FSCalendarMonthPositionCurrent].section; if (!self.floatingMode) { - switch (_collectionViewLayout.scrollDirection) { case UICollectionViewScrollDirectionVertical: { [_collectionView setContentOffset:CGPointMake(0, scrollOffset * _collectionView.fs_height) animated:animated]; @@ -1223,178 +1242,123 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { } } - } else { - // 全屏模式中,切换页面时需要将该月份提升到视图最上方 - if (self.hasValidateVisibleLayout) { - // Force layout to avoid crash on orientation changing - [_collectionViewLayout layoutAttributesForElementsInRect:_collectionView.bounds]; - CGRect headerFrame = [_collectionViewLayout layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionHeader atIndexPath:[NSIndexPath indexPathForItem:0 inSection:scrollOffset]].frame; - CGPoint targetOffset = CGPointMake(0, MIN(headerFrame.origin.y,MAX(0,_collectionView.contentSize.height-_collectionView.fs_bottom))); - [_collectionView setContentOffset:targetOffset animated:animated]; - - } else { - // 如果在loadView或者viewDidLoad中调用需要切换月份的方法, 这时UICollectionView并没有准备好自己的单元格和空间大小,这时不能直接调用setContentOffset,而是等到在layoutSubviews之后再去调用 - _currentPage = targetDate; - _needsAdjustingMonthPosition = YES; - [self setNeedsLayout]; - } - + } else if (self.hasValidateVisibleLayout) { + [_collectionViewLayout layoutAttributesForElementsInRect:_collectionView.bounds]; + CGRect headerFrame = [_collectionViewLayout layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionHeader atIndexPath:[NSIndexPath indexPathForItem:0 inSection:scrollOffset]].frame; + CGPoint targetOffset = CGPointMake(0, MIN(headerFrame.origin.y,MAX(0,_collectionViewLayout.collectionViewContentSize.height-_collectionView.fs_bottom))); + [_collectionView setContentOffset:targetOffset animated:animated]; } - - if (_header && !animated) { - _header.scrollOffset = scrollOffset; + if (!animated) { + self.calendarHeaderView.scrollOffset = scrollOffset; } - _supressEvent = NO; } - (void)scrollToPageForDate:(NSDate *)date animated:(BOOL)animated { - if (!_collectionView.tracking) { - if (!self.floatingMode) { - if ([self isDateInDifferentPage:date] && [self isDateInRange:date]) { - [self willChangeValueForKey:@"currentPage"]; - NSDate *lastPage = _currentPage; - switch (_scope) { - case FSCalendarScopeMonth: { - _currentPage = [self beginingOfMonthOfDate:date]; - break; - } - case FSCalendarScopeWeek: { - _currentPage = [self beginingOfWeekOfDate:date]; - break; - } - } - if (!_supressEvent && self.hasValidateVisibleLayout) { - _supressEvent = YES; - [self currentPageDidChange]; - if (!_showsPlaceholders && self.animator.state == FSCalendarTransitionStateIdle) { - [self.animator performBoudingRectTransitionFromMonth:lastPage toMonth:_currentPage duration:0.33]; - } - _supressEvent = NO; - } - [self didChangeValueForKey:@"currentPage"]; - } - [self scrollToDate:_currentPage animated:animated]; - } else { - [self scrollToDate:[self beginingOfMonthOfDate:date] animated:animated]; - } + if (!date) return; + if (![self isDateInRange:date]) { + date = [self.calculator safeDateForDate:date]; + if (!date) return; } -} - -- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath scope:(FSCalendarScope)scope -{ - switch (scope) { - case FSCalendarScopeMonth: { - NSDate *currentPage = [self dateByAddingMonths:indexPath.section toDate:[self beginingOfMonthOfDate:_minimumDate]]; - NSInteger numberOfHeadPlaceholders = [self numberOfHeadPlaceholdersForMonth:currentPage]; - NSDate *firstDateOfPage = [self dateBySubstractingDays:numberOfHeadPlaceholders fromDate:currentPage]; - switch (_collectionViewLayout.scrollDirection) { - case UICollectionViewScrollDirectionHorizontal: { - NSUInteger rows = indexPath.item % 6; - NSUInteger columns = indexPath.item / 6; - NSUInteger daysOffset = 7*rows + columns; - return [self dateByAddingDays:daysOffset toDate:firstDateOfPage]; - } - case UICollectionViewScrollDirectionVertical: { - NSUInteger daysOffset = indexPath.item; - return [self dateByAddingDays:daysOffset toDate:firstDateOfPage]; - } - } - break; - } - case FSCalendarScopeWeek: { - NSDate *currentPage = [self dateByAddingWeeks:indexPath.section toDate:[self beginingOfWeekOfDate:_minimumDate]]; - return [self dateByAddingDays:indexPath.item toDate:currentPage]; - } - } - return nil; -} - -- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath -{ - if (self.animator.transition == FSCalendarTransitionWeekToMonth && self.animator.state == FSCalendarTransitionStateInProgress) { - return [self dateForIndexPath:indexPath scope:FSCalendarScopeMonth]; - } - return [self dateForIndexPath:indexPath scope:_scope]; -} - -- (NSIndexPath *)indexPathForDate:(NSDate *)date scope:(FSCalendarScope)scope -{ - NSInteger item = 0; - NSInteger section = 0; - switch (scope) { - case FSCalendarScopeMonth: { - section = [self monthsFromDate:[self beginingOfMonthOfDate:_minimumDate] toDate:date]; - NSDate *firstDayOfMonth = [self beginingOfMonthOfDate:date]; - NSInteger numberOfHeadPlaceholders = [self numberOfHeadPlaceholdersForMonth:firstDayOfMonth]; - NSDate *firstDateOfPage = [self dateBySubstractingDays:numberOfHeadPlaceholders fromDate:firstDayOfMonth]; - switch (_collectionViewLayout.scrollDirection) { - case UICollectionViewScrollDirectionHorizontal: { - NSInteger vItem = [self daysFromDate:firstDateOfPage toDate:date]; - NSInteger rows = vItem/7; - NSInteger columns = vItem%7; - item = columns*6 + rows; + + if (!self.floatingMode) { + if ([self isDateInDifferentPage:date]) { + [self willChangeValueForKey:@"currentPage"]; + NSDate *lastPage = _currentPage; + switch (self.transitionCoordinator.representingScope) { + case FSCalendarScopeMonth: { + _currentPage = [self.gregorian fs_firstDayOfMonth:date]; break; } - case UICollectionViewScrollDirectionVertical: { - item = [self daysFromDate:firstDateOfPage toDate:date]; + case FSCalendarScopeWeek: { + _currentPage = [self.gregorian fs_firstDayOfWeek:date]; break; } } - break; - } - case FSCalendarScopeWeek: { - section = [self weeksFromDate:[self beginingOfWeekOfDate:_minimumDate] toDate:date]; - item = (([self weekdayOfDate:date] - _firstWeekday) + 7) % 7; - break; + if (self.hasValidateVisibleLayout) { + [self.delegateProxy calendarCurrentPageDidChange:self]; + if (_placeholderType != FSCalendarPlaceholderTypeFillSixRows && self.transitionCoordinator.state == FSCalendarTransitionStateIdle) { + [self.transitionCoordinator performBoundingRectTransitionFromMonth:lastPage toMonth:_currentPage duration:0.33]; + } + } + [self didChangeValueForKey:@"currentPage"]; } + [self scrollToDate:_currentPage animated:animated]; + } else { + [self scrollToDate:[self.gregorian fs_firstDayOfMonth:date] animated:animated]; } - return [NSIndexPath indexPathForItem:item inSection:section]; } -- (NSIndexPath *)indexPathForDate:(NSDate *)date -{ - return [self indexPathForDate:date scope:_scope]; -} - (BOOL)isDateInRange:(NSDate *)date { - BOOL flag = [self daysFromDate:_minimumDate toDate:date] >= 0; - flag &= [self daysFromDate:_maximumDate toDate:date] <= 0; + BOOL flag = YES; + flag &= [self.gregorian components:NSCalendarUnitDay fromDate:date toDate:self.minimumDate options:0].day <= 0; + flag &= [self.gregorian components:NSCalendarUnitDay fromDate:date toDate:self.maximumDate options:0].day >= 0;; + return flag; +} + +- (BOOL)isPageInRange:(NSDate *)page +{ + BOOL flag = YES; + switch (self.transitionCoordinator.representingScope) { + case FSCalendarScopeMonth: { + NSDateComponents *c1 = [self.gregorian components:NSCalendarUnitDay fromDate:[self.gregorian fs_firstDayOfMonth:self.minimumDate] toDate:page options:0]; + flag &= (c1.day>=0); + if (!flag) break; + NSDateComponents *c2 = [self.gregorian components:NSCalendarUnitDay fromDate:page toDate:[self.gregorian fs_lastDayOfMonth:self.maximumDate] options:0]; + flag &= (c2.day>=0); + break; + } + case FSCalendarScopeWeek: { + NSDateComponents *c1 = [self.gregorian components:NSCalendarUnitDay fromDate:[self.gregorian fs_firstDayOfWeek:self.minimumDate] toDate:page options:0]; + flag &= (c1.day>=0); + if (!flag) break; + NSDateComponents *c2 = [self.gregorian components:NSCalendarUnitDay fromDate:page toDate:[self.gregorian fs_lastDayOfWeek:self.maximumDate] options:0]; + flag &= (c2.day>=0); + break; + } + default: + break; + } return flag; } - (BOOL)isDateSelected:(NSDate *)date { - return [_selectedDates containsObject:date] || [_collectionView.indexPathsForSelectedItems containsObject:[self indexPathForDate:date]]; + return [_selectedDates containsObject:date] || [_collectionView.indexPathsForSelectedItems containsObject:[self.calculator indexPathForDate:date]]; } - (BOOL)isDateInDifferentPage:(NSDate *)date { if (self.floatingMode) { - return ![self isDate:date equalToDate:_currentPage toCalendarUnit:FSCalendarUnitMonth]; + return ![self.gregorian isDate:date equalToDate:_currentPage toUnitGranularity:NSCalendarUnitMonth]; } switch (_scope) { case FSCalendarScopeMonth: - return ![self isDate:date equalToDate:_currentPage toCalendarUnit:FSCalendarUnitMonth]; + return ![self.gregorian isDate:date equalToDate:_currentPage toUnitGranularity:NSCalendarUnitMonth]; case FSCalendarScopeWeek: - return ![self isDate:date equalToDate:_currentPage toCalendarUnit:FSCalendarUnitWeekOfYear]; + return ![self.gregorian isDate:date equalToDate:_currentPage toUnitGranularity:NSCalendarUnitWeekOfYear]; } } - (BOOL)hasValidateVisibleLayout { - return self.superview && !CGSizeEqualToSize(_collectionView.frame.size, CGSizeZero) && !CGSizeEqualToSize(_collectionView.contentSize, CGSizeZero); +#if TARGET_INTERFACE_BUILDER + return YES; +#else + return self.superview && !CGRectIsEmpty(_collectionView.frame) && !CGSizeEqualToSize(_collectionViewLayout.collectionViewContentSize, CGSizeZero); +#endif } - (void)invalidateDateTools { - _calendar.locale = _locale; - _calendar.timeZone = _timeZone; - _calendar.firstWeekday = _firstWeekday; - _components.calendar = _calendar; + _gregorian.locale = _locale; + _gregorian.timeZone = _timeZone; + _gregorian.firstWeekday = _firstWeekday; + _components.calendar = _gregorian; _components.timeZone = _timeZone; - _formatter.calendar = _calendar; + _formatter.calendar = _gregorian; _formatter.timeZone = _timeZone; _formatter.locale = _locale; } @@ -1403,20 +1367,27 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { { if (!self.floatingMode) { - if (!_header) { + if (!_calendarHeaderView) { - FSCalendarHeader *header = [[FSCalendarHeader alloc] initWithFrame:CGRectZero]; - header.calendar = self; - header.scrollEnabled = _scrollEnabled; - [_contentView addSubview:header]; - self.header = header; + FSCalendarHeaderView *headerView = [[FSCalendarHeaderView alloc] initWithFrame:CGRectZero]; + headerView.calendar = self; + headerView.scrollEnabled = _scrollEnabled; + [_contentView addSubview:headerView]; + self.calendarHeaderView = headerView; } + if (!_calendarWeekdayView) { + FSCalendarWeekdayView *calendarWeekdayView = [[FSCalendarWeekdayView alloc] initWithFrame:CGRectZero]; + calendarWeekdayView.calendar = self; + [_contentView addSubview:calendarWeekdayView]; + _calendarWeekdayView = calendarWeekdayView; + } + if (_scrollEnabled) { if (!_deliver) { FSCalendarHeaderTouchDeliver *deliver = [[FSCalendarHeaderTouchDeliver alloc] initWithFrame:CGRectZero]; - deliver.header = _header; + deliver.header = _calendarHeaderView; deliver.calendar = self; [_contentView addSubview:deliver]; self.deliver = deliver; @@ -1425,38 +1396,39 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { [_deliver removeFromSuperview]; } - if (!_weekdays.count) { - NSArray *weekSymbols = self.calendar.shortStandaloneWeekdaySymbols; - _weekdays = [NSMutableArray arrayWithCapacity:weekSymbols.count]; - UIFont *weekdayFont = _appearance.preferredWeekdayFont; - for (int i = 0; i < weekSymbols.count; i++) { - UILabel *weekdayLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - weekdayLabel.text = weekSymbols[i]; - weekdayLabel.textAlignment = NSTextAlignmentCenter; - weekdayLabel.font = weekdayFont; - weekdayLabel.textColor = _appearance.weekdayTextColor; - [_weekdays addObject:weekdayLabel]; - [_contentView addSubview:weekdayLabel]; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + if (self.showsScopeHandle) { + if (!_scopeHandle) { + FSCalendarScopeHandle *handle = [[FSCalendarScopeHandle alloc] initWithFrame:CGRectZero]; + handle.calendar = self; + [self addSubview:handle]; + self.scopeHandle = handle; + _needsAdjustingViewFrame = YES; + [self setNeedsLayout]; + } + } else { + if (_scopeHandle) { + [self.scopeHandle removeFromSuperview]; + _needsAdjustingViewFrame = YES; + [self setNeedsLayout]; } } +#pragma GCC diagnostic pop _collectionView.pagingEnabled = YES; _collectionViewLayout.scrollDirection = (UICollectionViewScrollDirection)self.scrollDirection; } else { - if (_header) { - [_header removeFromSuperview]; - } - if (_weekdays.count) { - [_weekdays makeObjectsPerformSelector:@selector(removeFromSuperview)]; - [_weekdays removeAllObjects]; - } + [self.calendarHeaderView removeFromSuperview]; + [self.deliver removeFromSuperview]; + [self.calendarWeekdayView removeFromSuperview]; + [self.scopeHandle removeFromSuperview]; _collectionView.pagingEnabled = NO; _collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionVertical; - [self deselectCounterpartDate:nil]; } _preferredHeaderHeight = FSCalendarAutomaticDimension; @@ -1466,124 +1438,159 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { [self setNeedsLayout]; } -- (void)invalidateWeekdaySymbols -{ - BOOL useVeryShortWeekdaySymbols = (_appearance.caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesSingleUpperCase; - NSArray *weekdaySymbols = useVeryShortWeekdaySymbols ? _calendar.veryShortStandaloneWeekdaySymbols : _calendar.shortStandaloneWeekdaySymbols; - BOOL useDefaultWeekdayCase = (_appearance.caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesDefaultCase; - [_weekdays enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger index, BOOL *stop) { - index += _firstWeekday-1; - index %= 7; - label.text = useDefaultWeekdayCase ? weekdaySymbols[index] : [weekdaySymbols[index] uppercaseString]; - }]; - if (self.visibleStickyHeaders.count) { - [self.visibleStickyHeaders makeObjectsPerformSelector:_cmd]; - } -} - - (void)invalidateHeaders { - [_header.collectionView reloadData]; - if (_stickyHeaderMapTable.count) { - [_stickyHeaderMapTable.objectEnumerator.allObjects makeObjectsPerformSelector:@selector(reloadData)]; - } + [self.calendarHeaderView.collectionView reloadData]; + [self.visibleStickyHeaders makeObjectsPerformSelector:@selector(configureAppearance)]; } -- (void)invalidateAppearanceForCell:(FSCalendarCell *)cell +- (void)invalidateAppearanceForCell:(FSCalendarCell *)cell forDate:(NSDate *)date { - cell.preferredSelectionColor = [self preferredSelectionColorForDate:cell.date]; - cell.preferredTitleDefaultColor = [self preferredTitleDefaultColorForDate:cell.date]; - cell.preferredTitleSelectionColor = [self preferredTitleSelectionColorForDate:cell.date]; - if (cell.subtitle) { - cell.preferredSubtitleDefaultColor = [self preferredSubtitleDefaultColorForDate:cell.date]; - cell.preferredSubtitleSelectionColor = [self preferredSubtitleSelectionColorForDate:cell.date]; - } - if (cell.numberOfEvents) cell.preferredEventColor = [self preferredEventColorForDate:cell.date]; - cell.preferredBorderDefaultColor = [self preferredBorderDefaultColorForDate:cell.date]; - cell.preferredBorderSelectionColor = [self preferredBorderSelectionColorForDate:cell.date]; - cell.preferredCellShape = [self preferredCellShapeForDate:cell.date]; +#define FSCalendarInvalidateCellAppearance(SEL1,SEL2) \ + cell.SEL1 = [self.delegateProxy calendar:self appearance:self.appearance SEL2:date]; + +#define FSCalendarInvalidateCellAppearanceWithDefault(SEL1,SEL2,DEFAULT) \ + if ([self.delegateProxy respondsToSelector:@selector(calendar:appearance:SEL2:)]) { \ + cell.SEL1 = [self.delegateProxy calendar:self appearance:self.appearance SEL2:date]; \ + } else { \ + cell.SEL1 = DEFAULT; \ + } + + FSCalendarInvalidateCellAppearance(preferredFillDefaultColor,fillDefaultColorForDate); + FSCalendarInvalidateCellAppearance(preferredFillSelectionColor,fillSelectionColorForDate); + FSCalendarInvalidateCellAppearance(preferredTitleDefaultColor,titleDefaultColorForDate); + FSCalendarInvalidateCellAppearance(preferredTitleSelectionColor,titleSelectionColorForDate); + + FSCalendarInvalidateCellAppearanceWithDefault(preferredTitleOffset,titleOffsetForDate,CGPointInfinity); + if (cell.subtitle) { + FSCalendarInvalidateCellAppearance(preferredSubtitleDefaultColor,subtitleDefaultColorForDate); + FSCalendarInvalidateCellAppearance(preferredSubtitleSelectionColor,subtitleSelectionColorForDate); + FSCalendarInvalidateCellAppearanceWithDefault(preferredSubtitleOffset,subtitleOffsetForDate,CGPointInfinity); + } + if (cell.numberOfEvents) { + FSCalendarInvalidateCellAppearance(preferredEventDefaultColors,eventDefaultColorsForDate); + FSCalendarInvalidateCellAppearance(preferredEventSelectionColors,eventSelectionColorsForDate); + FSCalendarInvalidateCellAppearanceWithDefault(preferredEventOffset,eventOffsetForDate,CGPointInfinity); + } + FSCalendarInvalidateCellAppearance(preferredBorderDefaultColor,borderDefaultColorForDate); + FSCalendarInvalidateCellAppearance(preferredBorderSelectionColor,borderSelectionColorForDate); + FSCalendarInvalidateCellAppearanceWithDefault(preferredBorderRadius,borderRadiusForDate,-1); + + if (cell.image) { + FSCalendarInvalidateCellAppearanceWithDefault(preferredImageOffset,imageOffsetForDate,CGPointInfinity); + } + +#undef FSCalendarInvalidateCellAppearance +#undef FSCalendarInvalidateCellAppearanceWithDefault - [cell setNeedsLayout]; } - (void)reloadDataForCell:(FSCalendarCell *)cell atIndexPath:(NSIndexPath *)indexPath { cell.calendar = self; - cell.date = [self dateForIndexPath:indexPath]; - cell.image = [self imageForDate:cell.date]; - cell.numberOfEvents = [self numberOfEventsForDate:cell.date]; - cell.subtitle = [self subtitleForDate:cell.date]; - cell.dateIsSelected = [_selectedDates containsObject:cell.date]; - cell.dateIsToday = [self isDateInToday:cell.date]; - switch (_scope) { + NSDate *date = [self.calculator dateForIndexPath:indexPath]; + cell.image = [self.dataSourceProxy calendar:self imageForDate:date]; + cell.numberOfEvents = [self.dataSourceProxy calendar:self numberOfEventsForDate:date]; + cell.titleLabel.text = [self.dataSourceProxy calendar:self titleForDate:date] ?: @([self.gregorian component:NSCalendarUnitDay fromDate:date]).stringValue; + cell.subtitle = [self.dataSourceProxy calendar:self subtitleForDate:date]; + cell.selected = [_selectedDates containsObject:date]; + cell.dateIsToday = self.today?[self.gregorian isDate:date inSameDayAsDate:self.today]:NO; + cell.weekend = [self.gregorian isDateInWeekend:date]; + cell.monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + switch (self.transitionCoordinator.representingScope) { case FSCalendarScopeMonth: { - NSDate *firstPage = [self beginingOfMonthOfDate:_minimumDate]; - NSDate *month = [self dateByAddingMonths:indexPath.section toDate:firstPage]; - cell.dateIsPlaceholder = ![self isDate:cell.date equalToDate:month toCalendarUnit:FSCalendarUnitMonth] || ![self isDateInRange:cell.date]; - if (cell.dateIsPlaceholder) { - cell.dateIsSelected &= _pagingEnabled; + cell.placeholder = (cell.monthPosition == FSCalendarMonthPositionPrevious || cell.monthPosition == FSCalendarMonthPositionNext) || ![self isDateInRange:date]; + if (cell.placeholder) { + cell.selected &= _pagingEnabled; cell.dateIsToday &= _pagingEnabled; } break; } case FSCalendarScopeWeek: { - if (_pagingEnabled) { - cell.dateIsPlaceholder = ![self isDateInRange:cell.date]; - } + cell.placeholder = ![self isDateInRange:date]; break; } } - [self invalidateAppearanceForCell:cell]; - if (cell.dateIsSelected) { - if (cell.dateIsPlaceholder) indexPath = [self indexPathForDate:cell.date]; - [_collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; - } else if ([_collectionView.indexPathsForSelectedItems containsObject:indexPath]) { - [_collectionView deselectItemAtIndexPath:indexPath animated:NO]; + // Synchronize selecion state to the collection view, otherwise delegate methods would not be triggered. + if (cell.selected) { + [self.collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; + } else { + [self.collectionView deselectItemAtIndexPath:indexPath animated:NO]; } - [cell setNeedsLayout]; + [self invalidateAppearanceForCell:cell forDate:date]; + [cell configureAppearance]; } -- (void)reloadVisibleCells + +- (void)handleSwipeToChoose:(UILongPressGestureRecognizer *)pressGesture { - [_collectionView.indexPathsForVisibleItems enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) { - FSCalendarCell *cell = (FSCalendarCell *)[_collectionView cellForItemAtIndexPath:indexPath]; - [self reloadDataForCell:cell atIndexPath:indexPath]; - }]; + switch (pressGesture.state) { + case UIGestureRecognizerStateBegan: + case UIGestureRecognizerStateChanged: { + NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint:[pressGesture locationInView:self.collectionView]]; + if (indexPath && ![indexPath isEqual:self.lastPressedIndexPath]) { + NSDate *date = [self.calculator dateForIndexPath:indexPath]; + FSCalendarMonthPosition monthPosition = [self.calculator monthPositionForIndexPath:indexPath]; + if (![self.selectedDates containsObject:date] && [self collectionView:self.collectionView shouldSelectItemAtIndexPath:indexPath]) { + [self selectDate:date scrollToDate:NO atMonthPosition:monthPosition]; + [self collectionView:self.collectionView didSelectItemAtIndexPath:indexPath]; + } else if (self.collectionView.allowsMultipleSelection && [self collectionView:self.collectionView shouldDeselectItemAtIndexPath:indexPath]) { + [self deselectDate:date]; + [self collectionView:self.collectionView didDeselectItemAtIndexPath:indexPath]; + } + } + self.lastPressedIndexPath = indexPath; + break; + } + case UIGestureRecognizerStateEnded: + case UIGestureRecognizerStateCancelled: { + self.lastPressedIndexPath = nil; + break; + } + default: + break; + } + } - (void)selectCounterpartDate:(NSDate *)date { - if (!self.floatingMode) { - [_collectionView.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger idx, BOOL *stop) { - if (cell.dateIsPlaceholder && [self isDate:cell.date equalToDate:date toCalendarUnit:FSCalendarUnitDay] && !cell.dateIsSelected) { - cell.dateIsSelected = YES; - [cell setNeedsLayout]; - *stop = YES; - } - }]; + if (_placeholderType == FSCalendarPlaceholderTypeNone) return; + if (self.scope == FSCalendarScopeWeek) return; + NSInteger numberOfDays = [self.gregorian fs_numberOfDaysInMonth:date]; + NSInteger day = [self.gregorian component:NSCalendarUnitDay fromDate:date]; + FSCalendarCell *cell; + if (day < numberOfDays/2+1) { + cell = [self cellForDate:date atMonthPosition:FSCalendarMonthPositionNext]; + } else { + cell = [self cellForDate:date atMonthPosition:FSCalendarMonthPositionPrevious]; } + if (cell) { + cell.selected = YES; + if (self.collectionView.allowsMultipleSelection) { + [self.collectionView selectItemAtIndexPath:[self.collectionView indexPathForCell:cell] animated:NO scrollPosition:UICollectionViewScrollPositionNone]; + } + } + [cell configureAppearance]; } - (void)deselectCounterpartDate:(NSDate *)date { - if (self.floatingMode) { - [_collectionView.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger index, BOOL *stop) { - if (cell.dateIsPlaceholder && cell.dateIsSelected) { - cell.dateIsSelected = NO; - [_collectionView deselectItemAtIndexPath:[_collectionView indexPathForCell:cell] animated:NO]; - [cell setNeedsLayout]; - } - }]; + if (_placeholderType == FSCalendarPlaceholderTypeNone) return; + if (self.scope == FSCalendarScopeWeek) return; + NSInteger numberOfDays = [self.gregorian fs_numberOfDaysInMonth:date]; + NSInteger day = [self.gregorian component:NSCalendarUnitDay fromDate:date]; + FSCalendarCell *cell; + if (day < numberOfDays/2+1) { + cell = [self cellForDate:date atMonthPosition:FSCalendarMonthPositionNext]; } else { - [_collectionView.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger idx, BOOL *stop) { - if (cell.dateIsPlaceholder && [self isDate:cell.date equalToDate:date toCalendarUnit:FSCalendarUnitDay] && cell.dateIsSelected) { - cell.dateIsSelected = NO; - [_collectionView deselectItemAtIndexPath:[_collectionView indexPathForCell:cell] animated:NO]; - [cell setNeedsLayout]; - *stop = YES; - } - }]; + cell = [self cellForDate:date atMonthPosition:FSCalendarMonthPositionPrevious]; } + if (cell) { + cell.selected = NO; + [self.collectionView deselectItemAtIndexPath:[self.collectionView indexPathForCell:cell] animated:NO]; + } + [cell configureAppearance]; } - (void)enqueueSelectedDate:(NSDate *)date @@ -1598,34 +1605,20 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { - (NSArray *)visibleStickyHeaders { - return _stickyHeaderMapTable.objectEnumerator.allObjects; -} - - -- (void)invalidateWeekdayFont -{ - [_weekdays makeObjectsPerformSelector:@selector(setFont:) withObject:_appearance.preferredWeekdayFont]; -} - -- (void)invalidateWeekdayTextColor -{ - [_weekdays makeObjectsPerformSelector:@selector(setTextColor:) withObject:_appearance.weekdayTextColor]; + return [self.visibleSectionHeaders.dictionaryRepresentation allValues]; } - (void)invalidateViewFrames { _needsAdjustingViewFrame = YES; - _needsAdjustingTextSize = YES; - _needsAdjustingMonthPosition = YES; _preferredHeaderHeight = FSCalendarAutomaticDimension; _preferredWeekdayHeight = FSCalendarAutomaticDimension; _preferredRowHeight = FSCalendarAutomaticDimension; - [self.visibleStickyHeaders setValue:@YES forKey:@"needsAdjustingViewFrame"]; - [self.collectionView.visibleCells setValue:@YES forKey:@"needsAdjustingViewFrame"]; - self.header.needsAdjustingViewFrame = YES; - [self.appearance invalidateFonts]; + [self.calendarHeaderView setNeedsAdjustingViewFrame:YES]; + [self setNeedsLayout]; + } // The best way to detect orientation @@ -1639,580 +1632,44 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) { return orientation; } -- (NSInteger)numberOfHeadPlaceholdersForMonth:(NSDate *)month +- (void)adjustMonthPosition { - NSInteger currentWeekday = [self weekdayOfDate:month]; - NSInteger number = ((currentWeekday- _firstWeekday) + 7) % 7 ?: (7 * (!self.floatingMode&&self.showsPlaceholders)); - return number; + [self requestBoundingDatesIfNecessary]; + NSDate *targetPage = self.pagingEnabled?self.currentPage:(self.currentPage?:self.selectedDate); + [self scrollToPageForDate:targetPage animated:NO]; + self.calendarHeaderView.needsAdjustingMonthPosition = YES; } -#pragma mark - Delegate - -- (BOOL)shouldSelectDate:(NSDate *)date +- (BOOL)requestBoundingDatesIfNecessary { - if (_delegate && [_delegate respondsToSelector:@selector(calendar:shouldSelectDate:)]) { - return [_delegate calendar:self shouldSelectDate:date]; - } - return YES; -} - -- (void)didSelectDate:(NSDate *)date -{ - [self enqueueSelectedDate:date]; - if (_delegate && [_delegate respondsToSelector:@selector(calendar:didSelectDate:)]) { - [_delegate calendar:self didSelectDate:date]; - } -} - -- (BOOL)shouldDeselectDate:(NSDate *)date -{ - if (_delegate && [_delegate respondsToSelector:@selector(calendar:shouldDeselectDate:)]) { - return [_delegate calendar:self shouldDeselectDate:date]; - } - return YES; -} - -- (void)didDeselectDate:(NSDate *)date -{ - if (_delegate && [_delegate respondsToSelector:@selector(calendar:didDeselectDate:)]) { - [_delegate calendar:self didDeselectDate:date]; - } -} - -- (void)currentPageDidChange -{ - if (_delegate && [_delegate respondsToSelector:@selector(calendarCurrentPageDidChange:)]) { - [_delegate calendarCurrentPageDidChange:self]; - } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - else if (_delegate && [_delegate respondsToSelector:@selector(calendarCurrentMonthDidChange:)]) { - [_delegate calendarCurrentMonthDidChange:self]; - } -#pragma GCC diagnostic pop -} - -- (UIColor *)preferredSelectionColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:selectionColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance selectionColorForDate:date]; - return color; - } - return nil; -} - -- (UIColor *)preferredTitleDefaultColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:titleDefaultColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance titleDefaultColorForDate:date]; - return color; - } - return nil; -} - -- (UIColor *)preferredTitleSelectionColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:titleSelectionColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance titleSelectionColorForDate:date]; - return color; - } - return nil; -} - -- (UIColor *)preferredSubtitleDefaultColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:subtitleDefaultColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance subtitleDefaultColorForDate:date]; - return color; - } - return nil; -} - -- (UIColor *)preferredSubtitleSelectionColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:subtitleSelectionColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance subtitleSelectionColorForDate:date]; - return color; - } - return nil; -} - -- (id)preferredEventColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:eventColorsForDate:)]) { - NSArray *colors = [self.delegateAppearance calendar:self appearance:self.appearance eventColorsForDate:date]; - if (colors) { - return colors; - } - } - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:eventColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance eventColorForDate:date]; - if (color) { - return color; - } - } - return nil; -} - -- (UIColor *)preferredBorderDefaultColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:borderDefaultColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance borderDefaultColorForDate:date]; - return color; - } - return nil; -} - -- (UIColor *)preferredBorderSelectionColorForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:borderSelectionColorForDate:)]) { - UIColor *color = [self.delegateAppearance calendar:self appearance:self.appearance borderSelectionColorForDate:date]; - return color; - } - return nil; -} - -- (FSCalendarCellShape)preferredCellShapeForDate:(NSDate *)date -{ - if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:cellShapeForDate:)]) { - FSCalendarCellShape cellShape = [self.delegateAppearance calendar:self appearance:self.appearance cellShapeForDate:date]; - return cellShape; - } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - else if (self.delegateAppearance && [self.delegateAppearance respondsToSelector:@selector(calendar:appearance:cellStyleForDate:)]) { - FSCalendarCellShape cellShape = (FSCalendarCellShape)[self.delegateAppearance calendar:self appearance:self.appearance cellStyleForDate:date]; - return cellShape; - } -#pragma GCC diagnostic pop - - return FSCalendarCellShapeCircle; -} - - -- (BOOL)boundingRectWillChange:(BOOL)animated -{ - if (self.delegate && [self.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)]) { - CGRect boundingRect = (CGRect){CGPointZero,[self sizeThatFits:self.frame.size]}; - if (!CGRectEqualToRect((CGRect){CGPointZero,self.frame.size}, boundingRect)) { - [self.delegate calendar:self boundingRectWillChange:boundingRect animated:animated]; - return YES; - } + if (_needsRequestingBoundingDates) { + _needsRequestingBoundingDates = NO; + self.formatter.dateFormat = @"yyyy-MM-dd"; + NSDate *newMin = [self.dataSourceProxy minimumDateForCalendar:self]?:[self.formatter dateFromString:@"1970-01-01"]; + newMin = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:newMin options:0]; + NSDate *newMax = [self.dataSourceProxy maximumDateForCalendar:self]?:[self.formatter dateFromString:@"2099-12-31"]; + newMax = [self.gregorian dateBySettingHour:0 minute:0 second:0 ofDate:newMax options:0]; + + NSAssert([self.gregorian compareDate:newMin toDate:newMax toUnitGranularity:NSCalendarUnitDay] != NSOrderedDescending, @"The minimum date of calendar should be earlier than the maximum."); + + BOOL res = ![self.gregorian isDate:newMin inSameDayAsDate:_minimumDate] || ![self.gregorian isDate:newMax inSameDayAsDate:_maximumDate]; + _minimumDate = newMin; + _maximumDate = newMax; + [self.calculator reloadSections]; + + return res; } return NO; } -#pragma mark - DataSource - -- (NSString *)subtitleForDate:(NSDate *)date +- (void)configureAppearance { -#if !TARGET_INTERFACE_BUILDER - if (_dataSource && [_dataSource respondsToSelector:@selector(calendar:subtitleForDate:)]) { - return [_dataSource calendar:self subtitleForDate:date]; - } - return nil; -#else - return _appearance.fakeSubtitles ? @"test" : nil; -#endif -} - -- (UIImage *)imageForDate:(NSDate *)date -{ - if (_dataSource && [_dataSource respondsToSelector:@selector(calendar:imageForDate:)]) { - return [_dataSource calendar:self imageForDate:date]; - } - return nil; -} - -- (NSInteger)numberOfEventsForDate:(NSDate *)date -{ -#if !TARGET_INTERFACE_BUILDER - - if (_dataSource && [_dataSource respondsToSelector:@selector(calendar:numberOfEventsForDate:)]) { - return [_dataSource calendar:self numberOfEventsForDate:date]; - } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - if (_dataSource && [_dataSource respondsToSelector:@selector(calendar:hasEventForDate:)]) { - return [_dataSource calendar:self hasEventForDate:date]; - } - #pragma GCC diagnostic pop - -#else - if ([@[@3,@5] containsObject:@([self dayOfDate:date])]) { - return 1; - } - if ([@[@8,@16] containsObject:@([self dayOfDate:date])]) { - return 2; - } - if ([@[@20,@25] containsObject:@([self dayOfDate:date])]) { - return 3; - } -#endif - return 0; - -} - -- (NSDate *)minimumDateForCalendar -{ - if (_dataSource && [_dataSource respondsToSelector:@selector(minimumDateForCalendar:)]) { - _minimumDate = [self dateByIgnoringTimeComponentsOfDate:[_dataSource minimumDateForCalendar:self]]; - } - if (!_minimumDate) { - _minimumDate = [self dateWithYear:1970 month:1 day:1]; - } - return _minimumDate; -} - -- (NSDate *)maximumDateForCalendar -{ - if (_dataSource && [_dataSource respondsToSelector:@selector(maximumDateForCalendar:)]) { - _maximumDate = [self dateByIgnoringTimeComponentsOfDate:[_dataSource maximumDateForCalendar:self]]; - } - if (!_maximumDate) { - _maximumDate = [self dateWithYear:2099 month:12 day:31]; - } - return _maximumDate; + [self.visibleCells makeObjectsPerformSelector:@selector(configureAppearance)]; + [self.visibleStickyHeaders makeObjectsPerformSelector:@selector(configureAppearance)]; + [self.calendarHeaderView configureAppearance]; + [self.calendarWeekdayView configureAppearance]; } @end -#pragma mark - DateTools - - -@implementation FSCalendar (DateTools) - -#pragma mark - Public methods - -- (NSInteger)yearOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitYear fromDate:date]; - return component.year; -} - -- (NSInteger)monthOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitMonth - fromDate:date]; - return component.month; -} - -- (NSInteger)dayOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitDay - fromDate:date]; - return component.day; -} - -- (NSInteger)weekdayOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitWeekday fromDate:date]; - return component.weekday; -} - -- (NSInteger)weekOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitWeekOfYear fromDate:date]; - return component.weekOfYear; -} - -- (NSInteger)hourOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitHour - fromDate:date]; - return component.hour; -} - -- (NSInteger)miniuteOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitMinute - fromDate:date]; - return component.minute; -} - -- (NSInteger)secondOfDate:(NSDate *)date -{ - NSDateComponents *component = [self.calendar components:NSCalendarUnitSecond - fromDate:date]; - return component.second; -} - -- (NSInteger)numberOfRowsInMonth:(NSDate *)month -{ - if (!month) return 0; - if (self.showsPlaceholders) return 6; - NSDate *firstDayOfMonth = [self beginingOfMonthOfDate:month]; - NSInteger weekdayOfFirstDay = [self weekdayOfDate:firstDayOfMonth]; - NSInteger numberOfDaysInMonth = [self numberOfDatesInMonthOfDate:month]; - NSInteger numberOfPlaceholdersForPrev = ((weekdayOfFirstDay - _firstWeekday) + 7) % 7; - NSInteger headDayCount = numberOfDaysInMonth + numberOfPlaceholdersForPrev; - NSInteger numberOfRows = (headDayCount/7) + (headDayCount%7>0); - return numberOfRows; -} - -- (NSDate *)dateByIgnoringTimeComponentsOfDate:(NSDate *)date -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; - components.hour = FSCalendarDefaultHourComponent; - return [self.calendar dateFromComponents:components]; -} - -- (NSDate *)beginingOfMonthOfDate:(NSDate *)date -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; - components.day = 1; - return [self.calendar dateFromComponents:components]; -} - -- (NSDate *)endOfMonthOfDate:(NSDate *)date -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; - components.month++; - components.day = 0; - return [self.calendar dateFromComponents:components]; -} - -- (NSDate *)beginingOfWeekOfDate:(NSDate *)date -{ - NSDateComponents *weekdayComponents = [self.calendar components:NSCalendarUnitWeekday fromDate:date]; - NSDateComponents *componentsToSubtract = self.components; - componentsToSubtract.day = - (weekdayComponents.weekday - self.calendar.firstWeekday); - componentsToSubtract.day = (componentsToSubtract.day-7) % 7; - NSDate *beginningOfWeek = [self.calendar dateByAddingComponents:componentsToSubtract toDate:date options:0]; - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:beginningOfWeek]; - beginningOfWeek = [self.calendar dateFromComponents:components]; - componentsToSubtract.day = NSIntegerMax; - return beginningOfWeek; -} - -- (NSDate *)middleOfWeekFromDate:(NSDate *)date -{ - NSDateComponents *weekdayComponents = [self.calendar components:NSCalendarUnitWeekday fromDate:date]; - NSDateComponents *componentsToSubtract = self.components; - componentsToSubtract.day = - (weekdayComponents.weekday - self.calendar.firstWeekday) + 3; - NSDate *middleOfWeek = [self.calendar dateByAddingComponents:componentsToSubtract toDate:date options:0]; - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:middleOfWeek]; - middleOfWeek = [self.calendar dateFromComponents:components]; - componentsToSubtract.day = NSIntegerMax; - return middleOfWeek; -} - -- (NSDate *)tomorrowOfDate:(NSDate *)date -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; - components.day++; - components.hour = FSCalendarDefaultHourComponent; - return [self.calendar dateFromComponents:components]; -} - -- (NSDate *)yesterdayOfDate:(NSDate *)date -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:date]; - components.day--; - components.hour = FSCalendarDefaultHourComponent; - return [self.calendar dateFromComponents:components]; -} - -- (NSInteger)numberOfDatesInMonthOfDate:(NSDate *)date -{ - NSRange days = [self.calendar rangeOfUnit:NSCalendarUnitDay - inUnit:NSCalendarUnitMonth - forDate:date]; - return days.length; -} - -- (NSDate *)dateFromString:(NSString *)string format:(NSString *)format -{ - self.formatter.dateFormat = format; - return [self.formatter dateFromString:string]; -} - -- (NSDate *)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day -{ - NSDateComponents *components = self.components; - components.year = year; - components.month = month; - components.day = day; - components.hour = FSCalendarDefaultHourComponent; - NSDate *date = [self.calendar dateFromComponents:components]; - components.year = NSIntegerMax; - components.month = NSIntegerMax; - components.day = NSIntegerMax; - components.hour = NSIntegerMax; - return date; -} - -- (NSDate *)dateByAddingYears:(NSInteger)years toDate:(NSDate *)date -{ - NSDateComponents *components = self.components; - components.year = years; - NSDate *d = [self.calendar dateByAddingComponents:components toDate:date options:0]; - components.year = NSIntegerMax; - return d; -} - -- (NSDate *)dateBySubstractingYears:(NSInteger)years fromDate:(NSDate *)date -{ - return [self dateByAddingYears:-years toDate:date]; -} - -- (NSDate *)dateByAddingMonths:(NSInteger)months toDate:(NSDate *)date -{ - NSDateComponents *components = self.components; - components.month = months; - NSDate *d = [self.calendar dateByAddingComponents:components toDate:date options:0]; - components.month = NSIntegerMax; - return d; -} - -- (NSDate *)dateBySubstractingMonths:(NSInteger)months fromDate:(NSDate *)date -{ - return [self dateByAddingMonths:-months toDate:date]; -} - -- (NSDate *)dateByAddingWeeks:(NSInteger)weeks toDate:(NSDate *)date -{ - NSDateComponents *components = self.components; - components.weekOfYear = weeks; - NSDate *d = [self.calendar dateByAddingComponents:components toDate:date options:0]; - components.weekOfYear = NSIntegerMax; - return d; -} - -- (NSDate *)dateBySubstractingWeeks:(NSInteger)weeks fromDate:(NSDate *)date -{ - return [self dateByAddingWeeks:-weeks toDate:date]; -} - -- (NSDate *)dateByAddingDays:(NSInteger)days toDate:(NSDate *)date -{ - NSDateComponents *components = self.components; - components.day = days; - NSDate *d = [self.calendar dateByAddingComponents:components toDate:date options:0]; - components.day = NSIntegerMax; - return d; -} - -- (NSDate *)dateBySubstractingDays:(NSInteger)days fromDate:(NSDate *)date -{ - return [self dateByAddingDays:-days toDate:date]; -} - -- (NSInteger)yearsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitYear - fromDate:fromDate - toDate:toDate - options:0]; - return components.year; -} - -- (NSInteger)monthsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitMonth - fromDate:fromDate - toDate:toDate - options:0]; - return components.month; -} - -- (NSInteger)weeksFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitWeekOfYear - fromDate:fromDate - toDate:toDate - options:0]; - return components.weekOfYear; -} - -- (NSInteger)daysFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate -{ - NSDateComponents *components = [self.calendar components:NSCalendarUnitDay - fromDate:fromDate - toDate:toDate - options:0]; - return components.day; -} - -- (BOOL)isDate:(NSDate *)date1 equalToDate:(NSDate *)date2 toCalendarUnit:(FSCalendarUnit)unit -{ - switch (unit) { - case FSCalendarUnitMonth: - return [self yearOfDate:date1] == [self yearOfDate:date2] && [self monthOfDate:date1] == [self monthOfDate:date2]; - case FSCalendarUnitWeekOfYear: - return [self yearOfDate:date1] == [self yearOfDate:date2] && [self weekOfDate:date1] == [self weekOfDate:date2]; - case FSCalendarUnitDay: - return [self yearOfDate:date1] == [self yearOfDate:date2] && [self monthOfDate:date1] == [self monthOfDate:date2] && [self dayOfDate:date1] == [self dayOfDate:date2]; - } - return NO; -} - -- (BOOL)isDateInToday:(NSDate *)date -{ - return [self isDate:date equalToDate:_today toCalendarUnit:FSCalendarUnitDay]; -} - -- (NSString *)stringFromDate:(NSDate *)date format:(NSString *)format -{ - self.formatter.dateFormat = format; - return [self.formatter stringFromDate:date]; -} - -- (NSString *)stringFromDate:(NSDate *)date -{ - return [self stringFromDate:date format:@"yyyy-MM-dd"]; -} - -@end - -#pragma mark - Deprecate - -@implementation FSCalendar (Deprecated) - -- (void)setCurrentMonth:(NSDate *)currentMonth -{ - self.currentPage = currentMonth; -} - -- (NSDate *)currentMonth -{ - return self.currentPage; -} - -- (void)setFlow:(FSCalendarFlow)flow -{ - self.scrollDirection = (FSCalendarScrollDirection)flow; -} - -- (FSCalendarFlow)flow -{ - return (FSCalendarFlow)self.scrollDirection; -} - -- (void)setSelectedDate:(NSDate *)selectedDate -{ - [self selectDate:selectedDate]; -} - -- (void)setSelectedDate:(NSDate *)selectedDate animate:(BOOL)animate -{ - [self selectDate:selectedDate scrollToDate:animate]; -} - -- (BOOL)date:(NSDate *)date sharesSameMonthWithDate:(NSDate *)anotherDate -{ - return [self yearOfDate:date] == [self yearOfDate:anotherDate] && [self monthOfDate:date] == [self monthOfDate:anotherDate]; -} - -- (BOOL)date:(NSDate *)date sharesSameWeekWithDate:(NSDate *)anotherDate -{ - return [self yearOfDate:date] == [self yearOfDate:anotherDate] && [self weekOfDate:date] == [self weekOfDate:anotherDate]; -} - -- (BOOL)date:(NSDate *)date sharesSameDayWithDate:(NSDate *)anotherDate -{ - return [self yearOfDate:date] == [self yearOfDate:anotherDate] && [self monthOfDate:date] == [self monthOfDate:anotherDate] && [self dayOfDate:date] == [self dayOfDate:anotherDate]; -} - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAnimator.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAnimator.h deleted file mode 100644 index 10165e1..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAnimator.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// FSCalendarAnimator.h -// FSCalendar -// -// Created by dingwenchao on 3/13/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import -#import "FSCalendar.h" -#import "FSCalendarCollectionView.h" -#import "FSCalendarFlowLayout.h" -#import "FSCalendarDynamicHeader.h" - -typedef NS_ENUM(NSUInteger, FSCalendarTransition) { - FSCalendarTransitionNone, - FSCalendarTransitionMonthToWeek, - FSCalendarTransitionWeekToMonth -}; -typedef NS_ENUM(NSUInteger, FSCalendarTransitionState) { - FSCalendarTransitionStateIdle, - FSCalendarTransitionStateInProgress -}; - -@interface FSCalendarAnimator : NSObject - -@property (weak, nonatomic) FSCalendar *calendar; -@property (weak, nonatomic) FSCalendarCollectionView *collectionView; -@property (weak, nonatomic) FSCalendarFlowLayout *collectionViewLayout; - -@property (assign, nonatomic) FSCalendarTransition transition; -@property (assign, nonatomic) FSCalendarTransitionState state; - -- (void)performScopeTransitionFromScope:(FSCalendarScope)fromScope toScope:(FSCalendarScope)toScope animated:(BOOL)animated; -- (void)performBoudingRectTransitionFromMonth:(NSDate *)fromMonth toMonth:(NSDate *)toMonth duration:(CGFloat)duration; - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAnimator.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAnimator.m deleted file mode 100644 index 04fe117..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAnimator.m +++ /dev/null @@ -1,394 +0,0 @@ -// -// FSCalendarAnimator.m -// FSCalendar -// -// Created by Wenchao Ding on 3/13/16. -// Copyright © 2016 Wenchao Ding. All rights reserved. -// - -#import "FSCalendarAnimator.h" -#import -#import "UIView+FSExtension.h" - -@implementation FSCalendarAnimator - -#pragma mark - Public methods - -- (void)performScopeTransitionFromScope:(FSCalendarScope)fromScope toScope:(FSCalendarScope)toScope animated:(BOOL)animated -{ - if (fromScope == toScope) { - self.transition = FSCalendarTransitionNone; - return; - } - if (fromScope == FSCalendarScopeMonth && toScope == FSCalendarScopeWeek) { - self.transition = FSCalendarTransitionMonthToWeek; - } else if (fromScope == FSCalendarScopeWeek && toScope == FSCalendarScopeMonth) { - self.transition = FSCalendarTransitionWeekToMonth; - } - - // Start transition - self.state = FSCalendarTransitionStateInProgress; - - switch (self.transition) { - - case FSCalendarTransitionMonthToWeek: { - - CGSize contentSize = [self.calendar sizeThatFits:self.calendar.frame.size scope:FSCalendarScopeWeek]; - CGRect targetBounds = (CGRect){CGPointZero,contentSize}; - - NSInteger focusedRowNumber = 0; - if (self.calendar.focusOnSingleSelectedDate) { - NSDate *focusedDate = self.calendar.selectedDate; - if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]]; - CGPoint focuedCenter = attributes.center; - if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { - switch (self.collectionViewLayout.scrollDirection) { - case UICollectionViewScrollDirectionHorizontal: { - focusedRowNumber = attributes.indexPath.item%6; - break; - } - case UICollectionViewScrollDirectionVertical: { - focusedRowNumber = attributes.indexPath.item/7; - break; - } - } - } else { - focusedDate = nil; - } - } - if (!focusedDate) { - focusedDate = self.calendar.today; - if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeMonth]]; - CGPoint focuedCenter = attributes.center; - if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { - switch (self.collectionViewLayout.scrollDirection) { - case UICollectionViewScrollDirectionHorizontal: { - focusedRowNumber = attributes.indexPath.item%6; - break; - } - case UICollectionViewScrollDirectionVertical: { - focusedRowNumber = attributes.indexPath.item/7; - break; - } - } - } - } - } - } - - NSDate *currentPage = self.calendar.currentPage; - NSDate *minimumPage = [self.calendar beginingOfMonthOfDate:self.calendar.minimumDate]; - NSInteger visibleSection = [self.calendar monthsFromDate:minimumPage toDate:currentPage]; - NSIndexPath *firstIndexPath = [NSIndexPath indexPathForItem:0 inSection:visibleSection]; - NSDate *firstDate = [self.calendar dateForIndexPath:firstIndexPath scope:FSCalendarScopeMonth]; - currentPage = [self.calendar dateByAddingDays:focusedRowNumber*7 toDate:firstDate]; - - Ivar currentPageIvar = class_getInstanceVariable(FSCalendar.class, "_currentPage"); - object_setIvar(self.calendar, currentPageIvar, currentPage); - - self.calendar.contentView.clipsToBounds = YES; - self.calendar.daysContainer.clipsToBounds = YES; - if (animated) { - CGFloat duration = 0.3; - // Perform alpha animation - CABasicAnimation *opacity = [CABasicAnimation animationWithKeyPath:@"opacity"]; - opacity.duration = duration*0.6; - opacity.removedOnCompletion = NO; - opacity.fillMode = kCAFillModeForwards; - opacity.toValue = @0; - [self.collectionView.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger idx, BOOL *stop) { - if (CGRectContainsPoint(self.collectionView.bounds, cell.center)) { - BOOL shouldPerformAlpha = NO; - NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell]; - switch (self.collectionViewLayout.scrollDirection) { - case UICollectionViewScrollDirectionHorizontal: { - shouldPerformAlpha = indexPath.item%6 != focusedRowNumber; - break; - } - case UICollectionViewScrollDirectionVertical: { - shouldPerformAlpha = indexPath.item/7 != focusedRowNumber; - break; - } - } - if (shouldPerformAlpha) { - [cell.contentView.layer addAnimation:opacity forKey:@"opacity"]; - } - } - }]; - - // Perform path and frame animation - CABasicAnimation *path = [CABasicAnimation animationWithKeyPath:@"path"]; - path.fromValue = (id)self.calendar.maskLayer.path; - path.toValue = (id)[UIBezierPath bezierPathWithRect:targetBounds].CGPath; - path.duration = duration; - path.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - [CATransaction begin]; - [CATransaction setCompletionBlock:^{ - self.state = FSCalendarTransitionStateIdle; - self.transition = FSCalendarTransitionNone; - self.collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; - self.calendar.header.scrollDirection = self.collectionViewLayout.scrollDirection; - self.calendar.maskLayer.path = [UIBezierPath bezierPathWithRect:targetBounds].CGPath; - [self.collectionView reloadData]; - [self.collectionView layoutIfNeeded]; - [self.calendar.header reloadData]; - [self.calendar.header layoutIfNeeded]; - self.calendar.needsAdjustingMonthPosition = YES; - self.calendar.needsAdjustingViewFrame = YES; - [self.calendar setNeedsLayout]; - self.calendar.contentView.clipsToBounds = NO; - self.calendar.daysContainer.clipsToBounds = NO; - }]; - [CATransaction setAnimationDuration:duration]; - [self.calendar.maskLayer addAnimation:path forKey:@"path"]; - [CATransaction commit]; - - if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { - - [UIView beginAnimations:@"delegateTranslation" context:"translation"]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; - [UIView setAnimationDuration:duration]; - self.collectionView.fs_top = -focusedRowNumber*self.calendar.preferredRowHeight; - self.calendar.bottomBorder.fs_top = CGRectGetMaxY(targetBounds); - if ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)]) { - [self.calendar.delegate calendar:self.calendar boundingRectWillChange:targetBounds animated:animated]; - } else { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - [self.calendar.delegate calendarCurrentScopeWillChange:self.calendar animated:animated]; -#pragma GCC diagnostic pop - } - [UIView commitAnimations]; - } - - } else { - - self.state = FSCalendarTransitionStateIdle; - self.transition = FSCalendarTransitionNone; - self.collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; - self.calendar.header.scrollDirection = self.collectionViewLayout.scrollDirection; - self.calendar.needsAdjustingViewFrame = YES; - self.calendar.bottomBorder.frame = CGRectMake(0, contentSize.height, self.calendar.fs_width, 1); - self.calendar.maskLayer.path = [UIBezierPath bezierPathWithRect:targetBounds].CGPath; - self.calendar.bottomBorder.fs_top = CGRectGetMaxY(targetBounds); - [self.collectionView reloadData]; - [self.collectionView layoutIfNeeded]; - [self.calendar.header reloadData]; - [self.calendar.header layoutIfNeeded]; - self.calendar.needsAdjustingMonthPosition = YES; - self.calendar.needsAdjustingViewFrame = YES; - [self.calendar setNeedsLayout]; - - self.calendar.contentView.clipsToBounds = NO; - self.calendar.daysContainer.clipsToBounds = NO; - - if (self.calendar.delegate && [self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)]) { - [self.calendar.delegate calendar:self.calendar boundingRectWillChange:targetBounds animated:animated]; - } else if (self.calendar.delegate && [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)]) { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - [self.calendar.delegate calendarCurrentScopeWillChange:self.calendar animated:animated]; -#pragma GCC diagnostic pop - } - - } - - break; - } - - case FSCalendarTransitionWeekToMonth: { - - CGSize contentSize = [self.calendar sizeThatFits:self.calendar.frame.size scope:FSCalendarScopeMonth]; - CGRect targetBounds = (CGRect){CGPointZero,contentSize}; - - NSInteger focusedRowNumber = 0; - NSDate *currentPage = self.calendar.currentPage; - NSDate *firstDayOfMonth = nil; - 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; - if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { - firstDayOfMonth = [self.calendar beginingOfMonthOfDate:focusedDate]; - } else { - focusedDate = nil; - } - } - if (!focusedDate) { - focusedDate = self.calendar.today; - if (focusedDate) { - UICollectionViewLayoutAttributes *attributes = [self.collectionViewLayout layoutAttributesForItemAtIndexPath:[self.calendar indexPathForDate:focusedDate scope:FSCalendarScopeWeek]]; - CGPoint focuedCenter = attributes.center; - if (CGRectContainsPoint(self.collectionView.bounds, focuedCenter)) { - firstDayOfMonth = [self.calendar beginingOfMonthOfDate:focusedDate]; - } - } - }; - } - firstDayOfMonth = firstDayOfMonth ?: [self.calendar beginingOfMonthOfDate:currentPage]; - NSInteger numberOfPlaceholdersForPrev = [self.calendar numberOfHeadPlaceholdersForMonth:firstDayOfMonth]; - NSDate *firstDateOfPage = [self.calendar dateBySubstractingDays:numberOfPlaceholdersForPrev fromDate:firstDayOfMonth]; - for (int i = 0; i < 6; i++) { - NSDate *currentRow = [self.calendar dateByAddingWeeks:i toDate:firstDateOfPage]; - if ([self.calendar isDate:currentRow equalToDate:currentPage toCalendarUnit:FSCalendarUnitDay]) { - focusedRowNumber = i; - currentPage = firstDayOfMonth; - break; - } - } - - Ivar currentPageIvar = class_getInstanceVariable(FSCalendar.class, "_currentPage"); - object_setIvar(self.calendar, currentPageIvar, currentPage); - - self.collectionViewLayout.scrollDirection = (UICollectionViewScrollDirection)self.calendar.scrollDirection; - self.calendar.header.scrollDirection = self.collectionViewLayout.scrollDirection; - - self.calendar.needsAdjustingMonthPosition = YES; - self.calendar.needsAdjustingViewFrame = YES; - [self.calendar layoutSubviews]; - [self.collectionView reloadData]; - [self.collectionView layoutIfNeeded]; - [self.calendar.header reloadData]; - [self.calendar.header layoutIfNeeded]; - - self.calendar.contentView.clipsToBounds = YES; - self.calendar.daysContainer.clipsToBounds = YES; - - if (animated) { - // 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; - NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell]; - switch (self.collectionViewLayout.scrollDirection) { - case UICollectionViewScrollDirectionHorizontal: { - shouldPerformAlpha = indexPath.item%6 != focusedRowNumber; - break; - } - case UICollectionViewScrollDirectionVertical: { - shouldPerformAlpha = indexPath.item/7 != focusedRowNumber; - break; - } - } - if (shouldPerformAlpha) { - [cell.contentView.layer addAnimation:opacity forKey:@"opacity"]; - } - } - }]; - - // Perform path and frame animation - BOOL oldDisableActions = [CATransaction disableActions]; - [CATransaction setDisableActions:NO]; - - CABasicAnimation *path = [CABasicAnimation animationWithKeyPath:@"path"]; - path.fromValue = (id)self.calendar.maskLayer.path; - path.toValue = (id)[UIBezierPath bezierPathWithRect:targetBounds].CGPath; - path.duration = duration; - path.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - [CATransaction begin]; - [CATransaction setCompletionBlock:^{ - self.state = FSCalendarTransitionStateIdle; - self.transition = FSCalendarTransitionNone; - self.calendar.maskLayer.path = [UIBezierPath bezierPathWithRect:targetBounds].CGPath; - self.calendar.contentView.clipsToBounds = NO; - self.calendar.daysContainer.clipsToBounds = NO; - }]; - [CATransaction setAnimationDuration:duration]; - - self.calendar.needsAdjustingViewFrame = YES; - [self.calendar.maskLayer addAnimation:path forKey:@"path"]; - - [CATransaction commit]; - - if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { - self.collectionView.fs_top = -focusedRowNumber*self.calendar.preferredRowHeight; - [UIView setAnimationsEnabled:YES]; - [UIView beginAnimations:@"delegateTranslation" context:"translation"]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; - [UIView setAnimationDuration:duration]; - self.collectionView.fs_top = 0; - self.self.calendar.bottomBorder.frame = CGRectMake(0, contentSize.height, self.calendar.fs_width, 1); - if ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)]) { - [self.calendar.delegate calendar:self.calendar boundingRectWillChange:targetBounds animated:animated]; - } else { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - [self.calendar.delegate calendarCurrentScopeWillChange:self.calendar animated:animated]; -#pragma GCC diagnostic pop - } - [UIView commitAnimations]; - } - [CATransaction setDisableActions:oldDisableActions]; - - } else { - - self.state = FSCalendarTransitionStateIdle; - self.transition = FSCalendarTransitionNone; - self.calendar.needsAdjustingViewFrame = YES; - self.calendar.bottomBorder.frame = CGRectMake(0, contentSize.height, self.calendar.fs_width, 1); - self.calendar.maskLayer.path = [UIBezierPath bezierPathWithRect:targetBounds].CGPath; - self.calendar.contentView.clipsToBounds = NO; - self.calendar.daysContainer.clipsToBounds = NO; - - if (self.calendar.delegate && [self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)]) { - [self.calendar.delegate calendar:self.calendar boundingRectWillChange:targetBounds animated:animated]; - } else if (self.calendar.delegate && [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)]) { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - [self.calendar.delegate calendarCurrentScopeWillChange:self.calendar animated:animated]; -#pragma GCC diagnostic pop - } - } - break; - } - default: - break; - } - -} - -- (void)performBoudingRectTransitionFromMonth:(NSDate *)fromMonth toMonth:(NSDate *)toMonth duration:(CGFloat)duration -{ - NSInteger lastRowCount = [self.calendar numberOfRowsInMonth:fromMonth]; - NSInteger currentRowCount = [self.calendar numberOfRowsInMonth:toMonth]; - if (lastRowCount != currentRowCount) { - CGFloat animationDuration = duration; - CGRect bounds = (CGRect){CGPointZero,[self.calendar sizeThatFits:self.calendar.frame.size]}; - self.state = FSCalendarTransitionStateInProgress; - [UIView animateWithDuration:animationDuration delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ - if (self.calendar.delegate && [self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)]) { - if (!CGRectEqualToRect((CGRect){CGPointZero,self.calendar.frame.size}, bounds)) { - [self.calendar.delegate calendar:self.calendar boundingRectWillChange:bounds animated:YES]; - } - } - self.calendar.bottomBorder.fs_top = CGRectGetMaxY(bounds); - } completion:^(BOOL finished) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MAX(0, duration-animationDuration) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - self.calendar.needsAdjustingViewFrame = YES; - [self.calendar setNeedsLayout]; - self.state = FSCalendarTransitionStateIdle; - }); - }]; - - CABasicAnimation *path = [CABasicAnimation animationWithKeyPath:@"path"]; - path.fromValue = (id)self.calendar.maskLayer.path; - path.toValue = (id)[UIBezierPath bezierPathWithRect:bounds].CGPath; - path.duration = animationDuration*(currentRowCount>lastRowCount?1.25:0.75); - path.removedOnCompletion = NO; - path.fillMode = kCAFillModeForwards; - [self.calendar.maskLayer addAnimation:path forKey:@"path"]; - - } -} - - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.h index 5f31114..f328a96 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.h @@ -8,7 +8,7 @@ // https://github.com/WenchaoD // -#import "FSCalendarConstance.h" +#import "FSCalendarConstants.h" @class FSCalendar; @@ -22,9 +22,9 @@ typedef NS_ENUM(NSInteger, FSCalendarCellState) { FSCalendarCellStateTodaySelected = FSCalendarCellStateToday|FSCalendarCellStateSelected }; -typedef NS_ENUM(NSUInteger, FSCalendarCellShape) { - FSCalendarCellShapeCircle = 0, - FSCalendarCellShapeRectangle = 1 +typedef NS_ENUM(NSUInteger, FSCalendarSeparators) { + FSCalendarSeparatorNone = 0, + FSCalendarSeparatorInterRows = 1 }; typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) { @@ -45,46 +45,53 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) { /** * The font of the day text. - * - * @warning The size of font is adjusted by calendar size. To turn it off, set adjustsFontSizeToFitContentSize to NO; */ @property (strong, nonatomic) UIFont *titleFont; /** * The font of the subtitle text. - * - * @warning The size of font is adjusted by calendar size. To turn it off, set adjustsFontSizeToFitContentSize to NO; */ @property (strong, nonatomic) UIFont *subtitleFont; /** * The font of the weekday text. - * -* @warning The size of font is adjusted by calendar size. To turn it off, set adjustsFontSizeToFitContentSize to NO; */ @property (strong, nonatomic) UIFont *weekdayFont; /** * The font of the month text. - * - * @warning The size of font is adjusted by calendar size. To turn it off, set adjustsFontSizeToFitContentSize to NO; */ @property (strong, nonatomic) UIFont *headerTitleFont; /** - * The vertical offset of the day text from default position. + * The offset of the day text from default position. */ -@property (assign, nonatomic) CGFloat titleVerticalOffset; +@property (assign, nonatomic) CGPoint titleOffset; /** - * The vertical offset of the suntitle text from default position. + * The offset of the day text from default position. */ -@property (assign, nonatomic) CGFloat subtitleVerticalOffset; +@property (assign, nonatomic) CGPoint subtitleOffset; + +/** + * The offset of the event dots from default position. + */ +@property (assign, nonatomic) CGPoint eventOffset; + +/** + * The offset of the image from default position. + */ +@property (assign, nonatomic) CGPoint imageOffset; /** * The color of event dots. */ -@property (strong, nonatomic) UIColor *eventColor; +@property (strong, nonatomic) UIColor *eventDefaultColor; + +/** + * The color of event dots. + */ +@property (strong, nonatomic) UIColor *eventSelectionColor; /** * The color of weekday text. @@ -182,11 +189,9 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) { @property (strong, nonatomic) UIColor *borderSelectionColor; /** - * The shape appears when a day is selected or today. - * - * @see FSCalendarCellShape + * The border radius, while 1 means a circle, 0 means a rectangle, and the middle value will give it a corner radius. */ -@property (assign, nonatomic) FSCalendarCellShape cellShape; +@property (assign, nonatomic) CGFloat borderRadius; /** * The case options manage the case of month label and weekday symbols. @@ -196,28 +201,20 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) { @property (assign, nonatomic) FSCalendarCaseOptions caseOptions; /** - * A Boolean value indicates whether the calendar should adjust font size by its content size. + * The line integrations for calendar. * - * @see titleFont - * @see subtitleFont - * @see weekdayFont - * @see headerTitleFont */ -@property (assign, nonatomic) BOOL adjustsFontSizeToFitContentSize; +@property (assign, nonatomic) FSCalendarSeparators separators; #if TARGET_INTERFACE_BUILDER // For preview only @property (assign, nonatomic) BOOL fakeSubtitles; +@property (assign, nonatomic) BOOL fakeEventDots; @property (assign, nonatomic) NSInteger fakedSelectedDay; #endif -/** - * Triggers an appearance update. - */ -- (void)invalidateAppearance; - @end /** @@ -225,15 +222,13 @@ typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) { */ @interface FSCalendarAppearance (Deprecated) -@property (assign, nonatomic) FSCalendarCellStyle cellStyle FSCalendarDeprecated('cellShape'); @property (assign, nonatomic) BOOL useVeryShortWeekdaySymbols FSCalendarDeprecated('caseOptions'); -@property (assign, nonatomic) BOOL autoAdjustTitleSize FSCalendarDeprecated('adjustFontSizeToFitContentSize'); -@property (assign, nonatomic) BOOL adjustsFontSizeToFitCellSize FSCalendarDeprecated('adjustFontSizeToFitContentSize'); - -@property (assign, nonatomic) CGFloat titleTextSize FSCalendarDeprecated('titleFont'); -@property (assign, nonatomic) CGFloat subtitleTextSize FSCalendarDeprecated('subtitleFont'); -@property (assign, nonatomic) CGFloat weekdayTextSize FSCalendarDeprecated('weekdayFont'); -@property (assign, nonatomic) CGFloat headerTitleTextSize FSCalendarDeprecated('headerTitleFont'); +@property (assign, nonatomic) CGFloat titleVerticalOffset FSCalendarDeprecated('titleOffset'); +@property (assign, nonatomic) CGFloat subtitleVerticalOffset FSCalendarDeprecated('subtitleOffset'); +@property (strong, nonatomic) UIColor *eventColor FSCalendarDeprecated('eventDefaultColor'); +@property (assign, nonatomic) FSCalendarCellShape cellShape FSCalendarDeprecated('borderRadius'); +@property (assign, nonatomic) BOOL adjustsFontSizeToFitContentSize DEPRECATED_MSG_ATTRIBUTE("The attribute \'adjustsFontSizeToFitContentSize\' is not neccesary anymore."); +- (void)invalidateAppearance FSCalendarDeprecated('FSCalendar setNeedsConfigureAppearance'); @end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.m index b7b46ea..41ff97c 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarAppearance.m @@ -10,7 +10,7 @@ #import "FSCalendarAppearance.h" #import "FSCalendarDynamicHeader.h" -#import "UIView+FSExtension.h" +#import "FSCalendarExtensions.h" @interface FSCalendarAppearance () @@ -21,44 +21,6 @@ @property (strong, nonatomic) NSMutableDictionary *subtitleColors; @property (strong, nonatomic) NSMutableDictionary *borderColors; -@property (strong, nonatomic) NSString *titleFontName; -@property (strong, nonatomic) NSString *subtitleFontName; -@property (strong, nonatomic) NSString *weekdayFontName; -@property (strong, nonatomic) NSString *headerTitleFontName; - -@property (assign, nonatomic) CGFloat titleFontSize; -@property (assign, nonatomic) CGFloat subtitleFontSize; -@property (assign, nonatomic) CGFloat weekdayFontSize; -@property (assign, nonatomic) CGFloat headerTitleFontSize; - -@property (assign, nonatomic) CGFloat preferredTitleFontSize; -@property (assign, nonatomic) CGFloat preferredSubtitleFontSize; -@property (assign, nonatomic) CGFloat preferredWeekdayFontSize; -@property (assign, nonatomic) CGFloat preferredHeaderTitleFontSize; - -@property (readonly, nonatomic) UIFont *preferredTitleFont; -@property (readonly, nonatomic) UIFont *preferredSubtitleFont; -@property (readonly, nonatomic) UIFont *preferredWeekdayFont; -@property (readonly, nonatomic) UIFont *preferredHeaderTitleFont; - -- (void)adjustTitleIfNecessary; - -- (void)invalidateFonts; -- (void)invalidateTextColors; -- (void)invalidateTitleFont; -- (void)invalidateSubtitleFont; -- (void)invalidateWeekdayFont; -- (void)invalidateHeaderFont; -- (void)invalidateTitleTextColor; -- (void)invalidateSubtitleTextColor; -- (void)invalidateWeekdayTextColor; -- (void)invalidateHeaderTextColor; - -- (void)invalidateBorderColors; -- (void)invalidateBackgroundColors; -- (void)invalidateEventColors; -- (void)invalidateCellShapes; - @end @implementation FSCalendarAppearance @@ -68,17 +30,10 @@ self = [super init]; if (self) { - _adjustsFontSizeToFitContentSize = YES; - - _titleFontSize = _preferredTitleFontSize = FSCalendarStandardTitleTextSize; - _subtitleFontSize = _preferredSubtitleFontSize = FSCalendarStandardSubtitleTextSize; - _weekdayFontSize = _preferredWeekdayFontSize = FSCalendarStandardWeekdayTextSize; - _headerTitleFontSize = _preferredHeaderTitleFontSize = FSCalendarStandardHeaderTextSize; - - _titleFontName = [UIFont systemFontOfSize:1].fontName; - _subtitleFontName = [UIFont systemFontOfSize:1].fontName; - _weekdayFontName = [UIFont systemFontOfSize:1].fontName; - _headerTitleFontName = [UIFont systemFontOfSize:1].fontName; + _titleFont = [UIFont systemFontOfSize:FSCalendarStandardTitleTextSize]; + _subtitleFont = [UIFont systemFontOfSize:FSCalendarStandardSubtitleTextSize]; + _weekdayFont = [UIFont systemFontOfSize:FSCalendarStandardWeekdayTextSize]; + _headerTitleFont = [UIFont systemFontOfSize:FSCalendarStandardHeaderTextSize]; _headerTitleColor = FSCalendarStandardTitleTextColor; _headerDateFormat = @"MMMM yyyy"; @@ -110,113 +65,82 @@ _borderColors[@(FSCalendarCellStateSelected)] = [UIColor clearColor]; _borderColors[@(FSCalendarCellStateNormal)] = [UIColor clearColor]; - _cellShape = FSCalendarCellShapeCircle; - _eventColor = FSCalendarStandardEventDotColor; + _borderRadius = 1.0; + _eventDefaultColor = FSCalendarStandardEventDotColor; + _eventSelectionColor = FSCalendarStandardEventDotColor; _borderColors = [NSMutableDictionary dictionaryWithCapacity:2]; +#if TARGET_INTERFACE_BUILDER + _fakeEventDots = YES; +#endif + } return self; } - (void)setTitleFont:(UIFont *)titleFont { - BOOL needsInvalidating = NO; - if (![_titleFontName isEqualToString:titleFont.fontName]) { - _titleFontName = titleFont.fontName; - needsInvalidating = YES; + if (![_titleFont isEqual:titleFont]) { + _titleFont = titleFont; + [self.calendar configureAppearance]; } - if (_titleFontSize != titleFont.pointSize) { - _titleFontSize = titleFont.pointSize; - needsInvalidating = YES; - } - if (needsInvalidating) { - [self invalidateTitleFont]; - } -} - -- (UIFont *)titleFont -{ - return [UIFont fontWithName:_titleFontName size:_titleFontSize]; } - (void)setSubtitleFont:(UIFont *)subtitleFont { - BOOL needsInvalidating = NO; - if (![_subtitleFontName isEqualToString:subtitleFont.fontName]) { - _subtitleFontName = subtitleFont.fontName; - needsInvalidating = YES; + if (![_subtitleFont isEqual:subtitleFont]) { + _subtitleFont = subtitleFont; + [self.calendar configureAppearance]; } - if (_subtitleFontSize != subtitleFont.pointSize) { - _subtitleFontSize = subtitleFont.pointSize; - needsInvalidating = YES; - } - if (needsInvalidating) { - [self invalidateSubtitleFont]; - } -} - -- (UIFont *)subtitleFont -{ - return [UIFont fontWithName:_subtitleFontName size:_subtitleFontSize]; } - (void)setWeekdayFont:(UIFont *)weekdayFont { - BOOL needsInvalidating = NO; - if (![_weekdayFontName isEqualToString:weekdayFont.fontName]) { - _weekdayFontName = weekdayFont.fontName; - needsInvalidating = YES; + if (![_weekdayFont isEqual:weekdayFont]) { + _weekdayFont = weekdayFont; + [self.calendar configureAppearance]; } - if (_weekdayFontSize != weekdayFont.pointSize) { - _weekdayFontSize = weekdayFont.pointSize; - needsInvalidating = YES; - } - if (needsInvalidating) { - [self invalidateWeekdayFont]; - } -} - -- (UIFont *)weekdayFont -{ - return [UIFont fontWithName:_weekdayFontName size:_weekdayFontSize]; } - (void)setHeaderTitleFont:(UIFont *)headerTitleFont { - BOOL needsInvalidating = NO; - if (![_headerTitleFontName isEqualToString:headerTitleFont.fontName]) { - _headerTitleFontName = headerTitleFont.fontName; - needsInvalidating = YES; - } - if (_headerTitleFontSize != headerTitleFont.pointSize) { - _headerTitleFontSize = headerTitleFont.pointSize; - needsInvalidating = YES; - } - if (needsInvalidating) { - [self invalidateHeaderFont]; + if (![_headerTitleFont isEqual:headerTitleFont]) { + _headerTitleFont = headerTitleFont; + [self.calendar configureAppearance]; } } -- (void)setTitleVerticalOffset:(CGFloat)titleVerticalOffset +- (void)setTitleOffset:(CGPoint)titleOffset { - if (_titleVerticalOffset != titleVerticalOffset) { - _titleVerticalOffset = titleVerticalOffset; - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; + if (!CGPointEqualToPoint(_titleOffset, titleOffset)) { + _titleOffset = titleOffset; + [_calendar.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; } } -- (void)setSubtitleVerticalOffset:(CGFloat)subtitleVerticalOffset +- (void)setSubtitleOffset:(CGPoint)subtitleOffset { - if (_subtitleVerticalOffset != subtitleVerticalOffset) { - _subtitleVerticalOffset = subtitleVerticalOffset; - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; + if (!CGPointEqualToPoint(_subtitleOffset, subtitleOffset)) { + _subtitleOffset = subtitleOffset; + [_calendar.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; } } -- (UIFont *)headerTitleFont +- (void)setImageOffset:(CGPoint)imageOffset { - return [UIFont fontWithName:_headerTitleFontName size:_headerTitleFontSize]; + if (!CGPointEqualToPoint(_imageOffset, imageOffset)) { + _imageOffset = imageOffset; + [_calendar.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; + } +} + +- (void)setEventOffset:(CGPoint)eventOffset +{ + if (!CGPointEqualToPoint(_eventOffset, eventOffset)) { + _eventOffset = eventOffset; + [_calendar.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; + } } - (void)setTitleDefaultColor:(UIColor *)color @@ -226,7 +150,7 @@ } else { [_titleColors removeObjectForKey:@(FSCalendarCellStateNormal)]; } - [self invalidateTitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)titleDefaultColor @@ -241,7 +165,7 @@ } else { [_titleColors removeObjectForKey:@(FSCalendarCellStateSelected)]; } - [self invalidateTitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)titleSelectionColor @@ -256,7 +180,7 @@ } else { [_titleColors removeObjectForKey:@(FSCalendarCellStateToday)]; } - [self invalidateTitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)titleTodayColor @@ -271,7 +195,7 @@ } else { [_titleColors removeObjectForKey:@(FSCalendarCellStatePlaceholder)]; } - [self invalidateTitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)titlePlaceholderColor @@ -286,7 +210,7 @@ } else { [_titleColors removeObjectForKey:@(FSCalendarCellStateWeekend)]; } - [self invalidateTitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)titleWeekendColor @@ -301,7 +225,7 @@ } else { [_subtitleColors removeObjectForKey:@(FSCalendarCellStateNormal)]; } - [self invalidateSubtitleTextColor]; + [self.calendar configureAppearance]; } -(UIColor *)subtitleDefaultColor @@ -316,7 +240,7 @@ } else { [_subtitleColors removeObjectForKey:@(FSCalendarCellStateSelected)]; } - [self invalidateSubtitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)subtitleSelectionColor @@ -331,7 +255,7 @@ } else { [_subtitleColors removeObjectForKey:@(FSCalendarCellStateToday)]; } - [self invalidateSubtitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)subtitleTodayColor @@ -346,7 +270,7 @@ } else { [_subtitleColors removeObjectForKey:@(FSCalendarCellStatePlaceholder)]; } - [self invalidateSubtitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)subtitlePlaceholderColor @@ -361,7 +285,7 @@ } else { [_subtitleColors removeObjectForKey:@(FSCalendarCellStateWeekend)]; } - [self invalidateSubtitleTextColor]; + [self.calendar configureAppearance]; } - (UIColor *)subtitleWeekendColor @@ -376,7 +300,7 @@ } else { [_backgroundColors removeObjectForKey:@(FSCalendarCellStateSelected)]; } - [self invalidateBackgroundColors]; + [self.calendar configureAppearance]; } - (UIColor *)selectionColor @@ -391,7 +315,7 @@ } else { [_backgroundColors removeObjectForKey:@(FSCalendarCellStateToday)]; } - [self invalidateBackgroundColors]; + [self.calendar configureAppearance]; } - (UIColor *)todayColor @@ -406,7 +330,7 @@ } else { [_backgroundColors removeObjectForKey:@(FSCalendarCellStateToday|FSCalendarCellStateSelected)]; } - [self invalidateBackgroundColors]; + [self.calendar configureAppearance]; } - (UIColor *)todaySelectionColor @@ -414,11 +338,11 @@ return _backgroundColors[@(FSCalendarCellStateToday|FSCalendarCellStateSelected)]; } -- (void)setEventColor:(UIColor *)eventColor +- (void)setEventDefaultColor:(UIColor *)eventDefaultColor { - if (![_eventColor isEqual:eventColor]) { - _eventColor = eventColor; - [self invalidateEventColors]; + if (![_eventDefaultColor isEqual:eventDefaultColor]) { + _eventDefaultColor = eventDefaultColor; + [self.calendar configureAppearance]; } } @@ -429,7 +353,7 @@ } else { [_borderColors removeObjectForKey:@(FSCalendarCellStateNormal)]; } - [self invalidateBorderColors]; + [self.calendar configureAppearance]; } - (UIColor *)borderDefaultColor @@ -444,7 +368,7 @@ } else { [_borderColors removeObjectForKey:@(FSCalendarCellStateSelected)]; } - [self invalidateBorderColors]; + [self.calendar configureAppearance]; } - (UIColor *)borderSelectionColor @@ -452,11 +376,13 @@ return _borderColors[@(FSCalendarCellStateSelected)]; } -- (void)setCellShape:(FSCalendarCellShape)cellShape +- (void)setBorderRadius:(CGFloat)borderRadius { - if (_cellShape != cellShape) { - _cellShape = cellShape; - [self invalidateCellShapes]; + borderRadius = MAX(0.0, borderRadius); + borderRadius = MIN(1.0, borderRadius); + if (_borderRadius != borderRadius) { + _borderRadius = borderRadius; + [self.calendar configureAppearance]; } } @@ -464,7 +390,7 @@ { if (![_weekdayTextColor isEqual:weekdayTextColor]) { _weekdayTextColor = weekdayTextColor; - [self invalidateWeekdayTextColor]; + [self.calendar configureAppearance]; } } @@ -472,7 +398,7 @@ { if (![_headerTitleColor isEqual:color]) { _headerTitleColor = color; - [self invalidateHeaderTextColor]; + [self.calendar configureAppearance]; } } @@ -480,8 +406,7 @@ { if (_headerMinimumDissolvedAlpha != headerMinimumDissolvedAlpha) { _headerMinimumDissolvedAlpha = headerMinimumDissolvedAlpha; - [_calendar.header.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; - [_calendar.visibleStickyHeaders makeObjectsPerformSelector:@selector(setNeedsLayout)]; + [self.calendar configureAppearance]; } } @@ -489,169 +414,24 @@ { if (![_headerDateFormat isEqual:headerDateFormat]) { _headerDateFormat = headerDateFormat; - [_calendar invalidateHeaders]; + [self.calendar configureAppearance]; } } -- (void)setAdjustsFontSizeToFitContentSize:(BOOL)adjustsFontSizeToFitContentSize -{ - if (_adjustsFontSizeToFitContentSize != adjustsFontSizeToFitContentSize) { - _adjustsFontSizeToFitContentSize = adjustsFontSizeToFitContentSize; - if (adjustsFontSizeToFitContentSize) { - [self invalidateFonts]; - } - } -} - -- (UIFont *)preferredTitleFont -{ - return [UIFont fontWithName:_titleFontName size:_adjustsFontSizeToFitContentSize?_preferredTitleFontSize:_titleFontSize]; -} - -- (UIFont *)preferredSubtitleFont -{ - return [UIFont fontWithName:_subtitleFontName size:_adjustsFontSizeToFitContentSize?_preferredSubtitleFontSize:_subtitleFontSize]; -} - -- (UIFont *)preferredWeekdayFont -{ - return [UIFont fontWithName:_weekdayFontName size:_adjustsFontSizeToFitContentSize?_preferredWeekdayFontSize:_weekdayFontSize]; -} - -- (UIFont *)preferredHeaderTitleFont -{ - return [UIFont fontWithName:_headerTitleFontName size:_adjustsFontSizeToFitContentSize?_preferredHeaderTitleFontSize:_headerTitleFontSize]; -} - -- (void)adjustTitleIfNecessary -{ - if (!self.calendar.floatingMode) { - if (_adjustsFontSizeToFitContentSize) { - CGFloat factor = (_calendar.scope==FSCalendarScopeMonth) ? 6 : 1.1; - _preferredTitleFontSize = _calendar.collectionView.fs_height/3/factor; - _preferredTitleFontSize -= (_preferredTitleFontSize-FSCalendarStandardTitleTextSize)*0.5; - _preferredSubtitleFontSize = _calendar.collectionView.fs_height/4.5/factor; - _preferredSubtitleFontSize -= (_preferredSubtitleFontSize-FSCalendarStandardSubtitleTextSize)*0.75; - _preferredHeaderTitleFontSize = _preferredTitleFontSize * 1.25; - _preferredWeekdayFontSize = _preferredTitleFontSize; - - } - } else { - _preferredHeaderTitleFontSize = 20; - if (FSCalendarDeviceIsIPad) { - _preferredHeaderTitleFontSize = FSCalendarStandardHeaderTextSize * 1.5; - _preferredTitleFontSize = FSCalendarStandardTitleTextSize * 1.3; - _preferredSubtitleFontSize = FSCalendarStandardSubtitleTextSize * 1.15; - _preferredWeekdayFontSize = _preferredTitleFontSize; - } - } - - // reload appearance - [self invalidateFonts]; -} - - (void)setCaseOptions:(FSCalendarCaseOptions)caseOptions { if (_caseOptions != caseOptions) { _caseOptions = caseOptions; - [_calendar invalidateWeekdaySymbols]; - [_calendar invalidateHeaders]; + [self.calendar configureAppearance]; } } -- (void)invalidateAppearance +- (void)setSeparators:(FSCalendarSeparators)separators { - [self invalidateFonts]; - [self invalidateTextColors]; - [self invalidateBorderColors]; - [self invalidateBackgroundColors]; - /* - [_calendar.collectionView.visibleCells enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [_calendar invalidateAppearanceForCell:obj]; - }]; - [_calendar.header.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)]; - [_calendar.visibleStickyHeaders makeObjectsPerformSelector:@selector(setNeedsLayout)]; - */ -} - -- (void)invalidateFonts -{ - [self invalidateTitleFont]; - [self invalidateSubtitleFont]; - [self invalidateWeekdayFont]; - [self invalidateHeaderFont]; -} - -- (void)invalidateTextColors -{ - [self invalidateTitleTextColor]; - [self invalidateSubtitleTextColor]; - [self invalidateWeekdayTextColor]; - [self invalidateHeaderTextColor]; -} - -- (void)invalidateBorderColors -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateBackgroundColors -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateEventColors -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateCellShapes -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateTitleFont -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateSubtitleFont -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateTitleTextColor -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateSubtitleTextColor -{ - [_calendar.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateWeekdayFont -{ - [_calendar invalidateWeekdayFont]; - [_calendar.visibleStickyHeaders makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateWeekdayTextColor -{ - [_calendar invalidateWeekdayTextColor]; - [_calendar.visibleStickyHeaders makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateHeaderFont -{ - [_calendar.header.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; - [_calendar.visibleStickyHeaders makeObjectsPerformSelector:_cmd]; -} - -- (void)invalidateHeaderTextColor -{ - [_calendar.header.collectionView.visibleCells makeObjectsPerformSelector:_cmd]; - [_calendar.visibleStickyHeaders makeObjectsPerformSelector:_cmd]; + if (_separators != separators) { + _separators = separators; + [_calendar.collectionView.collectionViewLayout invalidateLayout]; + } } @end @@ -659,16 +439,6 @@ @implementation FSCalendarAppearance (Deprecated) -- (void)setCellStyle:(FSCalendarCellStyle)cellStyle -{ - self.cellShape = (FSCalendarCellShape)cellStyle; -} - -- (FSCalendarCellStyle)cellStyle -{ - return (FSCalendarCellStyle)self.cellShape; -} - - (void)setUseVeryShortWeekdaySymbols:(BOOL)useVeryShortWeekdaySymbols { _caseOptions &= 15; @@ -680,65 +450,73 @@ return (_caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesSingleUpperCase; } -- (void)setAutoAdjustTitleSize:(BOOL)autoAdjustTitleSize +- (void)setTitleVerticalOffset:(CGFloat)titleVerticalOffset { - self.adjustsFontSizeToFitContentSize = autoAdjustTitleSize; + self.titleOffset = CGPointMake(0, titleVerticalOffset); } -- (BOOL)autoAdjustTitleSize +- (CGFloat)titleVerticalOffset { - return self.adjustsFontSizeToFitContentSize; + return self.titleOffset.y; +} + +- (void)setSubtitleVerticalOffset:(CGFloat)subtitleVerticalOffset +{ + self.subtitleOffset = CGPointMake(0, subtitleVerticalOffset); +} + +- (CGFloat)subtitleVerticalOffset +{ + return self.subtitleOffset.y; +} + +- (void)setEventColor:(UIColor *)eventColor +{ + self.eventDefaultColor = eventColor; +} + +- (UIColor *)eventColor +{ + return self.eventDefaultColor; +} + +- (void)setCellShape:(FSCalendarCellShape)cellShape +{ + self.borderRadius = 1-cellShape; +} + +- (FSCalendarCellShape)cellShape +{ + return self.borderRadius==1.0?FSCalendarCellShapeCircle:FSCalendarCellShapeRectangle; } - (void)setTitleTextSize:(CGFloat)titleTextSize { - self.titleFont = [UIFont fontWithName:_titleFontName size:titleTextSize]; -} - -- (CGFloat)titleTextSize -{ - return _titleFontSize; + self.titleFont = [UIFont fontWithName:self.titleFont.fontName size:titleTextSize]; } - (void)setSubtitleTextSize:(CGFloat)subtitleTextSize { - self.subtitleFont = [UIFont fontWithName:_subtitleFontName size:subtitleTextSize]; -} - -- (CGFloat)subtitleTextSize -{ - return _subtitleFontSize; + self.subtitleFont = [UIFont fontWithName:self.subtitleFont.fontName size:subtitleTextSize]; } - (void)setWeekdayTextSize:(CGFloat)weekdayTextSize { - self.weekdayFont = [UIFont fontWithName:_weekdayFontName size:weekdayTextSize]; -} - -- (CGFloat)weekdayTextSize -{ - return _weekdayFontSize; + self.weekdayFont = [UIFont fontWithName:self.weekdayFont.fontName size:weekdayTextSize]; } - (void)setHeaderTitleTextSize:(CGFloat)headerTitleTextSize { - self.headerTitleFont = [UIFont fontWithName:_headerTitleFontName size:headerTitleTextSize]; + self.headerTitleFont = [UIFont fontWithName:self.headerTitleFont.fontName size:headerTitleTextSize]; } -- (CGFloat)headerTitleTextSize +- (void)invalidateAppearance { - return _headerTitleFontSize; + [self.calendar configureAppearance]; } -- (void)setAdjustsFontSizeToFitCellSize:(BOOL)adjustsFontSizeToFitCellSize -{ - self.adjustsFontSizeToFitContentSize = adjustsFontSizeToFitCellSize; -} - -- (BOOL)adjustsFontSizeToFitCellSize -{ - return self.adjustsFontSizeToFitContentSize; -} +- (void)setAdjustsFontSizeToFitContentSize:(BOOL)adjustsFontSizeToFitContentSize {} +- (BOOL)adjustsFontSizeToFitContentSize { return YES; } @end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCalculator.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCalculator.h new file mode 100644 index 0000000..7e9acf8 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCalculator.h @@ -0,0 +1,49 @@ +// +// FSCalendarCalculator.h +// FSCalendar +// +// Created by dingwenchao on 30/10/2016. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import +#import + +struct FSCalendarCoordinate { + NSInteger row; + NSInteger column; +}; +typedef struct FSCalendarCoordinate FSCalendarCoordinate; + +@interface FSCalendarCalculator : NSObject + +@property (weak , nonatomic) FSCalendar *calendar; + +@property (readonly, nonatomic) NSInteger numberOfSections; + +- (instancetype)initWithCalendar:(FSCalendar *)calendar; + +- (NSDate *)safeDateForDate:(NSDate *)date; + +- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath; +- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath scope:(FSCalendarScope)scope; +- (NSIndexPath *)indexPathForDate:(NSDate *)date; +- (NSIndexPath *)indexPathForDate:(NSDate *)date scope:(FSCalendarScope)scope; +- (NSIndexPath *)indexPathForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position; +- (NSIndexPath *)indexPathForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position scope:(FSCalendarScope)scope; + +- (NSDate *)pageForSection:(NSInteger)section; +- (NSDate *)weekForSection:(NSInteger)section; +- (NSDate *)monthForSection:(NSInteger)section; +- (NSDate *)monthHeadForSection:(NSInteger)section; + +- (NSInteger)numberOfHeadPlaceholdersForMonth:(NSDate *)month; +- (NSInteger)numberOfRowsInMonth:(NSDate *)month; +- (NSInteger)numberOfRowsInSection:(NSInteger)section; + +- (FSCalendarMonthPosition)monthPositionForIndexPath:(NSIndexPath *)indexPath; +- (FSCalendarCoordinate)coordinateForIndexPath:(NSIndexPath *)indexPath; + +- (void)reloadSections; + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCalculator.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCalculator.m new file mode 100644 index 0000000..3b9d5b5 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCalculator.m @@ -0,0 +1,299 @@ +// +// FSCalendarCalculator.m +// FSCalendar +// +// Created by dingwenchao on 30/10/2016. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendar.h" +#import "FSCalendarCalculator.h" +#import "FSCalendarDynamicHeader.h" +#import "FSCalendarExtensions.h" + +@interface FSCalendarCalculator () + +@property (assign, nonatomic) NSInteger numberOfMonths; +@property (strong, nonatomic) NSMutableDictionary *months; +@property (strong, nonatomic) NSMutableDictionary *monthHeads; + +@property (assign, nonatomic) NSInteger numberOfWeeks; +@property (strong, nonatomic) NSMutableDictionary *weeks; +@property (strong, nonatomic) NSMutableDictionary *rowCounts; + +@property (readonly, nonatomic) NSCalendar *gregorian; +@property (readonly, nonatomic) NSDate *minimumDate; +@property (readonly, nonatomic) NSDate *maximumDate; + +- (void)didReceiveNotifications:(NSNotification *)notification; + +@end + +@implementation FSCalendarCalculator + +@dynamic gregorian,minimumDate,maximumDate; + +- (instancetype)initWithCalendar:(FSCalendar *)calendar +{ + self = [super init]; + if (self) { + self.calendar = calendar; + + self.months = [NSMutableDictionary dictionary]; + self.monthHeads = [NSMutableDictionary dictionary]; + self.weeks = [NSMutableDictionary dictionary]; + self.rowCounts = [NSMutableDictionary dictionary]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveNotifications:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + } + return self; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; +} + +- (id)forwardingTargetForSelector:(SEL)selector +{ + if ([self.calendar respondsToSelector:selector]) { + return self.calendar; + } + return [super forwardingTargetForSelector:selector]; +} + +#pragma mark - Public functions + +- (NSDate *)safeDateForDate:(NSDate *)date +{ + if ([self.gregorian compareDate:date toDate:self.minimumDate toUnitGranularity:NSCalendarUnitDay] == NSOrderedAscending) { + date = self.minimumDate; + } else if ([self.gregorian compareDate:date toDate:self.maximumDate toUnitGranularity:NSCalendarUnitDay] == NSOrderedDescending) { + date = self.maximumDate; + } + return date; +} + +- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath scope:(FSCalendarScope)scope +{ + if (!indexPath) return nil; + switch (scope) { + case FSCalendarScopeMonth: { + NSDate *head = [self monthHeadForSection:indexPath.section]; + NSUInteger daysOffset = indexPath.item; + NSDate *date = [self.gregorian dateByAddingUnit:NSCalendarUnitDay value:daysOffset toDate:head options:0]; + return date; + break; + } + case FSCalendarScopeWeek: { + NSDate *currentPage = [self weekForSection:indexPath.section]; + NSDate *date = [self.gregorian dateByAddingUnit:NSCalendarUnitDay value:indexPath.item toDate:currentPage options:0]; + return date; + } + } + return nil; +} + +- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath +{ + if (!indexPath) return nil; + return [self dateForIndexPath:indexPath scope:self.calendar.transitionCoordinator.representingScope]; +} + +- (NSIndexPath *)indexPathForDate:(NSDate *)date +{ + return [self indexPathForDate:date atMonthPosition:FSCalendarMonthPositionCurrent scope:self.calendar.transitionCoordinator.representingScope]; +} + +- (NSIndexPath *)indexPathForDate:(NSDate *)date scope:(FSCalendarScope)scope +{ + return [self indexPathForDate:date atMonthPosition:FSCalendarMonthPositionCurrent scope:scope]; +} + +- (NSIndexPath *)indexPathForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position scope:(FSCalendarScope)scope +{ + if (!date) return nil; + NSInteger item = 0; + NSInteger section = 0; + switch (scope) { + case FSCalendarScopeMonth: { + section = [self.gregorian components:NSCalendarUnitMonth fromDate:[self.gregorian fs_firstDayOfMonth:self.minimumDate] toDate:[self.gregorian fs_firstDayOfMonth:date] options:0].month; + if (position == FSCalendarMonthPositionPrevious) { + section++; + } else if (position == FSCalendarMonthPositionNext) { + section--; + } + NSDate *head = [self monthHeadForSection:section]; + item = [self.gregorian components:NSCalendarUnitDay fromDate:head toDate:date options:0].day; + break; + } + case FSCalendarScopeWeek: { + section = [self.gregorian components:NSCalendarUnitWeekOfYear fromDate:[self.gregorian fs_firstDayOfWeek:self.minimumDate] toDate:[self.gregorian fs_firstDayOfWeek:date] options:0].weekOfYear; + item = (([self.gregorian component:NSCalendarUnitWeekday fromDate:date] - self.gregorian.firstWeekday) + 7) % 7; + break; + } + } + if (item < 0 || section < 0) { + return nil; + } + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:section]; + return indexPath; +} + +- (NSIndexPath *)indexPathForDate:(NSDate *)date atMonthPosition:(FSCalendarMonthPosition)position +{ + return [self indexPathForDate:date atMonthPosition:position scope:self.calendar.transitionCoordinator.representingScope]; +} + +- (NSDate *)pageForSection:(NSInteger)section +{ + switch (self.calendar.transitionCoordinator.representingScope) { + case FSCalendarScopeWeek: + return [self.gregorian fs_middleDayOfWeek:[self weekForSection:section]]; + case FSCalendarScopeMonth: + return [self monthForSection:section]; + default: + break; + } +} + +- (NSDate *)monthForSection:(NSInteger)section +{ + NSNumber *key = @(section); + NSDate *month = self.months[key]; + if (!month) { + month = [self.gregorian dateByAddingUnit:NSCalendarUnitMonth value:section toDate:[self.gregorian fs_firstDayOfMonth:self.minimumDate] options:0]; + NSInteger numberOfHeadPlaceholders = [self numberOfHeadPlaceholdersForMonth:month]; + NSDate *monthHead = [self.gregorian dateByAddingUnit:NSCalendarUnitDay value:-numberOfHeadPlaceholders toDate:month options:0]; + self.months[key] = month; + self.monthHeads[key] = monthHead; + } + return month; +} + +- (NSDate *)monthHeadForSection:(NSInteger)section +{ + NSNumber *key = @(section); + NSDate *monthHead = self.monthHeads[key]; + if (!monthHead) { + NSDate *month = [self.gregorian dateByAddingUnit:NSCalendarUnitMonth value:section toDate:[self.gregorian fs_firstDayOfMonth:self.minimumDate] options:0]; + NSInteger numberOfHeadPlaceholders = [self numberOfHeadPlaceholdersForMonth:month]; + monthHead = [self.gregorian dateByAddingUnit:NSCalendarUnitDay value:-numberOfHeadPlaceholders toDate:month options:0]; + self.months[key] = month; + self.monthHeads[key] = monthHead; + } + return monthHead; +} + +- (NSDate *)weekForSection:(NSInteger)section +{ + NSNumber *key = @(section); + NSDate *week = self.weeks[key]; + if (!week) { + week = [self.gregorian dateByAddingUnit:NSCalendarUnitWeekOfYear value:section toDate:[self.gregorian fs_firstDayOfWeek:self.minimumDate] options:0]; + self.weeks[key] = week; + } + return week; +} + +- (NSInteger)numberOfSections +{ + if (self.calendar.transitionCoordinator.transition == FSCalendarTransitionWeekToMonth) { + return self.numberOfMonths; + } else { + switch (self.calendar.transitionCoordinator.representingScope) { + case FSCalendarScopeMonth: { + return self.numberOfMonths; + } + case FSCalendarScopeWeek: { + return self.numberOfWeeks; + } + } + } +} + +- (NSInteger)numberOfHeadPlaceholdersForMonth:(NSDate *)month +{ + NSInteger currentWeekday = [self.gregorian component:NSCalendarUnitWeekday fromDate:month]; + NSInteger number = ((currentWeekday- self.gregorian.firstWeekday) + 7) % 7 ?: (7 * (!self.calendar.floatingMode&&(self.calendar.placeholderType == FSCalendarPlaceholderTypeFillSixRows))); + return number; +} + +- (NSInteger)numberOfRowsInMonth:(NSDate *)month +{ + if (!month) return 0; + if (self.calendar.placeholderType == FSCalendarPlaceholderTypeFillSixRows) return 6; + + NSNumber *rowCount = self.rowCounts[month]; + if (!rowCount) { + NSDate *firstDayOfMonth = [self.gregorian fs_firstDayOfMonth:month]; + NSInteger weekdayOfFirstDay = [self.gregorian component:NSCalendarUnitWeekday fromDate:firstDayOfMonth]; + NSInteger numberOfDaysInMonth = [self.gregorian fs_numberOfDaysInMonth:month]; + NSInteger numberOfPlaceholdersForPrev = ((weekdayOfFirstDay - self.gregorian.firstWeekday) + 7) % 7; + NSInteger headDayCount = numberOfDaysInMonth + numberOfPlaceholdersForPrev; + NSInteger numberOfRows = (headDayCount/7) + (headDayCount%7>0); + rowCount = @(numberOfRows); + self.rowCounts[month] = rowCount; + } + return rowCount.integerValue; +} + +- (NSInteger)numberOfRowsInSection:(NSInteger)section +{ + if (self.calendar.transitionCoordinator.representingScope == FSCalendarScopeWeek) return 1; + NSDate *month = [self monthForSection:section]; + return [self numberOfRowsInMonth:month]; +} + +- (FSCalendarMonthPosition)monthPositionForIndexPath:(NSIndexPath *)indexPath +{ + if (!indexPath) return FSCalendarMonthPositionNotFound; + if (self.calendar.transitionCoordinator.representingScope == FSCalendarScopeWeek) { + return FSCalendarMonthPositionCurrent; + } + NSDate *date = [self dateForIndexPath:indexPath]; + NSDate *page = [self pageForSection:indexPath.section]; + NSComparisonResult comparison = [self.gregorian compareDate:date toDate:page toUnitGranularity:NSCalendarUnitMonth]; + switch (comparison) { + case NSOrderedAscending: + return FSCalendarMonthPositionPrevious; + case NSOrderedSame: + return FSCalendarMonthPositionCurrent; + case NSOrderedDescending: + return FSCalendarMonthPositionNext; + } +} + +- (FSCalendarCoordinate)coordinateForIndexPath:(NSIndexPath *)indexPath +{ + FSCalendarCoordinate coordinate; + coordinate.row = indexPath.item / 7; + coordinate.column = indexPath.item % 7; + return coordinate; +} + +- (void)reloadSections +{ + self.numberOfMonths = [self.gregorian components:NSCalendarUnitMonth fromDate:[self.gregorian fs_firstDayOfMonth:self.minimumDate] toDate:self.maximumDate options:0].month+1; + self.numberOfWeeks = [self.gregorian components:NSCalendarUnitWeekOfYear fromDate:[self.gregorian fs_firstDayOfWeek:self.minimumDate] toDate:self.maximumDate options:0].weekOfYear+1; + [self clearCaches]; +} + +- (void)clearCaches +{ + [self.months removeAllObjects]; + [self.monthHeads removeAllObjects]; + [self.weeks removeAllObjects]; + [self.rowCounts removeAllObjects]; +} + +#pragma mark - Private functinos + +- (void)didReceiveNotifications:(NSNotification *)notification +{ + if ([notification.name isEqualToString:UIApplicationDidReceiveMemoryWarningNotification]) { + [self clearCaches]; + } +} + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.h index 2e734dc..f252b3b 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.h @@ -7,57 +7,101 @@ // #import -#import "FSCalendar.h" -#import "FSCalendarEventIndicator.h" + +@class FSCalendar, FSCalendarAppearance, FSCalendarEventIndicator; + +typedef NS_ENUM(NSUInteger, FSCalendarMonthPosition); @interface FSCalendarCell : UICollectionViewCell +#pragma mark - Public properties + +/** + The day text label of the cell + */ +@property (weak, nonatomic) UILabel *titleLabel; + + +/** + The subtitle label of the cell + */ +@property (weak, nonatomic) UILabel *subtitleLabel; + + +/** + The shape layer of the cell + */ +@property (weak, nonatomic) CAShapeLayer *shapeLayer; + +/** + The imageView below shape layer of the cell + */ +@property (weak, nonatomic) UIImageView *imageView; + + +/** + The collection of event dots of the cell + */ +@property (weak, nonatomic) FSCalendarEventIndicator *eventIndicator; + +/** + A boolean value indicates that whether the cell is "placeholder". Default is NO. + */ +@property (assign, nonatomic, getter=isPlaceholder) BOOL placeholder; + +#pragma mark - Private properties + @property (weak, nonatomic) FSCalendar *calendar; @property (weak, nonatomic) FSCalendarAppearance *appearance; -@property (weak, nonatomic) UILabel *titleLabel; -@property (weak, nonatomic) UILabel *subtitleLabel; -@property (weak, nonatomic) UIImageView *imageView; - -@property (weak, nonatomic) CAShapeLayer *backgroundLayer; -@property (weak, nonatomic) FSCalendarEventIndicator *eventIndicator; - -@property (strong, nonatomic) NSDate *date; @property (strong, nonatomic) NSString *subtitle; @property (strong, nonatomic) UIImage *image; +@property (assign, nonatomic) FSCalendarMonthPosition monthPosition; -@property (assign, nonatomic) BOOL needsAdjustingViewFrame; @property (assign, nonatomic) NSInteger numberOfEvents; - -@property (assign, nonatomic) BOOL dateIsPlaceholder; -@property (assign, nonatomic) BOOL dateIsSelected; @property (assign, nonatomic) BOOL dateIsToday; +@property (assign, nonatomic) BOOL weekend; -@property (readonly, nonatomic) BOOL weekend; - -@property (strong, nonatomic) UIColor *preferredSelectionColor; +@property (strong, nonatomic) UIColor *preferredFillDefaultColor; +@property (strong, nonatomic) UIColor *preferredFillSelectionColor; @property (strong, nonatomic) UIColor *preferredTitleDefaultColor; @property (strong, nonatomic) UIColor *preferredTitleSelectionColor; @property (strong, nonatomic) UIColor *preferredSubtitleDefaultColor; @property (strong, nonatomic) UIColor *preferredSubtitleSelectionColor; @property (strong, nonatomic) UIColor *preferredBorderDefaultColor; @property (strong, nonatomic) UIColor *preferredBorderSelectionColor; -@property (strong, nonatomic) id preferredEventColor; -@property (assign, nonatomic) FSCalendarCellShape preferredCellShape; +@property (assign, nonatomic) CGPoint preferredTitleOffset; +@property (assign, nonatomic) CGPoint preferredSubtitleOffset; +@property (assign, nonatomic) CGPoint preferredImageOffset; +@property (assign, nonatomic) CGPoint preferredEventOffset; -- (void)invalidateTitleFont; -- (void)invalidateSubtitleFont; -- (void)invalidateTitleTextColor; -- (void)invalidateSubtitleTextColor; +@property (strong, nonatomic) NSArray *preferredEventDefaultColors; +@property (strong, nonatomic) NSArray *preferredEventSelectionColors; +@property (assign, nonatomic) CGFloat preferredBorderRadius; -- (void)invalidateBorderColors; -- (void)invalidateBackgroundColors; -- (void)invalidateEventColors; -- (void)invalidateCellShapes; +// Add subviews to self.contentView and set up constraints +- (instancetype)initWithFrame:(CGRect)frame NS_REQUIRES_SUPER; +- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_REQUIRES_SUPER; -- (void)invalidateImage; +// For DIY overridden +- (void)layoutSubviews NS_REQUIRES_SUPER; // Configure frames of subviews +- (void)configureAppearance NS_REQUIRES_SUPER; // Configure appearance for cell - (UIColor *)colorForCurrentStateInDictionary:(NSDictionary *)dictionary; - (void)performSelecting; @end + +@interface FSCalendarEventIndicator : UIView + +@property (assign, nonatomic) NSInteger numberOfEvents; +@property (strong, nonatomic) id color; + +@end + +@interface FSCalendarBlankCell : UICollectionViewCell + +- (void)configureAppearance; + +@end + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.m index 1211d91..50e4bf2 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCell.m @@ -8,17 +8,18 @@ #import "FSCalendarCell.h" #import "FSCalendar.h" -#import "UIView+FSExtension.h" +#import "FSCalendarExtensions.h" #import "FSCalendarDynamicHeader.h" -#import "FSCalendarConstance.h" +#import "FSCalendarConstants.h" @interface FSCalendarCell () -@property (readonly, nonatomic) UIColor *colorForBackgroundLayer; +@property (readonly, nonatomic) UIColor *colorForCellFill; @property (readonly, nonatomic) UIColor *colorForTitleLabel; @property (readonly, nonatomic) UIColor *colorForSubtitleLabel; @property (readonly, nonatomic) UIColor *colorForCellBorder; -@property (readonly, nonatomic) FSCalendarCellShape cellShape; +@property (readonly, nonatomic) NSArray *colorsForEvents; +@property (readonly, nonatomic) CGFloat borderRadius; @end @@ -30,79 +31,137 @@ { self = [super initWithFrame:frame]; if (self) { - - _needsAdjustingViewFrame = YES; - - UILabel *label; - CAShapeLayer *shapeLayer; - UIImageView *imageView; - FSCalendarEventIndicator *eventIndicator; - - label = [[UILabel alloc] initWithFrame:CGRectZero]; - label.textAlignment = NSTextAlignmentCenter; - label.textColor = [UIColor blackColor]; - [self.contentView addSubview:label]; - self.titleLabel = label; - - label = [[UILabel alloc] initWithFrame:CGRectZero]; - label.textAlignment = NSTextAlignmentCenter; - label.textColor = [UIColor lightGrayColor]; - [self.contentView addSubview:label]; - self.subtitleLabel = label; - - shapeLayer = [CAShapeLayer layer]; - shapeLayer.backgroundColor = [UIColor clearColor].CGColor; - shapeLayer.hidden = YES; - [self.contentView.layer insertSublayer:shapeLayer below:_titleLabel.layer]; - self.backgroundLayer = shapeLayer; - - eventIndicator = [[FSCalendarEventIndicator alloc] initWithFrame:CGRectZero]; - eventIndicator.backgroundColor = [UIColor clearColor]; - eventIndicator.hidden = YES; - [self.contentView addSubview:eventIndicator]; - self.eventIndicator = eventIndicator; - - imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; - imageView.contentMode = UIViewContentModeBottom|UIViewContentModeCenter; - [self.contentView addSubview:imageView]; - self.imageView = imageView; - - self.clipsToBounds = NO; - self.contentView.clipsToBounds = NO; - + [self commonInit]; } return self; } -- (void)setBounds:(CGRect)bounds +- (instancetype)initWithCoder:(NSCoder *)aDecoder { - [super setBounds:bounds]; - CGFloat titleHeight = self.bounds.size.height*5.0/6.0; - CGFloat diameter = MIN(self.bounds.size.height*5.0/6.0,self.bounds.size.width); - diameter = diameter > FSCalendarStandardCellDiameter ? (diameter - (diameter-FSCalendarStandardCellDiameter)*0.5) : diameter; - _backgroundLayer.frame = CGRectMake((self.bounds.size.width-diameter)/2, - (titleHeight-diameter)/2, - diameter, - diameter); - _backgroundLayer.borderWidth = 1.0; - _backgroundLayer.borderColor = [UIColor clearColor].CGColor; + self = [super initWithCoder:aDecoder]; + if (self) { + [self commonInit]; + } + return self; +} + +- (void)commonInit +{ + UILabel *label; + CAShapeLayer *shapeLayer; + UIImageView *imageView; + FSCalendarEventIndicator *eventIndicator; + + label = [[UILabel alloc] initWithFrame:CGRectZero]; + label.textAlignment = NSTextAlignmentCenter; + label.textColor = [UIColor blackColor]; + [self.contentView addSubview:label]; + self.titleLabel = label; + + label = [[UILabel alloc] initWithFrame:CGRectZero]; + label.textAlignment = NSTextAlignmentCenter; + label.textColor = [UIColor lightGrayColor]; + [self.contentView addSubview:label]; + self.subtitleLabel = label; + + shapeLayer = [CAShapeLayer layer]; + shapeLayer.backgroundColor = [UIColor clearColor].CGColor; + shapeLayer.borderWidth = 1.0; + shapeLayer.borderColor = [UIColor clearColor].CGColor; + shapeLayer.opacity = 0; + [self.contentView.layer insertSublayer:shapeLayer below:_titleLabel.layer]; + self.shapeLayer = shapeLayer; + + eventIndicator = [[FSCalendarEventIndicator alloc] initWithFrame:CGRectZero]; + eventIndicator.backgroundColor = [UIColor clearColor]; + eventIndicator.hidden = YES; + [self.contentView addSubview:eventIndicator]; + self.eventIndicator = eventIndicator; + + imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; + imageView.contentMode = UIViewContentModeBottom|UIViewContentModeCenter; + [self.contentView addSubview:imageView]; + self.imageView = imageView; + + self.clipsToBounds = NO; + self.contentView.clipsToBounds = NO; - CGFloat eventSize = _backgroundLayer.frame.size.height/6.0; - _eventIndicator.frame = CGRectMake(0, CGRectGetMaxY(_backgroundLayer.frame)+eventSize*0.17, bounds.size.width, eventSize*0.83); - _imageView.frame = self.contentView.bounds; } - (void)layoutSubviews { [super layoutSubviews]; - [self configureCell]; + + if (_subtitle) { + _subtitleLabel.text = _subtitle; + if (_subtitleLabel.hidden) { + _subtitleLabel.hidden = NO; + } + } else { + if (!_subtitleLabel.hidden) { + _subtitleLabel.hidden = YES; + } + } + + if (_subtitle) { + CGFloat titleHeight = self.titleLabel.font.lineHeight; + CGFloat subtitleHeight = self.subtitleLabel.font.lineHeight; + + CGFloat height = titleHeight + subtitleHeight; + _titleLabel.frame = CGRectMake( + self.preferredTitleOffset.x, + (self.contentView.fs_height*5.0/6.0-height)*0.5+self.preferredTitleOffset.y, + self.contentView.fs_width, + titleHeight + ); + _subtitleLabel.frame = CGRectMake( + self.preferredSubtitleOffset.x, + (_titleLabel.fs_bottom-self.preferredTitleOffset.y) - (_titleLabel.fs_height-_titleLabel.font.pointSize)+self.preferredSubtitleOffset.y, + self.contentView.fs_width, + subtitleHeight + ); + } else { + _titleLabel.frame = CGRectMake( + self.preferredTitleOffset.x, + self.preferredTitleOffset.y, + self.contentView.fs_width, + floor(self.contentView.fs_height*5.0/6.0) + ); + } + + _imageView.frame = CGRectMake(self.preferredImageOffset.x, self.preferredImageOffset.y, self.contentView.fs_width, self.contentView.fs_height); + + CGFloat titleHeight = self.bounds.size.height*5.0/6.0; + CGFloat diameter = MIN(self.bounds.size.height*5.0/6.0,self.bounds.size.width); + diameter = diameter > FSCalendarStandardCellDiameter ? (diameter - (diameter-FSCalendarStandardCellDiameter)*0.5) : diameter; + _shapeLayer.frame = CGRectMake((self.bounds.size.width-diameter)/2, + (titleHeight-diameter)/2, + diameter, + diameter); + + CGPathRef path = [UIBezierPath bezierPathWithRoundedRect:_shapeLayer.bounds + cornerRadius:CGRectGetWidth(_shapeLayer.bounds)*0.5*self.borderRadius].CGPath; + if (!CGPathEqualToPath(_shapeLayer.path,path)) { + _shapeLayer.path = path; + } + + CGFloat eventSize = _shapeLayer.frame.size.height/6.0; + _eventIndicator.frame = CGRectMake( + self.preferredEventOffset.x, + CGRectGetMaxY(_shapeLayer.frame)+eventSize*0.17+self.preferredEventOffset.y, + self.fs_width, + eventSize*0.83 + ); + } - (void)prepareForReuse { [super prepareForReuse]; - [CATransaction setDisableActions:YES]; - _backgroundLayer.hidden = YES; + if (self.window) { // Avoid interrupt of navigation transition somehow + [CATransaction setDisableActions:YES]; // Avoid blink of shape layer. + } + self.shapeLayer.opacity = 0; [self.contentView.layer removeAnimationForKey:@"opacity"]; } @@ -110,7 +169,7 @@ - (void)performSelecting { - _backgroundLayer.hidden = NO; + _shapeLayer.opacity = 1; #define kAnimationDuration FSCalendarDefaultBounceAnimationDuration @@ -126,8 +185,8 @@ zoomIn.duration = kAnimationDuration/4; group.duration = kAnimationDuration; group.animations = @[zoomOut, zoomIn]; - [_backgroundLayer addAnimation:group forKey:@"bounce"]; - [self configureCell]; + [_shapeLayer addAnimation:group forKey:@"bounce"]; + [self configureAppearance]; #undef kAnimationDuration @@ -135,103 +194,72 @@ #pragma mark - Private -- (void)configureCell +- (void)configureAppearance { - self.contentView.hidden = self.dateIsPlaceholder && !self.calendar.showsPlaceholders; - if (self.contentView.hidden) { - return; - } - _titleLabel.text = [NSString stringWithFormat:@"%@",@([_calendar dayOfDate:_date])]; - if (_subtitle) { - _subtitleLabel.text = _subtitle; - if (_subtitleLabel.hidden) { - _subtitleLabel.hidden = NO; - } - } else { - if (!_subtitleLabel.hidden) { - _subtitleLabel.hidden = YES; - } - } - if (_needsAdjustingViewFrame || CGSizeEqualToSize(_titleLabel.frame.size, CGSizeZero)) { - _needsAdjustingViewFrame = NO; - - if (_subtitle) { - CGFloat titleHeight = [@"1" sizeWithAttributes:@{NSFontAttributeName:_titleLabel.font}].height; - CGFloat subtitleHeight = [@"1" sizeWithAttributes:@{NSFontAttributeName:_subtitleLabel.font}].height; - - CGFloat height = titleHeight + subtitleHeight; - _titleLabel.frame = CGRectMake(0, - (self.contentView.fs_height*5.0/6.0-height)*0.5+_appearance.titleVerticalOffset, - self.fs_width, - titleHeight); - - _subtitleLabel.frame = CGRectMake(0, - _titleLabel.fs_bottom - (_titleLabel.fs_height-_titleLabel.font.pointSize)+_appearance.subtitleVerticalOffset, - self.fs_width, - subtitleHeight); - } else { - _titleLabel.frame = CGRectMake(0, _appearance.titleVerticalOffset, self.contentView.fs_width, floor(self.contentView.fs_height*5.0/6.0)); - } - - } - UIColor *textColor = self.colorForTitleLabel; if (![textColor isEqual:_titleLabel.textColor]) { _titleLabel.textColor = textColor; } + UIFont *titleFont = self.calendar.appearance.titleFont; + if (![titleFont isEqual:_titleLabel.font]) { + _titleLabel.font = titleFont; + } if (_subtitle) { textColor = self.colorForSubtitleLabel; if (![textColor isEqual:_subtitleLabel.textColor]) { _subtitleLabel.textColor = textColor; } + titleFont = self.calendar.appearance.subtitleFont; + if (![titleFont isEqual:_subtitleLabel.font]) { + _subtitleLabel.font = titleFont; + } } UIColor *borderColor = self.colorForCellBorder; - BOOL shouldHiddenBackgroundLayer = !self.selected && !self.dateIsToday && !self.dateIsSelected && !borderColor; + UIColor *fillColor = self.colorForCellFill; - if (_backgroundLayer.hidden != shouldHiddenBackgroundLayer) { - _backgroundLayer.hidden = shouldHiddenBackgroundLayer; + BOOL shouldHideShapeLayer = !self.selected && !self.dateIsToday && !borderColor && !fillColor; + + if (_shapeLayer.opacity == shouldHideShapeLayer) { + _shapeLayer.opacity = !shouldHideShapeLayer; } - if (!shouldHiddenBackgroundLayer) { + if (!shouldHideShapeLayer) { - CGPathRef path = self.cellShape == FSCalendarCellShapeCircle ? - [UIBezierPath bezierPathWithOvalInRect:_backgroundLayer.bounds].CGPath : - [UIBezierPath bezierPathWithRect:_backgroundLayer.bounds].CGPath; - if (!CGPathEqualToPath(_backgroundLayer.path,path)) { - _backgroundLayer.path = path; + CGColorRef cellFillColor = self.colorForCellFill.CGColor; + if (!CGColorEqualToColor(_shapeLayer.fillColor, cellFillColor)) { + _shapeLayer.fillColor = cellFillColor; } - CGColorRef backgroundColor = self.colorForBackgroundLayer.CGColor; - if (!CGColorEqualToColor(_backgroundLayer.fillColor, backgroundColor)) { - _backgroundLayer.fillColor = backgroundColor; + CGColorRef cellBorderColor = self.colorForCellBorder.CGColor; + if (!CGColorEqualToColor(_shapeLayer.strokeColor, cellBorderColor)) { + _shapeLayer.strokeColor = cellBorderColor; } - CGColorRef borderColor = self.colorForCellBorder.CGColor; - if (!CGColorEqualToColor(_backgroundLayer.strokeColor, borderColor)) { - _backgroundLayer.strokeColor = borderColor; + CGPathRef path = [UIBezierPath bezierPathWithRoundedRect:_shapeLayer.bounds + cornerRadius:CGRectGetWidth(_shapeLayer.bounds)*0.5*self.borderRadius].CGPath; + if (!CGPathEqualToPath(_shapeLayer.path, path)) { + _shapeLayer.path = path; } } if (![_image isEqual:_imageView.image]) { - [self invalidateImage]; + _imageView.image = _image; + _imageView.hidden = !_image; } if (_eventIndicator.hidden == (_numberOfEvents > 0)) { _eventIndicator.hidden = !_numberOfEvents; } + _eventIndicator.numberOfEvents = self.numberOfEvents; - _eventIndicator.color = self.preferredEventColor ?: _appearance.eventColor; -} + _eventIndicator.color = self.colorsForEvents; -- (BOOL)isWeekend -{ - return _date && ([_calendar weekdayOfDate:_date] == 1 || [_calendar weekdayOfDate:_date] == 7); } - (UIColor *)colorForCurrentStateInDictionary:(NSDictionary *)dictionary { - if (self.isSelected || self.dateIsSelected) { + if (self.isSelected) { if (self.dateIsToday) { return dictionary[@(FSCalendarCellStateSelected|FSCalendarCellStateToday)] ?: dictionary[@(FSCalendarCellStateSelected)]; } @@ -240,77 +268,28 @@ if (self.dateIsToday && [[dictionary allKeys] containsObject:@(FSCalendarCellStateToday)]) { return dictionary[@(FSCalendarCellStateToday)]; } - if (self.dateIsPlaceholder && [[dictionary allKeys] containsObject:@(FSCalendarCellStatePlaceholder)]) { + if (self.placeholder && [[dictionary allKeys] containsObject:@(FSCalendarCellStatePlaceholder)]) { return dictionary[@(FSCalendarCellStatePlaceholder)]; } - if (self.isWeekend && [[dictionary allKeys] containsObject:@(FSCalendarCellStateWeekend)]) { + if (self.weekend && [[dictionary allKeys] containsObject:@(FSCalendarCellStateWeekend)]) { return dictionary[@(FSCalendarCellStateWeekend)]; } return dictionary[@(FSCalendarCellStateNormal)]; } -- (void)invalidateTitleFont -{ - _titleLabel.font = self.appearance.preferredTitleFont; -} - -- (void)invalidateTitleTextColor -{ - _titleLabel.textColor = self.colorForTitleLabel; -} - -- (void)invalidateSubtitleFont -{ - _subtitleLabel.font = self.appearance.preferredSubtitleFont; -} - -- (void)invalidateSubtitleTextColor -{ - _subtitleLabel.textColor = self.colorForSubtitleLabel; -} - -- (void)invalidateBorderColors -{ - _backgroundLayer.strokeColor = self.colorForCellBorder.CGColor; -} - -- (void)invalidateBackgroundColors -{ - _backgroundLayer.fillColor = self.colorForBackgroundLayer.CGColor; -} - -- (void)invalidateEventColors -{ - _eventIndicator.color = self.preferredEventColor ?: _appearance.eventColor; -} - -- (void)invalidateCellShapes -{ - CGPathRef path = self.cellShape == FSCalendarCellShapeCircle ? - [UIBezierPath bezierPathWithOvalInRect:_backgroundLayer.bounds].CGPath : - [UIBezierPath bezierPathWithRect:_backgroundLayer.bounds].CGPath; - _backgroundLayer.path = path; -} - -- (void)invalidateImage -{ - _imageView.image = _image; - _imageView.hidden = !_image; -} - #pragma mark - Properties -- (UIColor *)colorForBackgroundLayer +- (UIColor *)colorForCellFill { - if (self.dateIsSelected || self.isSelected) { - return self.preferredSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.backgroundColors]; + if (self.selected) { + return self.preferredFillSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.backgroundColors]; } - return [self colorForCurrentStateInDictionary:_appearance.backgroundColors]; + return self.preferredFillDefaultColor ?: [self colorForCurrentStateInDictionary:_appearance.backgroundColors]; } - (UIColor *)colorForTitleLabel { - if (self.dateIsSelected || self.isSelected) { + if (self.selected) { return self.preferredTitleSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.titleColors]; } return self.preferredTitleDefaultColor ?: [self colorForCurrentStateInDictionary:_appearance.titleColors]; @@ -318,7 +297,7 @@ - (UIColor *)colorForSubtitleLabel { - if (self.dateIsSelected || self.isSelected) { + if (self.selected) { return self.preferredSubtitleSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.subtitleColors]; } return self.preferredSubtitleDefaultColor ?: [self colorForCurrentStateInDictionary:_appearance.subtitleColors]; @@ -326,51 +305,168 @@ - (UIColor *)colorForCellBorder { - if (self.dateIsSelected || self.isSelected) { + if (self.selected) { return _preferredBorderSelectionColor ?: _appearance.borderSelectionColor; } return _preferredBorderDefaultColor ?: _appearance.borderDefaultColor; } -- (FSCalendarCellShape)cellShape +- (NSArray *)colorsForEvents { - return _preferredCellShape ?: _appearance.cellShape; + if (self.selected) { + return _preferredEventSelectionColors ?: @[_appearance.eventSelectionColor]; + } + return _preferredEventDefaultColors ?: @[_appearance.eventDefaultColor]; } +- (CGFloat)borderRadius +{ + return _preferredBorderRadius >= 0 ? _preferredBorderRadius : _appearance.borderRadius; +} + +#define OFFSET_PROPERTY(NAME,CAPITAL,ALTERNATIVE) \ +\ +@synthesize NAME = _##NAME; \ +\ +- (void)set##CAPITAL:(CGPoint)NAME \ +{ \ + BOOL diff = !CGPointEqualToPoint(NAME, self.NAME); \ + _##NAME = NAME; \ + if (diff) { \ + [self setNeedsLayout]; \ + } \ +} \ +\ +- (CGPoint)NAME \ +{ \ + return CGPointEqualToPoint(_##NAME, CGPointInfinity) ? ALTERNATIVE : _##NAME; \ +} + +OFFSET_PROPERTY(preferredTitleOffset, PreferredTitleOffset, _appearance.titleOffset); +OFFSET_PROPERTY(preferredSubtitleOffset, PreferredSubtitleOffset, _appearance.subtitleOffset); +OFFSET_PROPERTY(preferredImageOffset, PreferredImageOffset, _appearance.imageOffset); +OFFSET_PROPERTY(preferredEventOffset, PreferredEventOffset, _appearance.eventOffset); + +#undef OFFSET_PROPERTY + - (void)setCalendar:(FSCalendar *)calendar { if (![_calendar isEqual:calendar]) { _calendar = calendar; - } - if (![_appearance isEqual:calendar.appearance]) { _appearance = calendar.appearance; - [self invalidateTitleFont]; - [self invalidateSubtitleFont]; - [self invalidateTitleTextColor]; - [self invalidateSubtitleTextColor]; - [self invalidateEventColors]; + [self configureAppearance]; } } - (void)setSubtitle:(NSString *)subtitle { if (![_subtitle isEqualToString:subtitle]) { - _needsAdjustingViewFrame = !(_subtitle.length && subtitle.length); + BOOL diff = (subtitle.length && !_subtitle.length) || (_subtitle.length && !subtitle.length); _subtitle = subtitle; - if (_needsAdjustingViewFrame) { + if (diff) { [self setNeedsLayout]; } } } -- (void)setNeedsAdjustingViewFrame:(BOOL)needsAdjustingViewFrame -{ - if (_needsAdjustingViewFrame != needsAdjustingViewFrame) { - _needsAdjustingViewFrame = needsAdjustingViewFrame; - _eventIndicator.needsAdjustingViewFrame = needsAdjustingViewFrame; - } -} - +@end + + +@interface FSCalendarEventIndicator () + +@property (weak, nonatomic) UIView *contentView; + +@property (strong, nonatomic) NSPointerArray *eventLayers; + +@end + +@implementation FSCalendarEventIndicator + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + + UIView *view = [[UIView alloc] initWithFrame:CGRectZero]; + [self addSubview:view]; + self.contentView = view; + + self.eventLayers = [NSPointerArray weakObjectsPointerArray]; + for (int i = 0; i < 3; i++) { + CALayer *layer = [CALayer layer]; + layer.backgroundColor = [UIColor clearColor].CGColor; + [self.contentView.layer addSublayer:layer]; + [self.eventLayers addPointer:(__bridge void * _Nullable)(layer)]; + } + + } + return self; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + CGFloat diameter = MIN(MIN(self.fs_width, self.fs_height),FSCalendarMaximumEventDotDiameter); + self.contentView.fs_height = self.fs_height; + self.contentView.fs_width = (self.numberOfEvents*2-1)*diameter; + self.contentView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); +} + +- (void)layoutSublayersOfLayer:(CALayer *)layer +{ + [super layoutSublayersOfLayer:layer]; + if (layer == self.layer) { + + CGFloat diameter = MIN(MIN(self.fs_width, self.fs_height),FSCalendarMaximumEventDotDiameter); + for (int i = 0; i < self.eventLayers.count; i++) { + CALayer *eventLayer = [self.eventLayers pointerAtIndex:i]; + eventLayer.hidden = i >= self.numberOfEvents; + if (!eventLayer.hidden) { + eventLayer.frame = CGRectMake(2*i*diameter, (self.fs_height-diameter)*0.5, diameter, diameter); + if (eventLayer.cornerRadius != diameter/2) { + eventLayer.cornerRadius = diameter/2; + } + } + } + } +} + +- (void)setColor:(id)color +{ + if (![_color isEqual:color]) { + _color = color; + + if ([_color isKindOfClass:[UIColor class]]) { + for (NSInteger i = 0; i < self.eventLayers.count; i++) { + CALayer *layer = [self.eventLayers pointerAtIndex:i]; + layer.backgroundColor = [_color CGColor]; + } + } else if ([_color isKindOfClass:[NSArray class]]) { + NSArray *colors = (NSArray *)_color; + for (int i = 0; i < self.eventLayers.count; i++) { + CALayer *eventLayer = [self.eventLayers pointerAtIndex:i]; + eventLayer.backgroundColor = colors[MIN(i,colors.count-1)].CGColor; + } + } + + } +} + +- (void)setNumberOfEvents:(NSInteger)numberOfEvents +{ + if (_numberOfEvents != numberOfEvents) { + _numberOfEvents = MIN(MAX(numberOfEvents,0),3); + [self setNeedsLayout]; + } +} + +@end + + +@implementation FSCalendarBlankCell + +- (void)configureAppearance {} + @end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.h index 1d0f577..db38586 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.h @@ -3,7 +3,7 @@ // FSCalendar // // Created by Wenchao Ding on 10/25/15. -// Copyright (c) 2015 wenchaoios. All rights reserved. +// Copyright (c) 2015 Wenchao Ding. All rights reserved. // #import @@ -11,3 +11,8 @@ @interface FSCalendarCollectionView : UICollectionView @end + + +@interface FSCalendarSeparator : UICollectionReusableView + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.m index 1b450fd..cfec7aa 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionView.m @@ -3,11 +3,14 @@ // FSCalendar // // Created by Wenchao Ding on 10/25/15. -// Copyright (c) 2015 wenchaoios. All rights reserved. +// Copyright (c) 2015 Wenchao Ding. All rights reserved. // +// Reject -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + #import "FSCalendarCollectionView.h" -#import "FSCalendarCell.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarConstants.h" @interface FSCalendarCollectionView () @@ -41,16 +44,27 @@ { self.scrollsToTop = NO; self.contentInset = UIEdgeInsetsZero; + #ifdef __IPHONE_9_0 if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) { self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; } #endif + +#ifdef __IPHONE_10_0 + SEL selector = NSSelectorFromString(@"setPrefetchingEnabled:"); + if (selector && [self respondsToSelector:selector]) { + [self fs_performSelector:selector withObjects:@NO, nil]; + } +#endif } - (void)setContentInset:(UIEdgeInsets)contentInset { [super setContentInset:UIEdgeInsetsZero]; + if (contentInset.top) { + self.contentOffset = CGPointMake(self.contentOffset.x, self.contentOffset.y+contentInset.top); + } } - (void)setScrollsToTop:(BOOL)scrollsToTop @@ -60,3 +74,24 @@ @end + +@implementation FSCalendarSeparator + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + self.backgroundColor = FSCalendarStandardSeparatorColor; + } + return self; +} + +- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes +{ + self.frame = layoutAttributes.frame; +} + +@end + + + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionViewLayout.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionViewLayout.h new file mode 100644 index 0000000..a9e5f43 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionViewLayout.h @@ -0,0 +1,22 @@ +// +// FSCalendarAnimationLayout.h +// FSCalendar +// +// Created by dingwenchao on 1/3/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import + +@class FSCalendar; + +@interface FSCalendarCollectionViewLayout : UICollectionViewLayout + +@property (weak, nonatomic) FSCalendar *calendar; + +@property (assign, nonatomic) CGFloat interitemSpacing; +@property (assign, nonatomic) UIEdgeInsets sectionInsets; +@property (assign, nonatomic) UICollectionViewScrollDirection scrollDirection; +@property (assign, nonatomic) CGSize headerReferenceSize; + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionViewLayout.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionViewLayout.m new file mode 100644 index 0000000..47d1866 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarCollectionViewLayout.m @@ -0,0 +1,561 @@ +// +// FSCalendarAnimationLayout.m +// FSCalendar +// +// Created by dingwenchao on 1/3/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendarCollectionViewLayout.h" +#import "FSCalendar.h" +#import "FSCalendarDynamicHeader.h" +#import "FSCalendarCollectionView.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarConstants.h" + +#define kFSCalendarSeparatorInterRows @"FSCalendarSeparatorInterRows" +#define kFSCalendarSeparatorInterColumns @"FSCalendarSeparatorInterColumns" + +@interface FSCalendarCollectionViewLayout () + +@property (assign, nonatomic) CGFloat *widths; +@property (assign, nonatomic) CGFloat *heights; +@property (assign, nonatomic) CGFloat *lefts; +@property (assign, nonatomic) CGFloat *tops; + +@property (assign, nonatomic) CGFloat *sectionHeights; +@property (assign, nonatomic) CGFloat *sectionTops; +@property (assign, nonatomic) CGFloat *sectionBottoms; +@property (assign, nonatomic) CGFloat *sectionRowCounts; + +@property (assign, nonatomic) CGSize estimatedItemSize; + +@property (assign, nonatomic) CGSize contentSize; +@property (assign, nonatomic) CGSize collectionViewSize; +@property (assign, nonatomic) NSInteger numberOfSections; + +@property (assign, nonatomic) FSCalendarSeparators separators; + +@property (strong, nonatomic) NSMutableDictionary *itemAttributes; +@property (strong, nonatomic) NSMutableDictionary *headerAttributes; +@property (strong, nonatomic) NSMutableDictionary *rowSeparatorAttributes; + +- (void)didReceiveNotifications:(NSNotification *)notification; + +@end + +@implementation FSCalendarCollectionViewLayout + +- (instancetype)init +{ + self = [super init]; + if (self) { + self.estimatedItemSize = CGSizeZero; + self.widths = NULL; + self.heights = NULL; + self.tops = NULL; + self.lefts = NULL; + + self.sectionHeights = NULL; + self.sectionTops = NULL; + self.sectionBottoms = NULL; + self.sectionRowCounts = NULL; + + self.scrollDirection = UICollectionViewScrollDirectionHorizontal; + self.sectionInsets = UIEdgeInsetsMake(5, 0, 5, 0); + + self.itemAttributes = [NSMutableDictionary dictionary]; + self.headerAttributes = [NSMutableDictionary dictionary]; + self.rowSeparatorAttributes = [NSMutableDictionary dictionary]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveNotifications:) name:UIDeviceOrientationDidChangeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveNotifications:) name:UIScreenDidConnectNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveNotifications:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + + [self registerClass:[FSCalendarSeparator class] forDecorationViewOfKind:kFSCalendarSeparatorInterRows]; + } + return self; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil]; + + free(self.widths); + free(self.heights); + free(self.tops); + free(self.lefts); + + free(self.sectionHeights); + free(self.sectionTops); + free(self.sectionRowCounts); + free(self.sectionBottoms); +} + +- (void)prepareLayout +{ + if (CGSizeEqualToSize(self.collectionViewSize, self.collectionView.frame.size) && self.numberOfSections == self.collectionView.numberOfSections && self.separators == self.calendar.appearance.separators) { + return; + } + self.collectionViewSize = self.collectionView.frame.size; + self.separators = self.calendar.appearance.separators; + + [self.itemAttributes removeAllObjects]; + [self.headerAttributes removeAllObjects]; + [self.rowSeparatorAttributes removeAllObjects]; + + self.headerReferenceSize = ({ + CGSize headerSize = CGSizeZero; + if (self.calendar.floatingMode) { + CGFloat headerHeight = self.calendar.preferredWeekdayHeight*1.5+self.calendar.preferredHeaderHeight; + headerSize = CGSizeMake(self.collectionView.fs_width, headerHeight); + } + headerSize; + }); + self.estimatedItemSize = ({ + CGFloat width = (self.collectionView.fs_width-self.sectionInsets.left-self.sectionInsets.right)/7.0; + CGFloat height = ({ + CGFloat height = FSCalendarStandardRowHeight; + if (!self.calendar.floatingMode) { + switch (self.calendar.transitionCoordinator.representingScope) { + case FSCalendarScopeMonth: { + height = (self.collectionView.fs_height-self.sectionInsets.top-self.sectionInsets.bottom)/6.0; + break; + } + case FSCalendarScopeWeek: { + height = (self.collectionView.fs_height-self.sectionInsets.top-self.sectionInsets.bottom); + break; + } + default: + break; + } + } else { + height = self.calendar.rowHeight; + } + height; + }); + CGSize size = CGSizeMake(width, height); + size; + }); + + // Calculate item widths and lefts + free(self.widths); + self.widths = ({ + NSInteger columnCount = 7; + size_t columnSize = sizeof(CGFloat)*columnCount; + CGFloat *widths = malloc(columnSize); + CGFloat contentWidth = self.collectionView.fs_width - self.sectionInsets.left - self.sectionInsets.right; + FSCalendarSliceCake(contentWidth, columnCount, widths); + widths; + }); + + free(self.lefts); + self.lefts = ({ + NSInteger columnCount = 7; + size_t columnSize = sizeof(CGFloat)*columnCount; + CGFloat *lefts = malloc(columnSize); + lefts[0] = self.sectionInsets.left; + for (int i = 1; i < columnCount; i++) { + lefts[i] = lefts[i-1] + self.widths[i-1]; + } + lefts; + }); + + // Calculate item heights and tops + free(self.heights); + self.heights = ({ + NSInteger rowCount = self.calendar.transitionCoordinator.representingScope == FSCalendarScopeWeek ? 1 : 6; + size_t rowSize = sizeof(CGFloat)*rowCount; + CGFloat *heights = malloc(rowSize); + if (!self.calendar.floatingMode) { + CGFloat contentHeight = self.collectionView.fs_height - self.sectionInsets.top - self.sectionInsets.bottom; + FSCalendarSliceCake(contentHeight, rowCount, heights); + } else { + for (int i = 0; i < rowCount; i++) { + heights[i] = self.estimatedItemSize.height; + } + } + heights; + }); + + free(self.tops); + self.tops = ({ + NSInteger rowCount = self.calendar.transitionCoordinator.representingScope == FSCalendarScopeWeek ? 1 : 6; + size_t rowSize = sizeof(CGFloat)*rowCount; + CGFloat *tops = malloc(rowSize); + tops[0] = self.sectionInsets.top; + for (int i = 1; i < rowCount; i++) { + tops[i] = tops[i-1] + self.heights[i-1]; + } + tops; + }); + + // Calculate content size + self.numberOfSections = self.collectionView.numberOfSections; + self.contentSize = ({ + CGSize contentSize = CGSizeZero; + if (!self.calendar.floatingMode) { + CGFloat width = self.collectionView.fs_width; + CGFloat height = self.collectionView.fs_height; + switch (self.scrollDirection) { + case UICollectionViewScrollDirectionHorizontal: { + width *= self.numberOfSections; + break; + } + case UICollectionViewScrollDirectionVertical: { + height *= self.numberOfSections; + break; + } + default: + break; + } + contentSize = CGSizeMake(width, height); + } else { + free(self.sectionHeights); + self.sectionHeights = malloc(sizeof(CGFloat)*self.numberOfSections); + free(self.sectionRowCounts); + self.sectionRowCounts = malloc(sizeof(NSInteger)*self.numberOfSections); + CGFloat width = self.collectionView.fs_width; + CGFloat height = 0; + for (int i = 0; i < self.numberOfSections; i++) { + NSInteger rowCount = [self.calendar.calculator numberOfRowsInSection:i]; + self.sectionRowCounts[i] = rowCount; + CGFloat sectionHeight = self.headerReferenceSize.height; + for (int j = 0; j < rowCount; j++) { + sectionHeight += self.heights[j]; + } + self.sectionHeights[i] = sectionHeight; + height += sectionHeight; + } + free(self.sectionTops); + self.sectionTops = malloc(sizeof(CGFloat)*self.numberOfSections); + free(self.sectionBottoms); + self.sectionBottoms = malloc(sizeof(CGFloat)*self.numberOfSections); + self.sectionTops[0] = 0; + self.sectionBottoms[0] = self.sectionHeights[0]; + for (int i = 1; i < self.numberOfSections; i++) { + self.sectionTops[i] = self.sectionTops[i-1] + self.sectionHeights[i-1]; + self.sectionBottoms[i] = self.sectionTops[i] + self.sectionHeights[i]; + } + contentSize = CGSizeMake(width, height); + } + contentSize; + }); + + [self.calendar adjustMonthPosition]; +} + +- (CGSize)collectionViewContentSize +{ + return self.contentSize; +} + +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect +{ + // Clipping + rect = CGRectIntersection(rect, CGRectMake(0, 0, self.contentSize.width, self.contentSize.height)); + if (CGRectIsEmpty(rect)) return nil; + + // Calculating attributes + NSMutableArray *layoutAttributes = [NSMutableArray array]; + + if (!self.calendar.floatingMode) { + + switch (self.scrollDirection) { + case UICollectionViewScrollDirectionHorizontal: { + + NSInteger startColumn = ({ + NSInteger startSection = rect.origin.x/self.collectionView.fs_width; + CGFloat widthDelta = FSCalendarMod(CGRectGetMinX(rect), self.collectionView.fs_width)-self.sectionInsets.left; + widthDelta = MIN(MAX(0, widthDelta), self.collectionView.fs_width-self.sectionInsets.left); + NSInteger countDelta = FSCalendarFloor(widthDelta/self.estimatedItemSize.width); + NSInteger startColumn = startSection*7 + countDelta; + startColumn; + }); + + NSInteger endColumn = ({ + NSInteger endColumn; + CGFloat section = CGRectGetMaxX(rect)/self.collectionView.fs_width; + CGFloat remainder = FSCalendarMod(section, 1); + // https://stackoverflow.com/a/10335601/2398107 + if (remainder <= MAX(100*FLT_EPSILON*ABS(remainder), FLT_MIN)) { + endColumn = FSCalendarFloor(section)*7 - 1; + } else { + CGFloat widthDelta = FSCalendarMod(CGRectGetMaxX(rect), self.collectionView.fs_width)-self.sectionInsets.left; + widthDelta = MIN(MAX(0, widthDelta), self.collectionView.fs_width - self.sectionInsets.left); + NSInteger countDelta = FSCalendarCeil(widthDelta/self.estimatedItemSize.width); + endColumn = FSCalendarFloor(section)*7 + countDelta - 1; + } + endColumn; + }); + + NSInteger numberOfRows = self.calendar.transitionCoordinator.representingScope == FSCalendarScopeMonth ? 6 : 1; + + for (NSInteger column = startColumn; column <= endColumn; column++) { + for (NSInteger row = 0; row < numberOfRows; row++) { + NSInteger section = column / 7; + NSInteger item = column % 7 + row * 7; + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:section]; + UICollectionViewLayoutAttributes *itemAttributes = [self layoutAttributesForItemAtIndexPath:indexPath]; + [layoutAttributes addObject:itemAttributes]; + + UICollectionViewLayoutAttributes *rowSeparatorAttributes = [self layoutAttributesForDecorationViewOfKind:kFSCalendarSeparatorInterRows atIndexPath:indexPath]; + if (rowSeparatorAttributes) { + [layoutAttributes addObject:rowSeparatorAttributes]; + } + } + } + + break; + } + case UICollectionViewScrollDirectionVertical: { + + NSInteger startRow = ({ + NSInteger startSection = rect.origin.y/self.collectionView.fs_height; + CGFloat heightDelta = FSCalendarMod(CGRectGetMinY(rect), self.collectionView.fs_height)-self.sectionInsets.top; + heightDelta = MIN(MAX(0, heightDelta), self.collectionView.fs_height-self.sectionInsets.top); + NSInteger countDelta = FSCalendarFloor(heightDelta/self.estimatedItemSize.height); + NSInteger startRow = startSection*6 + countDelta; + startRow; + }); + + NSInteger endRow = ({ + NSInteger endRow; + CGFloat section = CGRectGetMaxY(rect)/self.collectionView.fs_height; + CGFloat remainder = FSCalendarMod(section, 1); + // https://stackoverflow.com/a/10335601/2398107 + if (remainder <= MAX(100*FLT_EPSILON*ABS(remainder), FLT_MIN)) { + endRow = FSCalendarFloor(section)*6 - 1; + } else { + CGFloat heightDelta = FSCalendarMod(CGRectGetMaxY(rect), self.collectionView.fs_height)-self.sectionInsets.top; + heightDelta = MIN(MAX(0, heightDelta), self.collectionView.fs_height-self.sectionInsets.top); + NSInteger countDelta = FSCalendarCeil(heightDelta/self.estimatedItemSize.height); + endRow = FSCalendarFloor(section)*6 + countDelta-1; + } + endRow; + }); + + for (NSInteger row = startRow; row <= endRow; row++) { + for (NSInteger column = 0; column < 7; column++) { + NSInteger section = row / 6; + NSInteger item = column + (row % 6) * 7; + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:section]; + UICollectionViewLayoutAttributes *itemAttributes = [self layoutAttributesForItemAtIndexPath:indexPath]; + [layoutAttributes addObject:itemAttributes]; + + UICollectionViewLayoutAttributes *rowSeparatorAttributes = [self layoutAttributesForDecorationViewOfKind:kFSCalendarSeparatorInterRows atIndexPath:indexPath]; + if (rowSeparatorAttributes) { + [layoutAttributes addObject:rowSeparatorAttributes]; + } + + } + } + + break; + } + default: + break; + } + + } else { + + NSInteger startSection = [self searchStartSection:rect :0 :self.numberOfSections-1]; + NSInteger startRowIndex = ({ + CGFloat heightDelta1 = MIN(self.sectionBottoms[startSection]-CGRectGetMinY(rect)-self.sectionInsets.bottom, self.sectionRowCounts[startSection]*self.estimatedItemSize.height); + NSInteger startRowCount = FSCalendarCeil(heightDelta1/self.estimatedItemSize.height); + NSInteger startRowIndex = self.sectionRowCounts[startSection]-startRowCount; + startRowIndex; + }); + + NSInteger endSection = [self searchEndSection:rect :startSection :self.numberOfSections-1]; + NSInteger endRowIndex = ({ + CGFloat heightDelta2 = MAX(CGRectGetMaxY(rect) - self.sectionTops[endSection]- self.headerReferenceSize.height - self.sectionInsets.top, 0); + NSInteger endRowCount = FSCalendarCeil(heightDelta2/self.estimatedItemSize.height); + NSInteger endRowIndex = endRowCount - 1; + endRowIndex; + }); + for (NSInteger section = startSection; section <= endSection; section++) { + NSInteger startRow = (section == startSection) ? startRowIndex : 0; + NSInteger endRow = (section == endSection) ? endRowIndex : self.sectionRowCounts[section]-1; + UICollectionViewLayoutAttributes *headerAttributes = [self layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionHeader atIndexPath:[NSIndexPath indexPathForItem:0 inSection:section]]; + [layoutAttributes addObject:headerAttributes]; + for (NSInteger row = startRow; row <= endRow; row++) { + for (NSInteger column = 0; column < 7; column++) { + NSInteger item = row * 7 + column; + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:section]; + UICollectionViewLayoutAttributes *itemAttributes = [self layoutAttributesForItemAtIndexPath:indexPath]; + [layoutAttributes addObject:itemAttributes]; + UICollectionViewLayoutAttributes *rowSeparatorAttributes = [self layoutAttributesForDecorationViewOfKind:kFSCalendarSeparatorInterRows atIndexPath:indexPath]; + if (rowSeparatorAttributes) { + [layoutAttributes addObject:rowSeparatorAttributes]; + } + } + } + } + + } + return [NSArray arrayWithArray:layoutAttributes]; + +} + +// Items +- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath +{ + FSCalendarCoordinate coordinate = [self.calendar.calculator coordinateForIndexPath:indexPath]; + NSInteger column = coordinate.column; + NSInteger row = coordinate.row; + UICollectionViewLayoutAttributes *attributes = self.itemAttributes[indexPath]; + if (!attributes) { + attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; + CGRect frame = ({ + CGFloat x, y; + switch (self.scrollDirection) { + case UICollectionViewScrollDirectionHorizontal: { + x = self.lefts[column] + indexPath.section * self.collectionView.fs_width; + y = self.tops[row]; + break; + } + case UICollectionViewScrollDirectionVertical: { + x = self.lefts[column]; + if (!self.calendar.floatingMode) { + y = self.tops[row] + indexPath.section * self.collectionView.fs_height; + } else { + y = self.sectionTops[indexPath.section] + self.headerReferenceSize.height + self.tops[row]; + } + break; + } + default: + break; + } + CGFloat width = self.widths[column]; + CGFloat height = self.heights[row]; + CGRect frame = CGRectMake(x, y, width, height); + frame; + }); + attributes.frame = frame; + self.itemAttributes[indexPath] = attributes; + } + return attributes; +} + +// Section headers +- (UICollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath +{ + if ([elementKind isEqualToString:UICollectionElementKindSectionHeader]) { + UICollectionViewLayoutAttributes *attributes = self.headerAttributes[indexPath]; + if (!attributes) { + attributes = [UICollectionViewLayoutAttributes layoutAttributesForSupplementaryViewOfKind:UICollectionElementKindSectionHeader withIndexPath:indexPath]; + attributes.frame = CGRectMake(0, self.sectionTops[indexPath.section], self.collectionView.fs_width, self.headerReferenceSize.height); + self.headerAttributes[indexPath] = attributes; + } + return attributes; + } + return nil; +} + +// Separators +- (UICollectionViewLayoutAttributes *)layoutAttributesForDecorationViewOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath +{ + if ([elementKind isEqualToString:kFSCalendarSeparatorInterRows] && (self.separators & FSCalendarSeparatorInterRows)) { + UICollectionViewLayoutAttributes *attributes = self.rowSeparatorAttributes[indexPath]; + if (!attributes) { + FSCalendarCoordinate coordinate = [self.calendar.calculator coordinateForIndexPath:indexPath]; + if (coordinate.row >= [self.calendar.calculator numberOfRowsInSection:indexPath.section]-1) { + return nil; + } + attributes = [UICollectionViewLayoutAttributes layoutAttributesForDecorationViewOfKind:kFSCalendarSeparatorInterRows withIndexPath:indexPath]; + CGFloat x, y; + if (!self.calendar.floatingMode) { + switch (self.scrollDirection) { + case UICollectionViewScrollDirectionHorizontal: { + x = self.lefts[coordinate.column] + indexPath.section * self.collectionView.fs_width; + y = self.tops[coordinate.row]+self.heights[coordinate.row]; + break; + } + case UICollectionViewScrollDirectionVertical: { + x = 0; + y = self.tops[coordinate.row]+self.heights[coordinate.row] + indexPath.section * self.collectionView.fs_height; + break; + } + default: + break; + } + } else { + x = 0; + y = self.sectionTops[indexPath.section] + self.headerReferenceSize.height + self.tops[coordinate.row] + self.heights[coordinate.row]; + } + CGFloat width = self.collectionView.fs_width; + CGFloat height = FSCalendarStandardSeparatorThickness; + attributes.frame = CGRectMake(x, y, width, height); + attributes.zIndex = NSIntegerMax; + self.rowSeparatorAttributes[indexPath] = attributes; + } + return attributes; + } + return nil; +} + +#pragma mark - Notifications + +- (void)didReceiveNotifications:(NSNotification *)notification +{ + if ([notification.name isEqualToString:UIDeviceOrientationDidChangeNotification]) { + [self invalidateLayout]; + } + if ([notification.name isEqualToString:UIApplicationDidReceiveMemoryWarningNotification]) { + [self.itemAttributes removeAllObjects]; + [self.headerAttributes removeAllObjects]; + [self.rowSeparatorAttributes removeAllObjects]; + } +} + +#pragma mark - Private properties + +- (void)setScrollDirection:(UICollectionViewScrollDirection)scrollDirection +{ + if (_scrollDirection != scrollDirection) { + _scrollDirection = scrollDirection; + self.collectionViewSize = CGSizeAutomatic; + } +} + +#pragma mark - Private functions + +- (NSInteger)searchStartSection:(CGRect)rect :(NSInteger)left :(NSInteger)right +{ + NSInteger mid = left + (right-left)/2; + CGFloat y = rect.origin.y; + CGFloat minY = self.sectionTops[mid]; + CGFloat maxY = self.sectionBottoms[mid]; + if (y >= minY && y < maxY) { + return mid; + } else if (y < minY) { + return [self searchStartSection:rect :left :mid]; + } else { + return [self searchStartSection:rect :mid+1 :right]; + } +} + +- (NSInteger)searchEndSection:(CGRect)rect :(NSInteger)left :(NSInteger)right +{ + NSInteger mid = left + (right-left)/2; + CGFloat y = CGRectGetMaxY(rect); + CGFloat minY = self.sectionTops[mid]; + CGFloat maxY = self.sectionBottoms[mid]; + if (y > minY && y <= maxY) { + return mid; + } else if (y <= minY) { + return [self searchEndSection:rect :left :mid]; + } else { + return [self searchEndSection:rect :mid+1 :right]; + } +} + +@end + + +#undef kFSCalendarSeparatorInterColumns +#undef kFSCalendarSeparatorInterRows + + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstance.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstance.h deleted file mode 100644 index 3adc915..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstance.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// FSCalendarConstane.h -// FSCalendar -// -// Created by dingwenchao on 8/28/15. -// Copyright © 2016 Wenchao Ding. All rights reserved. -// -// https://github.com/WenchaoD -// - -#import -#import - -#pragma mark - Constance - -UIKIT_EXTERN CGFloat const FSCalendarStandardHeaderHeight; -UIKIT_EXTERN CGFloat const FSCalendarStandardWeekdayHeight; -UIKIT_EXTERN CGFloat const FSCalendarStandardMonthlyPageHeight; -UIKIT_EXTERN CGFloat const FSCalendarStandardWeeklyPageHeight; -UIKIT_EXTERN CGFloat const FSCalendarStandardCellDiameter; -UIKIT_EXTERN CGFloat const FSCalendarAutomaticDimension; -UIKIT_EXTERN CGFloat const FSCalendarDefaultBounceAnimationDuration; -UIKIT_EXTERN CGFloat const FSCalendarStandardRowHeight; -UIKIT_EXTERN CGFloat const FSCalendarStandardTitleTextSize; -UIKIT_EXTERN CGFloat const FSCalendarStandardSubtitleTextSize; -UIKIT_EXTERN CGFloat const FSCalendarStandardWeekdayTextSize; -UIKIT_EXTERN CGFloat const FSCalendarStandardHeaderTextSize; -UIKIT_EXTERN CGFloat const FSCalendarMaximumEventDotDiameter; - -UIKIT_EXTERN NSInteger const FSCalendarDefaultHourComponent; - -#define FSCalendarDeviceIsIPad [[UIDevice currentDevice].model hasPrefix:@"iPad"] - -#define FSCalendarStandardSelectionColor FSColorRGBA(31,119,219,1.0) -#define FSCalendarStandardTodayColor FSColorRGBA(198,51,42 ,1.0) -#define FSCalendarStandardTitleTextColor FSColorRGBA(14,69,221 ,1.0) -#define FSCalendarStandardEventDotColor FSColorRGBA(31,119,219,0.75) - -#define FSColorRGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] - -#if CGFLOAT_IS_DOUBLE -#define FSCalendarFloor(c) floor(c) -#else -#define FSCalendarFloor(c) floorf(c) -#endif - -#pragma mark - Deprecated - -#define FSCalendarDeprecated(instead) DEPRECATED_MSG_ATTRIBUTE(" Use " # instead " instead") - -FSCalendarDeprecated('FSCalendarCellShape') -typedef NS_ENUM(NSInteger, FSCalendarCellStyle) { - FSCalendarCellStyleCircle = 0, - FSCalendarCellStyleRectangle = 1 -}; - -FSCalendarDeprecated('FSCalendarScrollDirection') -typedef NS_ENUM(NSInteger, FSCalendarFlow) { - FSCalendarFlowVertical, - FSCalendarFlowHorizontal -}; diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstants.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstants.h new file mode 100644 index 0000000..ed0ea59 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstants.h @@ -0,0 +1,102 @@ +// +// FSCalendarConstane.h +// FSCalendar +// +// Created by dingwenchao on 8/28/15. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// +// https://github.com/WenchaoD +// + +#import +#import + +#pragma mark - Constants + +CG_EXTERN CGFloat const FSCalendarStandardHeaderHeight; +CG_EXTERN CGFloat const FSCalendarStandardWeekdayHeight; +CG_EXTERN CGFloat const FSCalendarStandardMonthlyPageHeight; +CG_EXTERN CGFloat const FSCalendarStandardWeeklyPageHeight; +CG_EXTERN CGFloat const FSCalendarStandardCellDiameter; +CG_EXTERN CGFloat const FSCalendarStandardSeparatorThickness; +CG_EXTERN CGFloat const FSCalendarAutomaticDimension; +CG_EXTERN CGFloat const FSCalendarDefaultBounceAnimationDuration; +CG_EXTERN CGFloat const FSCalendarStandardRowHeight; +CG_EXTERN CGFloat const FSCalendarStandardTitleTextSize; +CG_EXTERN CGFloat const FSCalendarStandardSubtitleTextSize; +CG_EXTERN CGFloat const FSCalendarStandardWeekdayTextSize; +CG_EXTERN CGFloat const FSCalendarStandardHeaderTextSize; +CG_EXTERN CGFloat const FSCalendarMaximumEventDotDiameter; +CG_EXTERN CGFloat const FSCalendarStandardScopeHandleHeight; + +UIKIT_EXTERN NSInteger const FSCalendarDefaultHourComponent; + +UIKIT_EXTERN NSString * const FSCalendarDefaultCellReuseIdentifier; +UIKIT_EXTERN NSString * const FSCalendarBlankCellReuseIdentifier; +UIKIT_EXTERN NSString * const FSCalendarInvalidArgumentsExceptionName; + +CG_EXTERN CGPoint const CGPointInfinity; +CG_EXTERN CGSize const CGSizeAutomatic; + +#if TARGET_INTERFACE_BUILDER +#define FSCalendarDeviceIsIPad NO +#else +#define FSCalendarDeviceIsIPad [[UIDevice currentDevice].model hasPrefix:@"iPad"] +#endif + +#define FSCalendarStandardSelectionColor FSColorRGBA(31,119,219,1.0) +#define FSCalendarStandardTodayColor FSColorRGBA(198,51,42 ,1.0) +#define FSCalendarStandardTitleTextColor FSColorRGBA(14,69,221 ,1.0) +#define FSCalendarStandardEventDotColor FSColorRGBA(31,119,219,0.75) + +#define FSCalendarStandardLineColor [[UIColor lightGrayColor] colorWithAlphaComponent:0.30] +#define FSCalendarStandardSeparatorColor [[UIColor lightGrayColor] colorWithAlphaComponent:0.60] +#define FSCalendarStandardScopeHandleColor [[UIColor lightGrayColor] colorWithAlphaComponent:0.50] + +#define FSColorRGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] +#define FSCalendarInAppExtension [[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"] + +#if CGFLOAT_IS_DOUBLE +#define FSCalendarFloor(c) floor(c) +#define FSCalendarRound(c) round(c) +#define FSCalendarCeil(c) ceil(c) +#define FSCalendarMod(c1,c2) fmod(c1,c2) +#else +#define FSCalendarFloor(c) floorf(c) +#define FSCalendarRound(c) roundf(c) +#define FSCalendarCeil(c) ceilf(c) +#define FSCalendarMod(c1,c2) fmodf(c1,c2) +#endif + +#define FSCalendarUseWeakSelf __weak __typeof__(self) FSCalendarWeakSelf = self; +#define FSCalendarUseStrongSelf __strong __typeof__(self) self = FSCalendarWeakSelf; + + +#pragma mark - Deprecated + +#define FSCalendarDeprecated(instead) DEPRECATED_MSG_ATTRIBUTE(" Use " # instead " instead") + +FSCalendarDeprecated('borderRadius') +typedef NS_ENUM(NSUInteger, FSCalendarCellShape) { + FSCalendarCellShapeCircle = 0, + FSCalendarCellShapeRectangle = 1 +}; + +typedef NS_ENUM(NSUInteger, FSCalendarUnit) { + FSCalendarUnitMonth = NSCalendarUnitMonth, + FSCalendarUnitWeekOfYear = NSCalendarUnitWeekOfYear, + FSCalendarUnitDay = NSCalendarUnitDay +}; + +static inline void FSCalendarSliceCake(CGFloat cake, NSInteger count, CGFloat *pieces) { + CGFloat total = cake; + for (int i = 0; i < count; i++) { + NSInteger remains = count - i; + CGFloat piece = FSCalendarRound(total/remains*2)*0.5; + total -= piece; + pieces[i] = piece; + } +} + + + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstance.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstants.m similarity index 53% rename from Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstance.m rename to Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstants.m index 3059465..f2d264f 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstance.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarConstants.m @@ -8,20 +8,39 @@ // https://github.com/WenchaoD // -#import "FSCalendarConstance.h" +#import "FSCalendarConstants.h" CGFloat const FSCalendarStandardHeaderHeight = 40; CGFloat const FSCalendarStandardWeekdayHeight = 25; CGFloat const FSCalendarStandardMonthlyPageHeight = 300.0; CGFloat const FSCalendarStandardWeeklyPageHeight = 108+1/3.0; CGFloat const FSCalendarStandardCellDiameter = 100/3.0; +CGFloat const FSCalendarStandardSeparatorThickness = 0.5; CGFloat const FSCalendarAutomaticDimension = -1; CGFloat const FSCalendarDefaultBounceAnimationDuration = 0.15; -CGFloat const FSCalendarStandardRowHeight = 38+1.0/3; +CGFloat const FSCalendarStandardRowHeight = 38; CGFloat const FSCalendarStandardTitleTextSize = 13.5; CGFloat const FSCalendarStandardSubtitleTextSize = 10; CGFloat const FSCalendarStandardWeekdayTextSize = 14; CGFloat const FSCalendarStandardHeaderTextSize = 16.5; CGFloat const FSCalendarMaximumEventDotDiameter = 4.8; +CGFloat const FSCalendarStandardScopeHandleHeight = 26; + +NSInteger const FSCalendarDefaultHourComponent = 0; + +NSString * const FSCalendarDefaultCellReuseIdentifier = @"_FSCalendarDefaultCellReuseIdentifier"; +NSString * const FSCalendarBlankCellReuseIdentifier = @"_FSCalendarBlankCellReuseIdentifier"; +NSString * const FSCalendarInvalidArgumentsExceptionName = @"Invalid argument exception"; + +CGPoint const CGPointInfinity = { + .x = CGFLOAT_MAX, + .y = CGFLOAT_MAX +}; + +CGSize const CGSizeAutomatic = { + .width = FSCalendarAutomaticDimension, + .height = FSCalendarAutomaticDimension +}; + + -NSInteger const FSCalendarDefaultHourComponent = 0; \ No newline at end of file diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationFactory.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationFactory.h new file mode 100644 index 0000000..5c0bb7f --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationFactory.h @@ -0,0 +1,17 @@ +// +// FSCalendarDelegationFactory.h +// FSCalendar +// +// Created by dingwenchao on 19/12/2016. +// Copyright © 2016 wenchaoios. All rights reserved. +// + +#import +#import "FSCalendarDelegationProxy.h" + +@interface FSCalendarDelegationFactory : NSObject + ++ (FSCalendarDelegationProxy *)dataSourceProxy; ++ (FSCalendarDelegationProxy *)delegateProxy; + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationFactory.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationFactory.m new file mode 100644 index 0000000..b185459 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationFactory.m @@ -0,0 +1,40 @@ +// +// FSCalendarDelegationFactory.m +// FSCalendar +// +// Created by dingwenchao on 19/12/2016. +// Copyright © 2016 wenchaoios. All rights reserved. +// + +#import "FSCalendarDelegationFactory.h" + +#define FSCalendarSelectorEntry(SEL1,SEL2) NSStringFromSelector(@selector(SEL1)):NSStringFromSelector(@selector(SEL2)) + +@implementation FSCalendarDelegationFactory + ++ (FSCalendarDelegationProxy *)dataSourceProxy +{ + FSCalendarDelegationProxy *delegation = [[FSCalendarDelegationProxy alloc] init]; + delegation.protocol = @protocol(FSCalendarDataSource); + delegation.deprecations = @{FSCalendarSelectorEntry(calendar:numberOfEventsForDate:, calendar:hasEventForDate:)}; + return delegation; +} + ++ (FSCalendarDelegationProxy *)delegateProxy +{ + FSCalendarDelegationProxy *delegation = [[FSCalendarDelegationProxy alloc] init]; + delegation.protocol = @protocol(FSCalendarDelegateAppearance); + delegation.deprecations = @{ + FSCalendarSelectorEntry(calendarCurrentPageDidChange:, calendarCurrentMonthDidChange:), + FSCalendarSelectorEntry(calendar:shouldSelectDate:atMonthPosition:, calendar:shouldSelectDate:), + FSCalendarSelectorEntry(calendar:didSelectDate:atMonthPosition:, calendar:didSelectDate:), + FSCalendarSelectorEntry(calendar:shouldDeselectDate:atMonthPosition:, calendar:shouldDeselectDate:), + FSCalendarSelectorEntry(calendar:didDeselectDate:atMonthPosition:, calendar:didDeselectDate:) + }; + return delegation; +} + +@end + +#undef FSCalendarSelectorEntry + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationProxy.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationProxy.h new file mode 100644 index 0000000..5e9b974 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationProxy.h @@ -0,0 +1,31 @@ +// +// FSCalendarDelegationProxy.h +// FSCalendar +// +// Created by dingwenchao on 11/12/2016. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// +// https://github.com/WenchaoD +// +// 1. Smart proxy delegation http://petersteinberger.com/blog/2013/smart-proxy-delegation/ +// 2. Manage deprecated delegation functions +// + +#import +#import "FSCalendar.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface FSCalendarDelegationProxy : NSProxy + +@property (weak , nonatomic) id delegation; +@property (strong, nonatomic) Protocol *protocol; +@property (strong, nonatomic) NSDictionary *deprecations; + +- (instancetype)init; +- (SEL)deprecatedSelectorOfSelector:(SEL)selector; + +@end + +NS_ASSUME_NONNULL_END + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationProxy.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationProxy.m new file mode 100644 index 0000000..84e4a57 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDelegationProxy.m @@ -0,0 +1,68 @@ +// +// FSCalendarDelegationProxy.m +// FSCalendar +// +// Created by dingwenchao on 11/12/2016. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendarDelegationProxy.h" +#import + +@implementation FSCalendarDelegationProxy + +- (instancetype)init +{ + return self; +} + +- (BOOL)respondsToSelector:(SEL)selector +{ + BOOL responds = [self.delegation respondsToSelector:selector]; + if (!responds) responds = [self.delegation respondsToSelector:[self deprecatedSelectorOfSelector:selector]]; + if (!responds) responds = [super respondsToSelector:selector]; + return responds; +} + +- (BOOL)conformsToProtocol:(Protocol *)protocol +{ + return [self.delegation conformsToProtocol:protocol]; +} + +- (void)forwardInvocation:(NSInvocation *)invocation +{ + SEL selector = invocation.selector; + if (![self.delegation respondsToSelector:selector]) { + selector = [self deprecatedSelectorOfSelector:selector]; + invocation.selector = selector; + } + if ([self.delegation respondsToSelector:selector]) { + [invocation invokeWithTarget:self.delegation]; + } +} + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel +{ + if ([self.delegation respondsToSelector:sel]) { + return [(NSObject *)self.delegation methodSignatureForSelector:sel]; + } + SEL selector = [self deprecatedSelectorOfSelector:sel]; + if ([self.delegation respondsToSelector:selector]) { + return [(NSObject *)self.delegation methodSignatureForSelector:selector]; + } +#if TARGET_INTERFACE_BUILDER + return [NSObject methodSignatureForSelector:@selector(init)]; +#endif + struct objc_method_description desc = protocol_getMethodDescription(self.protocol, sel, NO, YES); + const char *types = desc.types; + return types?[NSMethodSignature signatureWithObjCTypes:types]:[NSObject methodSignatureForSelector:@selector(init)]; +} + +- (SEL)deprecatedSelectorOfSelector:(SEL)selector +{ + NSString *selectorString = NSStringFromSelector(selector); + selectorString = self.deprecations[selectorString]; + return NSSelectorFromString(selectorString); +} + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDynamicHeader.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDynamicHeader.h index f0caad0..dc9fe75 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDynamicHeader.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarDynamicHeader.h @@ -13,47 +13,43 @@ #import "FSCalendar.h" #import "FSCalendarCell.h" -#import "FSCalendarHeader.h" +#import "FSCalendarHeaderView.h" #import "FSCalendarStickyHeader.h" +#import "FSCalendarCollectionView.h" +#import "FSCalendarCollectionViewLayout.h" +#import "FSCalendarScopeHandle.h" +#import "FSCalendarCalculator.h" +#import "FSCalendarTransitionCoordinator.h" +#import "FSCalendarDelegationProxy.h" @interface FSCalendar (Dynamic) -@property (readonly, nonatomic) CAShapeLayer *maskLayer; -@property (readonly, nonatomic) FSCalendarHeader *header; -@property (readonly, nonatomic) UICollectionView *collectionView; -@property (readonly, nonatomic) UICollectionViewFlowLayout *collectionViewLayout; -@property (readonly, nonatomic) NSArray *weekdays; -@property (readonly, nonatomic) BOOL ibEditing; +@property (readonly, nonatomic) FSCalendarCollectionView *collectionView; +@property (readonly, nonatomic) FSCalendarScopeHandle *scopeHandle; +@property (readonly, nonatomic) FSCalendarCollectionViewLayout *collectionViewLayout; +@property (readonly, nonatomic) FSCalendarTransitionCoordinator *transitionCoordinator; +@property (readonly, nonatomic) FSCalendarCalculator *calculator; @property (readonly, nonatomic) BOOL floatingMode; @property (readonly, nonatomic) NSArray *visibleStickyHeaders; @property (readonly, nonatomic) CGFloat preferredHeaderHeight; @property (readonly, nonatomic) CGFloat preferredWeekdayHeight; -@property (readonly, nonatomic) CGFloat preferredRowHeight; @property (readonly, nonatomic) UIView *bottomBorder; -@property (readonly, nonatomic) NSCalendar *calendar; +@property (readonly, nonatomic) NSCalendar *gregorian; @property (readonly, nonatomic) NSDateComponents *components; @property (readonly, nonatomic) NSDateFormatter *formatter; @property (readonly, nonatomic) UIView *contentView; @property (readonly, nonatomic) UIView *daysContainer; -@property (assign, nonatomic) BOOL needsAdjustingMonthPosition; @property (assign, nonatomic) BOOL needsAdjustingViewFrame; -- (void)invalidateWeekdayFont; -- (void)invalidateWeekdayTextColor; - - (void)invalidateHeaders; -- (void)invalidateWeekdaySymbols; -- (void)invalidateAppearanceForCell:(FSCalendarCell *)cell; +- (void)adjustMonthPosition; +- (void)configureAppearance; -- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath; -- (NSDate *)dateForIndexPath:(NSIndexPath *)indexPath scope:(FSCalendarScope)scope; -- (NSIndexPath *)indexPathForDate:(NSDate *)date; -- (NSIndexPath *)indexPathForDate:(NSDate *)date scope:(FSCalendarScope)scope; - -- (NSInteger)numberOfHeadPlaceholdersForMonth:(NSDate *)month; +- (BOOL)isPageInRange:(NSDate *)page; +- (BOOL)isDateInRange:(NSDate *)date; - (CGSize)sizeThatFits:(CGSize)size scope:(FSCalendarScope)scope; @@ -68,21 +64,21 @@ @property (readonly, nonatomic) NSDictionary *subtitleColors; @property (readonly, nonatomic) NSDictionary *borderColors; -@property (readonly, nonatomic) UIFont *preferredTitleFont; -@property (readonly, nonatomic) UIFont *preferredSubtitleFont; -@property (readonly, nonatomic) UIFont *preferredWeekdayFont; -@property (readonly, nonatomic) UIFont *preferredHeaderTitleFont; +@end -- (void)adjustTitleIfNecessary; -- (void)invalidateFonts; +@interface FSCalendarWeekdayView (Dynamic) + +@property (readwrite, nonatomic) FSCalendar *calendar; @end +@interface FSCalendarCollectionViewLayout (Dynamic) -@interface FSCalendarHeader (Dynamic) - -@property (readonly, nonatomic) UICollectionView *collectionView; +@property (readonly, nonatomic) CGSize estimatedItemSize; @end +@interface FSCalendarDelegationProxy() +@end + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarEventIndicator.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarEventIndicator.h deleted file mode 100644 index 8e96a30..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarEventIndicator.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// FSCalendarEventView.h -// FSCalendar -// -// Created by dingwenchao on 2/3/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import - -@interface FSCalendarEventIndicator : UIView - -@property (assign, nonatomic) NSInteger numberOfEvents; -@property (strong, nonatomic) id color; -@property (assign, nonatomic) BOOL needsAdjustingViewFrame; - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarEventIndicator.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarEventIndicator.m deleted file mode 100644 index 6705c7d..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarEventIndicator.m +++ /dev/null @@ -1,143 +0,0 @@ -// -// FSCalendarEventView.m -// FSCalendar -// -// Created by dingwenchao on 2/3/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import "FSCalendarEventIndicator.h" -#import "FSCalendarConstance.h" -#import "UIView+FSExtension.h" -#import "CALayer+FSExtension.h" - -@interface FSCalendarEventIndicator () - -@property (weak, nonatomic) UIView *contentView; - -@property (strong, nonatomic) NSMutableArray *eventLayers; -@property (assign, nonatomic) BOOL needsInvalidatingColor; - -- (UIImage *)dotImageWithColor:(UIColor *)color diameter:(CGFloat)diameter; - -@end - -@implementation FSCalendarEventIndicator - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - - UIView *view = [[UIView alloc] initWithFrame:CGRectZero]; - [self addSubview:view]; - self.contentView = view; - - self.eventLayers = [NSMutableArray arrayWithCapacity:3]; - for (int i = 0; i < 3; i++) { - CALayer *layer = [CALayer layer]; - layer.masksToBounds = YES; - layer.backgroundColor = FSCalendarStandardEventDotColor.CGColor; - [self.eventLayers addObject:layer]; - [self.contentView.layer addSublayer:layer]; - } - - _needsInvalidatingColor = YES; - _needsAdjustingViewFrame = YES; - - } - return self; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - if (_needsAdjustingViewFrame) { - CGFloat diameter = MIN(MIN(self.fs_width, self.fs_height),FSCalendarMaximumEventDotDiameter); - self.contentView.fs_height = self.fs_height; - self.contentView.fs_width = (self.numberOfEvents*2-1)*diameter; - self.contentView.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); - } -} - -- (void)layoutSublayersOfLayer:(CALayer *)layer -{ - [super layoutSublayersOfLayer:layer]; - if (layer == self.layer) { - if (_needsAdjustingViewFrame) { - _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; - } - } - } - if (_needsInvalidatingColor) { - _needsInvalidatingColor = NO; - CGFloat diameter = MIN(MIN(self.fs_width, self.fs_height),FSCalendarMaximumEventDotDiameter); - if ([_color isKindOfClass:[UIColor class]]) { - UIImage *dotImage = [self dotImageWithColor:_color diameter:diameter]; - [self.eventLayers makeObjectsPerformSelector:@selector(setContents:) withObject:(id)dotImage.CGImage]; - } else if ([_color isKindOfClass:[NSArray class]]) { - NSArray *colors = (NSArray *)_color; - if (colors.count) { - UIColor *lastColor = colors.firstObject; - for (int i = 0; i < self.numberOfEvents; i++) { - if (i < colors.count) { - lastColor = colors[i]; - } - CALayer *layer = self.eventLayers[i]; - UIImage *dotImage = [self dotImageWithColor:lastColor diameter:diameter]; - layer.contents = (id)dotImage.CGImage; - } - } - } - } - } -} - -- (void)setColor:(id)color -{ - if (![_color isEqual:color]) { - _color = color; - _needsInvalidatingColor = YES; - [self setNeedsLayout]; - } -} - -- (void)setNumberOfEvents:(NSInteger)numberOfEvents -{ - if (_numberOfEvents != numberOfEvents) { - _numberOfEvents = MIN(MAX(numberOfEvents,0),3); - _needsAdjustingViewFrame = YES; - [self setNeedsLayout]; - } -} - -- (void)setNeedsAdjustingViewFrame:(BOOL)needsAdjustingViewFrame -{ - if (_needsAdjustingViewFrame != needsAdjustingViewFrame) { - _needsAdjustingViewFrame = needsAdjustingViewFrame; - if (needsAdjustingViewFrame) { - [self setNeedsLayout]; - } - } -} - -- (UIImage *)dotImageWithColor:(UIColor *)color diameter:(CGFloat)diameter -{ - CGRect bounds = CGRectMake(0, 0, diameter, diameter); - UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSetFillColorWithColor(context, color.CGColor); - CGContextFillEllipseInRect(context, bounds); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarExtensions.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarExtensions.h new file mode 100644 index 0000000..4b066b4 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarExtensions.h @@ -0,0 +1,84 @@ +// +// FSCalendarExtensions.h +// FSCalendar +// +// Created by dingwenchao on 10/8/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView (FSCalendarExtensions) + +@property (nonatomic) CGFloat fs_width; +@property (nonatomic) CGFloat fs_height; + +@property (nonatomic) CGFloat fs_top; +@property (nonatomic) CGFloat fs_left; +@property (nonatomic) CGFloat fs_bottom; +@property (nonatomic) CGFloat fs_right; + +@end + + +@interface CALayer (FSCalendarExtensions) + +@property (nonatomic) CGFloat fs_width; +@property (nonatomic) CGFloat fs_height; + +@property (nonatomic) CGFloat fs_top; +@property (nonatomic) CGFloat fs_left; +@property (nonatomic) CGFloat fs_bottom; +@property (nonatomic) CGFloat fs_right; + +@end + + +@interface NSCalendar (FSCalendarExtensions) + +- (nullable NSDate *)fs_firstDayOfMonth:(NSDate *)month; +- (nullable NSDate *)fs_lastDayOfMonth:(NSDate *)month; +- (nullable NSDate *)fs_firstDayOfWeek:(NSDate *)week; +- (nullable NSDate *)fs_lastDayOfWeek:(NSDate *)week; +- (nullable NSDate *)fs_middleDayOfWeek:(NSDate *)week; +- (NSInteger)fs_numberOfDaysInMonth:(NSDate *)month; + +@end + +@interface NSMapTable (FSCalendarExtensions) + +- (void)setObject:(nullable id)obj forKeyedSubscript:(id)key; +- (id)objectForKeyedSubscript:(id)key; + +@end + +@interface NSCache (FSCalendarExtensions) + +- (void)setObject:(nullable id)obj forKeyedSubscript:(id)key; +- (id)objectForKeyedSubscript:(id)key; + +@end + + +@interface NSObject (FSCalendarExtensions) + +#define IVAR_DEF(SET,GET,TYPE) \ +- (void)fs_set##SET##Variable:(TYPE)value forKey:(NSString *)key; \ +- (TYPE)fs_##GET##VariableForKey:(NSString *)key; +IVAR_DEF(Bool, bool, BOOL) +IVAR_DEF(Float, float, CGFloat) +IVAR_DEF(Integer, integer, NSInteger) +IVAR_DEF(UnsignedInteger, unsignedInteger, NSUInteger) +#undef IVAR_DEF + +- (void)fs_setVariable:(id)variable forKey:(NSString *)key; +- (id)fs_variableForKey:(NSString *)key; + +- (nullable id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ... NS_REQUIRES_NIL_TERMINATION; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarExtensions.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarExtensions.m new file mode 100644 index 0000000..d407cc9 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarExtensions.m @@ -0,0 +1,440 @@ +// +// FSCalendarExtensions.m +// FSCalendar +// +// Created by dingwenchao on 10/8/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendarExtensions.h" +#import + +@implementation UIView (FSCalendarExtensions) + +- (CGFloat)fs_width +{ + return CGRectGetWidth(self.frame); +} + +- (void)setFs_width:(CGFloat)fs_width +{ + self.frame = CGRectMake(self.fs_left, self.fs_top, fs_width, self.fs_height); +} + +- (CGFloat)fs_height +{ + return CGRectGetHeight(self.frame); +} + +- (void)setFs_height:(CGFloat)fs_height +{ + self.frame = CGRectMake(self.fs_left, self.fs_top, self.fs_width, fs_height); +} + +- (CGFloat)fs_top +{ + return CGRectGetMinY(self.frame); +} + +- (void)setFs_top:(CGFloat)fs_top +{ + self.frame = CGRectMake(self.fs_left, fs_top, self.fs_width, self.fs_height); +} + +- (CGFloat)fs_bottom +{ + return CGRectGetMaxY(self.frame); +} + +- (void)setFs_bottom:(CGFloat)fs_bottom +{ + self.fs_top = fs_bottom - self.fs_height; +} + +- (CGFloat)fs_left +{ + return CGRectGetMinX(self.frame); +} + +- (void)setFs_left:(CGFloat)fs_left +{ + self.frame = CGRectMake(fs_left, self.fs_top, self.fs_width, self.fs_height); +} + +- (CGFloat)fs_right +{ + return CGRectGetMaxX(self.frame); +} + +- (void)setFs_right:(CGFloat)fs_right +{ + self.fs_left = self.fs_right - self.fs_width; +} + +@end + + +@implementation CALayer (FSCalendarExtensions) + +- (CGFloat)fs_width +{ + return CGRectGetWidth(self.frame); +} + +- (void)setFs_width:(CGFloat)fs_width +{ + self.frame = CGRectMake(self.fs_left, self.fs_top, fs_width, self.fs_height); +} + +- (CGFloat)fs_height +{ + return CGRectGetHeight(self.frame); +} + +- (void)setFs_height:(CGFloat)fs_height +{ + self.frame = CGRectMake(self.fs_left, self.fs_top, self.fs_width, fs_height); +} + +- (CGFloat)fs_top +{ + return CGRectGetMinY(self.frame); +} + +- (void)setFs_top:(CGFloat)fs_top +{ + self.frame = CGRectMake(self.fs_left, fs_top, self.fs_width, self.fs_height); +} + +- (CGFloat)fs_bottom +{ + return CGRectGetMaxY(self.frame); +} + +- (void)setFs_bottom:(CGFloat)fs_bottom +{ + self.fs_top = fs_bottom - self.fs_height; +} + +- (CGFloat)fs_left +{ + return CGRectGetMinX(self.frame); +} + +- (void)setFs_left:(CGFloat)fs_left +{ + self.frame = CGRectMake(fs_left, self.fs_top, self.fs_width, self.fs_height); +} + +- (CGFloat)fs_right +{ + return CGRectGetMaxX(self.frame); +} + +- (void)setFs_right:(CGFloat)fs_right +{ + self.fs_left = self.fs_right - self.fs_width; +} + +@end + +@interface NSCalendar (FSCalendarExtensionsPrivate) + +@property (readonly, nonatomic) NSDateComponents *fs_privateComponents; + +@end + +@implementation NSCalendar (FSCalendarExtensions) + +- (nullable NSDate *)fs_firstDayOfMonth:(NSDate *)month +{ + if (!month) return nil; + NSDateComponents *components = [self components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:month]; + components.day = 1; + return [self dateFromComponents:components]; +} + +- (nullable NSDate *)fs_lastDayOfMonth:(NSDate *)month +{ + if (!month) return nil; + NSDateComponents *components = [self components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:month]; + components.month++; + components.day = 0; + return [self dateFromComponents:components]; +} + +- (nullable NSDate *)fs_firstDayOfWeek:(NSDate *)week +{ + if (!week) return nil; + NSDateComponents *weekdayComponents = [self components:NSCalendarUnitWeekday fromDate:week]; + NSDateComponents *components = self.fs_privateComponents; + components.day = - (weekdayComponents.weekday - self.firstWeekday); + components.day = (components.day-7) % 7; + NSDate *firstDayOfWeek = [self dateByAddingComponents:components toDate:week options:0]; + firstDayOfWeek = [self dateBySettingHour:0 minute:0 second:0 ofDate:firstDayOfWeek options:0]; + components.day = NSIntegerMax; + return firstDayOfWeek; +} + +- (nullable NSDate *)fs_lastDayOfWeek:(NSDate *)week +{ + if (!week) return nil; + NSDateComponents *weekdayComponents = [self components:NSCalendarUnitWeekday fromDate:week]; + NSDateComponents *components = self.fs_privateComponents; + components.day = - (weekdayComponents.weekday - self.firstWeekday); + components.day = (components.day-7) % 7 + 6; + NSDate *lastDayOfWeek = [self dateByAddingComponents:components toDate:week options:0]; + lastDayOfWeek = [self dateBySettingHour:0 minute:0 second:0 ofDate:lastDayOfWeek options:0]; + components.day = NSIntegerMax; + return lastDayOfWeek; +} + +- (nullable NSDate *)fs_middleDayOfWeek:(NSDate *)week +{ + if (!week) return nil; + NSDateComponents *weekdayComponents = [self components:NSCalendarUnitWeekday fromDate:week]; + NSDateComponents *componentsToSubtract = self.fs_privateComponents; + componentsToSubtract.day = - (weekdayComponents.weekday - self.firstWeekday) + 3; + NSDate *middleDayOfWeek = [self dateByAddingComponents:componentsToSubtract toDate:week options:0]; + NSDateComponents *components = [self components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour fromDate:middleDayOfWeek]; + middleDayOfWeek = [self dateFromComponents:components]; + componentsToSubtract.day = NSIntegerMax; + return middleDayOfWeek; +} + +- (NSInteger)fs_numberOfDaysInMonth:(NSDate *)month +{ + if (!month) return 0; + NSRange days = [self rangeOfUnit:NSCalendarUnitDay + inUnit:NSCalendarUnitMonth + forDate:month]; + return days.length; +} + +- (NSDateComponents *)fs_privateComponents +{ + NSDateComponents *components = objc_getAssociatedObject(self, _cmd); + if (!components) { + components = [[NSDateComponents alloc] init]; + objc_setAssociatedObject(self, _cmd, components, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return components; +} + +@end + +@implementation NSMapTable (FSCalendarExtensions) + +- (void)setObject:(nullable id)obj forKeyedSubscript:(id)key +{ + if (!key) return; + + if (obj) { + [self setObject:obj forKey:key]; + } else { + [self removeObjectForKey:key]; + } +} + +- (id)objectForKeyedSubscript:(id)key +{ + return [self objectForKey:key]; +} + +@end + +@implementation NSCache (FSCalendarExtensions) + +- (void)setObject:(nullable id)obj forKeyedSubscript:(id)key +{ + if (!key) return; + + if (obj) { + [self setObject:obj forKey:key]; + } else { + [self removeObjectForKey:key]; + } +} + +- (id)objectForKeyedSubscript:(id)key +{ + return [self objectForKey:key]; +} + +@end + +@implementation NSObject (FSCalendarExtensions) + +#define IVAR_IMP(SET,GET,TYPE) \ +- (void)fs_set##SET##Variable:(TYPE)value forKey:(NSString *)key \ +{ \ + Ivar ivar = class_getInstanceVariable([self class], key.UTF8String); \ + ((void (*)(id, Ivar, TYPE))object_setIvar)(self, ivar, value); \ +} \ +- (TYPE)fs_##GET##VariableForKey:(NSString *)key \ +{ \ + Ivar ivar = class_getInstanceVariable([self class], key.UTF8String); \ + ptrdiff_t offset = ivar_getOffset(ivar); \ + unsigned char *bytes = (unsigned char *)(__bridge void *)self; \ + TYPE value = *((TYPE *)(bytes+offset)); \ + return value; \ +} +IVAR_IMP(Bool,bool,BOOL) +IVAR_IMP(Float,float,CGFloat) +IVAR_IMP(Integer,integer,NSInteger) +IVAR_IMP(UnsignedInteger,unsignedInteger,NSUInteger) +#undef IVAR_IMP + +- (void)fs_setVariable:(id)variable forKey:(NSString *)key +{ + Ivar ivar = class_getInstanceVariable(self.class, key.UTF8String); + object_setIvar(self, ivar, variable); +} + +- (id)fs_variableForKey:(NSString *)key +{ + Ivar ivar = class_getInstanceVariable(self.class, key.UTF8String); + id variable = object_getIvar(self, ivar); + return variable; +} + +- (id)fs_performSelector:(SEL)selector withObjects:(nullable id)firstObject, ... +{ + if (!selector) return nil; + NSMethodSignature *signature = [self methodSignatureForSelector:selector]; + if (!signature) return nil; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; + if (!invocation) return nil; + invocation.target = self; + invocation.selector = selector; + + // Parameters + if (firstObject) { + int index = 2; + va_list args; + va_start(args, firstObject); + if (firstObject) { + id obj = firstObject; + do { + const char *argType = [signature getArgumentTypeAtIndex:index]; + if(!strcmp(argType, @encode(id))){ + // object + [invocation setArgument:&obj atIndex:index++]; + } else { + NSString *argTypeString = [NSString stringWithUTF8String:argType]; + if ([argTypeString hasPrefix:@"{"] && [argTypeString hasSuffix:@"}"]) { + // struct +#define PARAM_STRUCT_TYPES(_type,_getter,_default) \ +if (!strcmp(argType, @encode(_type))) { \ + _type value = [obj respondsToSelector:@selector(_getter)]?[obj _getter]:_default; \ + [invocation setArgument:&value atIndex:index]; \ +} + PARAM_STRUCT_TYPES(CGPoint, CGPointValue, CGPointZero) + PARAM_STRUCT_TYPES(CGSize, CGSizeValue, CGSizeZero) + PARAM_STRUCT_TYPES(CGRect, CGRectValue, CGRectZero) + PARAM_STRUCT_TYPES(CGAffineTransform, CGAffineTransformValue, CGAffineTransformIdentity) + PARAM_STRUCT_TYPES(CATransform3D, CATransform3DValue, CATransform3DIdentity) + PARAM_STRUCT_TYPES(CGVector, CGVectorValue, CGVectorMake(0, 0)) + PARAM_STRUCT_TYPES(UIEdgeInsets, UIEdgeInsetsValue, UIEdgeInsetsZero) + PARAM_STRUCT_TYPES(UIOffset, UIOffsetValue, UIOffsetZero) + PARAM_STRUCT_TYPES(NSRange, rangeValue, NSMakeRange(NSNotFound, 0)) + +#undef PARAM_STRUCT_TYPES + index++; + } else { + // basic type +#define PARAM_BASIC_TYPES(_type,_getter) \ +if (!strcmp(argType, @encode(_type))) { \ + _type value = [obj respondsToSelector:@selector(_getter)]?[obj _getter]:0; \ + [invocation setArgument:&value atIndex:index]; \ +} + PARAM_BASIC_TYPES(BOOL, boolValue) + PARAM_BASIC_TYPES(int, intValue) + PARAM_BASIC_TYPES(unsigned int, unsignedIntValue) + PARAM_BASIC_TYPES(char, charValue) + PARAM_BASIC_TYPES(unsigned char, unsignedCharValue) + PARAM_BASIC_TYPES(long, longValue) + PARAM_BASIC_TYPES(unsigned long, unsignedLongValue) + PARAM_BASIC_TYPES(long long, longLongValue) + PARAM_BASIC_TYPES(unsigned long long, unsignedLongLongValue) + PARAM_BASIC_TYPES(float, floatValue) + PARAM_BASIC_TYPES(double, doubleValue) + +#undef PARAM_BASIC_TYPES + index++; + } + } + } while((obj = va_arg(args, id))); + + } + va_end(args); + [invocation retainArguments]; + } + + // Execute + [invocation invoke]; + + // Return + const char *returnType = signature.methodReturnType; + NSUInteger length = [signature methodReturnLength]; + id returnValue; + if (!strcmp(returnType, @encode(void))){ + // void + returnValue = nil; + } else if(!strcmp(returnType, @encode(id))){ + // id + void *value; + [invocation getReturnValue:&value]; + returnValue = (__bridge id)(value); + return returnValue; + } else { + NSString *returnTypeString = [NSString stringWithUTF8String:returnType]; + if ([returnTypeString hasPrefix:@"{"] && [returnTypeString hasSuffix:@"}"]) { + // struct +#define RETURN_STRUCT_TYPES(_type) \ +if (!strcmp(returnType, @encode(_type))) { \ + _type value; \ + [invocation getReturnValue:&value]; \ + returnValue = [NSValue value:&value withObjCType:@encode(_type)]; \ +} + RETURN_STRUCT_TYPES(CGPoint) + RETURN_STRUCT_TYPES(CGSize) + RETURN_STRUCT_TYPES(CGRect) + RETURN_STRUCT_TYPES(CGAffineTransform) + RETURN_STRUCT_TYPES(CATransform3D) + RETURN_STRUCT_TYPES(CGVector) + RETURN_STRUCT_TYPES(UIEdgeInsets) + RETURN_STRUCT_TYPES(UIOffset) + RETURN_STRUCT_TYPES(NSRange) + +#undef RETURN_STRUCT_TYPES + } else { + // basic + void *buffer = (void *)malloc(length); + [invocation getReturnValue:buffer]; +#define RETURN_BASIC_TYPES(_type) \ + if (!strcmp(returnType, @encode(_type))) { \ + returnValue = @(*((_type*)buffer)); \ +} + RETURN_BASIC_TYPES(BOOL) + RETURN_BASIC_TYPES(int) + RETURN_BASIC_TYPES(unsigned int) + RETURN_BASIC_TYPES(char) + RETURN_BASIC_TYPES(unsigned char) + RETURN_BASIC_TYPES(long) + RETURN_BASIC_TYPES(unsigned long) + RETURN_BASIC_TYPES(long long) + RETURN_BASIC_TYPES(unsigned long long) + RETURN_BASIC_TYPES(float) + RETURN_BASIC_TYPES(double) + +#undef RETURN_BASIC_TYPES + free(buffer); + } + } + return returnValue; +} + +@end + + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarFlowLayout.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarFlowLayout.h deleted file mode 100644 index fc6f323..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarFlowLayout.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// FSCalendarAnimationLayout.h -// FSCalendar -// -// Created by dingwenchao on 1/3/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import - -@class FSCalendar; - -typedef NS_ENUM(NSUInteger, FSCalendarScope); - -@interface FSCalendarFlowLayout : UICollectionViewFlowLayout - -@property (weak, nonatomic) FSCalendar *calendar; - - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarFlowLayout.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarFlowLayout.m deleted file mode 100644 index b7ef86c..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarFlowLayout.m +++ /dev/null @@ -1,86 +0,0 @@ -// -// FSCalendarAnimationLayout.m -// FSCalendar -// -// Created by dingwenchao on 1/3/16. -// Copyright © 2016 wenchaoios. All rights reserved. -// - -#import "FSCalendarFlowLayout.h" -#import "FSCalendarDynamicHeader.h" -#import "FSCalendar.h" -#import "UIView+FSExtension.h" -#import - -@implementation FSCalendarFlowLayout - -- (instancetype)init -{ - self = [super init]; - if (self) { - self.scrollDirection = UICollectionViewScrollDirectionHorizontal; - self.minimumInteritemSpacing = 0; - self.minimumLineSpacing = 0; - self.itemSize = CGSizeMake(1, 1); - self.sectionInset = UIEdgeInsetsZero; - } - return self; -} - -- (void)prepareLayout -{ - [super prepareLayout]; - - - CGFloat rowHeight = self.calendar.preferredRowHeight; - - if (!self.calendar.floatingMode) { - - self.headerReferenceSize = CGSizeZero; - - CGFloat padding = self.calendar.preferredWeekdayHeight*0.1; - if (self.scrollDirection == UICollectionViewScrollDirectionHorizontal) { - padding = FSCalendarFloor(padding); - rowHeight = FSCalendarFloor(rowHeight*2)*0.5; // Round to nearest multiple of 0.5. e.g. (16.8->16.5),(16.2->16.0) - } - self.sectionInset = UIEdgeInsetsMake(padding, 0, padding, 0); - switch (self.calendar.scope) { - - case FSCalendarScopeMonth: { - - CGSize itemSize = CGSizeMake( - self.collectionView.fs_width/7.0-(self.scrollDirection == UICollectionViewScrollDirectionVertical)*0.1, - rowHeight - ); - self.itemSize = itemSize; - - break; - } - case FSCalendarScopeWeek: { - - CGSize itemSize = CGSizeMake(self.collectionView.fs_width/7.0, rowHeight); - self.itemSize = itemSize; - - break; - - } - - } - } else { - - CGFloat headerHeight = self.calendar.preferredWeekdayHeight*1.5+self.calendar.preferredHeaderHeight; - self.headerReferenceSize = CGSizeMake(self.collectionView.fs_width, headerHeight); - - CGSize itemSize = CGSizeMake( - self.collectionView.fs_width/7-(self.scrollDirection == UICollectionViewScrollDirectionVertical)*0.1, - rowHeight - ); - self.itemSize = itemSize; - - self.sectionInset = UIEdgeInsetsZero; - - } - -} - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeader.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeaderView.h similarity index 56% rename from Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeader.h rename to Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeaderView.h index 6b5b2f3..2da931e 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeader.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeaderView.h @@ -7,22 +7,25 @@ // #import -#import "FSCalendarCollectionView.h" -@class FSCalendar,FSCalendarAppearance; -@interface FSCalendarHeader : UIView +@class FSCalendar, FSCalendarAppearance, FSCalendarHeaderLayout, FSCalendarCollectionView; + +@interface FSCalendarHeaderView : UIView @property (weak, nonatomic) FSCalendarCollectionView *collectionView; +@property (weak, nonatomic) FSCalendarHeaderLayout *collectionViewLayout; @property (weak, nonatomic) FSCalendar *calendar; -@property (weak, nonatomic) FSCalendarAppearance *appearance; @property (assign, nonatomic) CGFloat scrollOffset; @property (assign, nonatomic) UICollectionViewScrollDirection scrollDirection; @property (assign, nonatomic) BOOL scrollEnabled; @property (assign, nonatomic) BOOL needsAdjustingViewFrame; +@property (assign, nonatomic) BOOL needsAdjustingMonthPosition; +- (void)setScrollOffset:(CGFloat)scrollOffset animated:(BOOL)animated; - (void)reloadData; +- (void)configureAppearance; @end @@ -30,17 +33,17 @@ @interface FSCalendarHeaderCell : UICollectionViewCell @property (weak, nonatomic) UILabel *titleLabel; -@property (weak, nonatomic) FSCalendarHeader *header; - -- (void)invalidateHeaderFont; -- (void)invalidateHeaderTextColor; +@property (weak, nonatomic) FSCalendarHeaderView *header; @end +@interface FSCalendarHeaderLayout : UICollectionViewFlowLayout + +@end @interface FSCalendarHeaderTouchDeliver : UIView @property (weak, nonatomic) FSCalendar *calendar; -@property (weak, nonatomic) FSCalendarHeader *header; +@property (weak, nonatomic) FSCalendarHeaderView *header; @end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeader.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeaderView.m similarity index 57% rename from Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeader.m rename to Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeaderView.m index 4e2d7a4..2a5032f 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeader.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarHeaderView.m @@ -7,20 +7,19 @@ // #import "FSCalendar.h" -#import "UIView+FSExtension.h" -#import "FSCalendarHeader.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarHeaderView.h" #import "FSCalendarCollectionView.h" #import "FSCalendarDynamicHeader.h" -@interface FSCalendarHeader () +@interface FSCalendarHeaderView () -@property (weak, nonatomic) UICollectionViewFlowLayout *collectionViewLayout; - -@property (assign, nonatomic) BOOL needsAdjustingMonthPosition; +- (void)scrollToOffset:(CGFloat)scrollOffset animated:(BOOL)animated; +- (void)configureCell:(FSCalendarHeaderCell *)cell atIndexPath:(NSIndexPath *)indexPath; @end -@implementation FSCalendarHeader +@implementation FSCalendarHeaderView #pragma mark - Life cycle @@ -44,17 +43,12 @@ - (void)initialize { + _needsAdjustingViewFrame = YES; + _needsAdjustingMonthPosition = YES; _scrollDirection = UICollectionViewScrollDirectionHorizontal; _scrollEnabled = YES; - _needsAdjustingMonthPosition = YES; - _needsAdjustingViewFrame = YES; - UICollectionViewFlowLayout *collectionViewLayout = [[UICollectionViewFlowLayout alloc] init]; - collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; - collectionViewLayout.minimumInteritemSpacing = 0; - collectionViewLayout.minimumLineSpacing = 0; - collectionViewLayout.sectionInset = UIEdgeInsetsZero; - collectionViewLayout.itemSize = CGSizeMake(1, 1); + FSCalendarHeaderLayout *collectionViewLayout = [[FSCalendarHeaderLayout alloc] init]; self.collectionViewLayout = collectionViewLayout; FSCalendarCollectionView *collectionView = [[FSCalendarCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:collectionViewLayout]; @@ -77,21 +71,14 @@ if (_needsAdjustingViewFrame) { _needsAdjustingViewFrame = NO; _collectionViewLayout.itemSize = CGSizeMake(1, 1); + [_collectionViewLayout invalidateLayout]; _collectionView.frame = CGRectMake(0, self.fs_height*0.1, self.fs_width, self.fs_height*0.9); - _collectionViewLayout.itemSize = CGSizeMake( - _collectionView.fs_width*((_scrollDirection==UICollectionViewScrollDirectionHorizontal)?0.5:1), - _collectionView.fs_height - ); } if (_needsAdjustingMonthPosition) { _needsAdjustingMonthPosition = NO; - if (self.scrollDirection == UICollectionViewScrollDirectionHorizontal) { - [_collectionView setContentOffset:CGPointMake((_scrollOffset+0.5)*_collectionViewLayout.itemSize.width, 0) animated:NO]; - } else { - [_collectionView setContentOffset:CGPointMake(0, _scrollOffset * _collectionViewLayout.itemSize.height) animated:NO]; - } - }; + [self scrollToOffset:_scrollOffset animated:NO]; + } } @@ -110,81 +97,18 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - switch (self.calendar.scope) { - case FSCalendarScopeMonth: { - switch (_scrollDirection) { - case UICollectionViewScrollDirectionVertical: { - NSDate *minimumPage = [_calendar beginingOfMonthOfDate:_calendar.minimumDate]; - NSInteger count = [_calendar monthsFromDate:minimumPage toDate:_calendar.maximumDate] + 1; - return count; - } - case UICollectionViewScrollDirectionHorizontal: { - // 这里需要默认多出两项,否则当contentOffset为负时,切换到其他页面时会自动归零 - // 2 more pages to prevent scrollView from auto bouncing while push/present to other UIViewController - NSDate *minimumPage = [_calendar beginingOfMonthOfDate:_calendar.minimumDate]; - NSInteger count = [_calendar monthsFromDate:minimumPage toDate:_calendar.maximumDate] + 1; - return count + 2; - } - default: { - break; - } - } - break; - } - case FSCalendarScopeWeek: { - NSDate *minimumPage = [_calendar beginingOfMonthOfDate:_calendar.minimumDate]; - NSInteger count = [_calendar weeksFromDate:minimumPage toDate:_calendar.maximumDate] + 1; - return count + 2; - } - default: { - break; - } + NSInteger numberOfSections = self.calendar.collectionView.numberOfSections; + if (self.scrollDirection == UICollectionViewScrollDirectionVertical) { + return numberOfSections; } - return 0; + return numberOfSections + 2; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { FSCalendarHeaderCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; cell.header = self; - cell.titleLabel.font = _appearance.preferredHeaderTitleFont; - cell.titleLabel.textColor = _appearance.headerTitleColor; - _calendar.formatter.dateFormat = _appearance.headerDateFormat; - BOOL usesUpperCase = (_appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase; - NSString *text = nil; - switch (self.calendar.scope) { - case FSCalendarScopeMonth: { - if (_scrollDirection == UICollectionViewScrollDirectionHorizontal) { - // 多出的两项需要制空 - if ((indexPath.item == 0 || indexPath.item == [collectionView numberOfItemsInSection:0] - 1)) { - text = nil; - } else { - NSDate *date = [_calendar dateByAddingMonths:indexPath.item-1 toDate:_calendar.minimumDate]; - text = [_calendar.formatter stringFromDate:date]; - } - } else { - NSDate *date = [_calendar dateByAddingMonths:indexPath.item toDate:_calendar.minimumDate]; - text = [_calendar.formatter stringFromDate:date]; - } - break; - } - case FSCalendarScopeWeek: { - if ((indexPath.item == 0 || indexPath.item == [collectionView numberOfItemsInSection:0] - 1)) { - text = nil; - } else { - NSDate *firstPage = [_calendar middleOfWeekFromDate:_calendar.minimumDate]; - NSDate *date = [_calendar dateByAddingWeeks:indexPath.item-1 toDate:firstPage]; - text = [_calendar.formatter stringFromDate:date]; - } - break; - } - default: { - break; - } - } - text = usesUpperCase ? text.uppercaseString : text; - cell.titleLabel.text = text; - [cell setNeedsLayout]; + [self configureCell:cell atIndexPath:indexPath]; return cell; } @@ -200,23 +124,34 @@ #pragma mark - Properties - - (void)setCalendar:(FSCalendar *)calendar { - if (![_calendar isEqual:calendar]) { - _calendar = calendar; - _appearance = calendar.appearance; - } + _calendar = calendar; + [self configureAppearance]; } - - (void)setScrollOffset:(CGFloat)scrollOffset +{ + [self setScrollOffset:scrollOffset animated:NO]; +} + +- (void)setScrollOffset:(CGFloat)scrollOffset animated:(BOOL)animated { if (_scrollOffset != scrollOffset) { _scrollOffset = scrollOffset; } - _needsAdjustingMonthPosition = YES; - [self setNeedsLayout]; + [self scrollToOffset:scrollOffset animated:NO]; +} + +- (void)scrollToOffset:(CGFloat)scrollOffset animated:(BOOL)animated +{ + 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]; + } else { + CGFloat step = self.collectionView.fs_height; + [_collectionView setContentOffset:CGPointMake(0, scrollOffset*step) animated:animated]; + } } - (void)setScrollDirection:(UICollectionViewScrollDirection)scrollDirection @@ -225,7 +160,6 @@ _scrollDirection = scrollDirection; _collectionViewLayout.scrollDirection = scrollDirection; _needsAdjustingMonthPosition = YES; - _needsAdjustingViewFrame = YES; [self setNeedsLayout]; } } @@ -245,6 +179,56 @@ [_collectionView reloadData]; } +- (void)configureCell:(FSCalendarHeaderCell *)cell atIndexPath:(NSIndexPath *)indexPath +{ + FSCalendarAppearance *appearance = self.calendar.appearance; + cell.titleLabel.font = appearance.headerTitleFont; + cell.titleLabel.textColor = appearance.headerTitleColor; + _calendar.formatter.dateFormat = appearance.headerDateFormat; + BOOL usesUpperCase = (appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase; + NSString *text = nil; + switch (self.calendar.transitionCoordinator.representingScope) { + case FSCalendarScopeMonth: { + if (_scrollDirection == UICollectionViewScrollDirectionHorizontal) { + // 多出的两项需要制空 + if ((indexPath.item == 0 || indexPath.item == [self.collectionView numberOfItemsInSection:0] - 1)) { + text = nil; + } else { + NSDate *date = [self.calendar.gregorian dateByAddingUnit:NSCalendarUnitMonth value:indexPath.item-1 toDate:self.calendar.minimumDate options:0]; + text = [_calendar.formatter stringFromDate:date]; + } + } else { + NSDate *date = [self.calendar.gregorian dateByAddingUnit:NSCalendarUnitMonth value:indexPath.item toDate:self.calendar.minimumDate options:0]; + text = [_calendar.formatter stringFromDate:date]; + } + break; + } + case FSCalendarScopeWeek: { + if ((indexPath.item == 0 || indexPath.item == [self.collectionView numberOfItemsInSection:0] - 1)) { + text = nil; + } else { + NSDate *firstPage = [self.calendar.gregorian fs_middleDayOfWeek:self.calendar.minimumDate]; + NSDate *date = [self.calendar.gregorian dateByAddingUnit:NSCalendarUnitWeekOfYear value:indexPath.item-1 toDate:firstPage options:0]; + text = [_calendar.formatter stringFromDate:date]; + } + break; + } + default: { + break; + } + } + text = usesUpperCase ? text.uppercaseString : text; + cell.titleLabel.text = text; + [cell setNeedsLayout]; +} + +- (void)configureAppearance +{ + [self.collectionView.visibleCells enumerateObjectsUsingBlock:^(__kindof FSCalendarHeaderCell * _Nonnull cell, NSUInteger idx, BOOL * _Nonnull stop) { + [self configureCell:cell atIndexPath:[self.collectionView indexPathForCell:cell]]; + }]; +} + @end @@ -280,31 +264,49 @@ CGFloat position = [self.contentView convertPoint:CGPointMake(CGRectGetMidX(self.contentView.bounds), CGRectGetMidY(self.contentView.bounds)) toView:self.header].x; CGFloat center = CGRectGetMidX(self.header.bounds); if (self.header.scrollEnabled) { - self.contentView.alpha = 1.0 - (1.0-self.header.appearance.headerMinimumDissolvedAlpha)*ABS(center-position)/self.fs_width; + self.contentView.alpha = 1.0 - (1.0-self.header.calendar.appearance.headerMinimumDissolvedAlpha)*ABS(center-position)/self.fs_width; } else { - self.contentView.alpha = (position > 0 && position < self.header.fs_width*0.75); + self.contentView.alpha = (position > self.header.fs_width*0.25 && position < self.header.fs_width*0.75); } } else if (self.header.scrollDirection == UICollectionViewScrollDirectionVertical) { CGFloat position = [self.contentView convertPoint:CGPointMake(CGRectGetMidX(self.contentView.bounds), CGRectGetMidY(self.contentView.bounds)) toView:self.header].y; CGFloat center = CGRectGetMidY(self.header.bounds); - self.contentView.alpha = 1.0 - (1.0-self.header.appearance.headerMinimumDissolvedAlpha)*ABS(center-position)/self.fs_height; + self.contentView.alpha = 1.0 - (1.0-self.header.calendar.appearance.headerMinimumDissolvedAlpha)*ABS(center-position)/self.fs_height; } } -- (void)invalidateHeaderFont +@end + + +@implementation FSCalendarHeaderLayout + +- (instancetype)init { - _titleLabel.font = self.header.appearance.preferredHeaderTitleFont; + self = [super init]; + if (self) { + self.scrollDirection = UICollectionViewScrollDirectionHorizontal; + self.minimumInteritemSpacing = 0; + self.minimumLineSpacing = 0; + self.sectionInset = UIEdgeInsetsZero; + self.itemSize = CGSizeMake(1, 1); + } + return self; } -- (void)invalidateHeaderTextColor +- (void)prepareLayout { - _titleLabel.textColor = self.header.appearance.headerTitleColor; + [super prepareLayout]; + + self.itemSize = CGSizeMake( + self.collectionView.fs_width*((self.scrollDirection==UICollectionViewScrollDirectionHorizontal)?0.5:1), + self.collectionView.fs_height + ); + } @end - @implementation FSCalendarHeaderTouchDeliver - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarScopeHandle.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarScopeHandle.h new file mode 100644 index 0000000..455c3cf --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarScopeHandle.h @@ -0,0 +1,20 @@ +// +// FSCalendarScopeHandle.h +// FSCalendar +// +// Created by dingwenchao on 4/29/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import + +@class FSCalendar; + +@interface FSCalendarScopeHandle : UIView + +@property (weak, nonatomic) UIPanGestureRecognizer *panGesture; +@property (weak, nonatomic) FSCalendar *calendar; + +- (void)handlePan:(id)sender; + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarScopeHandle.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarScopeHandle.m new file mode 100644 index 0000000..6eb789c --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarScopeHandle.m @@ -0,0 +1,78 @@ +// +// FSCalendarScopeHandle.m +// FSCalendar +// +// Created by dingwenchao on 4/29/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendarScopeHandle.h" +#import "FSCalendar.h" +#import "FSCalendarTransitionCoordinator.h" +#import "FSCalendarDynamicHeader.h" +#import "FSCalendarExtensions.h" + +@interface FSCalendarScopeHandle () + +@property (weak, nonatomic) UIView *topBorder; +@property (weak, nonatomic) UIView *handleIndicator; + +@property (weak, nonatomic) FSCalendarAppearance *appearance; + +@property (assign, nonatomic) CGFloat lastTranslation; + +@end + +@implementation FSCalendarScopeHandle + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + + UIView *view; + + view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 1)]; + view.backgroundColor = FSCalendarStandardLineColor; + [self addSubview:view]; + self.topBorder = view; + + view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 30, 6)]; + view.layer.shouldRasterize = YES; + view.layer.masksToBounds = YES; + view.layer.cornerRadius = 3; + view.layer.backgroundColor = FSCalendarStandardScopeHandleColor.CGColor; + [self addSubview:view]; + self.handleIndicator = view; + + UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; + panGesture.minimumNumberOfTouches = 1; + panGesture.maximumNumberOfTouches = 2; + [self addGestureRecognizer:panGesture]; + self.panGesture = panGesture; + + self.exclusiveTouch = YES; + + } + return self; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + self.topBorder.frame = CGRectMake(0, 0, self.fs_width, 1); + self.handleIndicator.center = CGPointMake(self.fs_width/2, self.fs_height/2-0.5); +} + +- (void)handlePan:(id)sender +{ + [self.calendar.transitionCoordinator handleScopeGesture:sender]; +} + +- (void)setCalendar:(FSCalendar *)calendar +{ + _calendar = calendar; + self.panGesture.delegate = self.calendar.transitionCoordinator; +} + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.h index 4a851ec..0391004 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.h +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.h @@ -3,7 +3,7 @@ // FSCalendar // // Created by dingwenchao on 9/17/15. -// Copyright (c) 2015 wenchaoios. All rights reserved. +// Copyright (c) 2015 Wenchao Ding. All rights reserved. // #import @@ -13,18 +13,11 @@ @interface FSCalendarStickyHeader : UICollectionReusableView @property (weak, nonatomic) FSCalendar *calendar; -@property (weak, nonatomic) FSCalendarAppearance *appearance; @property (weak, nonatomic) UILabel *titleLabel; -@property (strong, nonatomic) NSArray *weekdayLabels; @property (strong, nonatomic) NSDate *month; -- (void)invalidateHeaderFont; -- (void)invalidateHeaderTextColor; -- (void)invalidateWeekdayFont; -- (void)invalidateWeekdayTextColor; +- (void)configureAppearance; -- (void)invalidateWeekdaySymbols; - -@end \ No newline at end of file +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.m index 1038117..56fb75d 100644 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.m +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarStickyHeader.m @@ -3,21 +3,21 @@ // FSCalendar // // Created by dingwenchao on 9/17/15. -// Copyright (c) 2015 wenchaoios. All rights reserved. +// Copyright (c) 2015 Wenchao Ding. All rights reserved. // #import "FSCalendarStickyHeader.h" #import "FSCalendar.h" -#import "UIView+FSExtension.h" -#import "FSCalendarConstance.h" +#import "FSCalendarWeekdayView.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarConstants.h" #import "FSCalendarDynamicHeader.h" @interface FSCalendarStickyHeader () -@property (weak, nonatomic) UIView *contentView; -@property (weak, nonatomic) UIView *separator; - -@property (assign, nonatomic) BOOL needsAdjustingViewFrame; +@property (weak , nonatomic) UIView *contentView; +@property (weak , nonatomic) UIView *bottomBorder; +@property (weak , nonatomic) FSCalendarWeekdayView *weekdayView; @end @@ -28,8 +28,6 @@ self = [super initWithFrame:frame]; if (self) { - _needsAdjustingViewFrame = YES; - UIView *view; UILabel *label; @@ -45,18 +43,13 @@ self.titleLabel = label; view = [[UIView alloc] initWithFrame:CGRectZero]; - view.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.25]; + view.backgroundColor = FSCalendarStandardLineColor; [_contentView addSubview:view]; - self.separator = view; + self.bottomBorder = view; - NSMutableArray *weekdayLabels = [NSMutableArray arrayWithCapacity:7]; - for (int i = 0; i < 7; i++) { - label = [[UILabel alloc] initWithFrame:CGRectZero]; - label.textAlignment = NSTextAlignmentCenter; - [_contentView addSubview:label]; - [weekdayLabels addObject:label]; - } - self.weekdayLabels = weekdayLabels.copy; + FSCalendarWeekdayView *weekdayView = [[FSCalendarWeekdayView alloc] init]; + [self.contentView addSubview:weekdayView]; + self.weekdayView = weekdayView; } return self; } @@ -65,28 +58,19 @@ { [super layoutSubviews]; - if (_needsAdjustingViewFrame) { - - _needsAdjustingViewFrame = NO; - _contentView.frame = self.bounds; - - CGFloat weekdayWidth = self.fs_width / 7.0; - CGFloat weekdayHeight = _calendar.preferredWeekdayHeight; - CGFloat weekdayMargin = weekdayHeight * 0.1; - CGFloat titleWidth = _contentView.fs_width; - - [_weekdayLabels enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger index, BOOL *stop) { \ - label.frame = CGRectMake(index*weekdayWidth, _contentView.fs_height-weekdayHeight-weekdayMargin, weekdayWidth, weekdayHeight); - }]; - - CGFloat titleHeight = [@"1" sizeWithAttributes:@{NSFontAttributeName:_appearance.preferredHeaderTitleFont}].height*1.5 + weekdayMargin*3; - - _separator.frame = CGRectMake(0, _contentView.fs_height-weekdayHeight-weekdayMargin*2, _contentView.fs_width, 1.0); - _titleLabel.frame = CGRectMake(0, _separator.fs_bottom-titleHeight-weekdayMargin, titleWidth,titleHeight); - - } + _contentView.frame = self.bounds; + + CGFloat weekdayHeight = _calendar.preferredWeekdayHeight; + CGFloat weekdayMargin = weekdayHeight * 0.1; + CGFloat titleWidth = _contentView.fs_width; + + self.weekdayView.frame = CGRectMake(0, _contentView.fs_height-weekdayHeight-weekdayMargin, self.contentView.fs_width, weekdayHeight); + + CGFloat titleHeight = [@"1" sizeWithAttributes:@{NSFontAttributeName:self.calendar.appearance.headerTitleFont}].height*1.5 + weekdayMargin*3; + + _bottomBorder.frame = CGRectMake(0, _contentView.fs_height-weekdayHeight-weekdayMargin*2, _contentView.fs_width, 1.0); + _titleLabel.frame = CGRectMake(0, _bottomBorder.fs_bottom-titleHeight-weekdayMargin, titleWidth,titleHeight); - [self reloadData]; } #pragma mark - Properties @@ -95,63 +79,30 @@ { if (![_calendar isEqual:calendar]) { _calendar = calendar; + _weekdayView.calendar = calendar; + [self configureAppearance]; } - if (![_appearance isEqual:calendar.appearance]) { - _appearance = calendar.appearance; - [self invalidateHeaderFont]; - [self invalidateHeaderTextColor]; - [self invalidateWeekdayFont]; - [self invalidateWeekdayTextColor]; - } -} - -#pragma mark - Public methods - -- (void)reloadData -{ - [self invalidateWeekdaySymbols]; - _calendar.formatter.dateFormat = _appearance.headerDateFormat; - BOOL usesUpperCase = (_appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase; - NSString *text = [_calendar.formatter stringFromDate:_month]; - text = usesUpperCase ? text.uppercaseString : text; - _titleLabel.text = text; } #pragma mark - Private methods -- (void)invalidateHeaderFont +- (void)configureAppearance { - _titleLabel.font = _appearance.headerTitleFont; + _titleLabel.font = self.calendar.appearance.headerTitleFont; + _titleLabel.textColor = self.calendar.appearance.headerTitleColor; + [self.weekdayView configureAppearance]; } -- (void)invalidateHeaderTextColor +- (void)setMonth:(NSDate *)month { - _titleLabel.textColor = _appearance.headerTitleColor; + _month = month; + _calendar.formatter.dateFormat = self.calendar.appearance.headerDateFormat; + BOOL usesUpperCase = (self.calendar.appearance.caseOptions & 15) == FSCalendarCaseOptionsHeaderUsesUpperCase; + NSString *text = [_calendar.formatter stringFromDate:_month]; + text = usesUpperCase ? text.uppercaseString : text; + self.titleLabel.text = text; } -- (void)invalidateWeekdayFont -{ - [_weekdayLabels makeObjectsPerformSelector:@selector(setFont:) withObject:_appearance.weekdayFont]; -} - -- (void)invalidateWeekdayTextColor -{ - [_weekdayLabels makeObjectsPerformSelector:@selector(setTextColor:) withObject:_appearance.weekdayTextColor]; -} - -- (void)invalidateWeekdaySymbols -{ - BOOL useVeryShortWeekdaySymbols = (_appearance.caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesSingleUpperCase; - NSArray *weekdaySymbols = useVeryShortWeekdaySymbols ? _calendar.calendar.veryShortStandaloneWeekdaySymbols : _calendar.calendar.shortStandaloneWeekdaySymbols; - BOOL useDefaultWeekdayCase = (_appearance.caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesDefaultCase; - [_weekdayLabels enumerateObjectsUsingBlock:^(UILabel *label, NSUInteger index, BOOL *stop) { - index += _calendar.firstWeekday-1; - index %= 7; - label.text = useDefaultWeekdayCase ? weekdaySymbols[index] : [weekdaySymbols[index] uppercaseString]; - }]; -} - - @end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarTransitionCoordinator.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarTransitionCoordinator.h new file mode 100644 index 0000000..eccbafd --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarTransitionCoordinator.h @@ -0,0 +1,59 @@ +// +// FSCalendarTransitionCoordinator.h +// FSCalendar +// +// Created by dingwenchao on 3/13/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendar.h" +#import "FSCalendarCollectionView.h" +#import "FSCalendarCollectionViewLayout.h" +#import "FSCalendarScopeHandle.h" + +typedef NS_ENUM(NSUInteger, FSCalendarTransition) { + FSCalendarTransitionNone, + FSCalendarTransitionMonthToWeek, + FSCalendarTransitionWeekToMonth +}; +typedef NS_ENUM(NSUInteger, FSCalendarTransitionState) { + FSCalendarTransitionStateIdle, + FSCalendarTransitionStateChanging, + FSCalendarTransitionStateFinishing, +}; + +@interface FSCalendarTransitionCoordinator : NSObject + +@property (weak, nonatomic) FSCalendar *calendar; +@property (weak, nonatomic) FSCalendarCollectionView *collectionView; +@property (weak, nonatomic) FSCalendarCollectionViewLayout *collectionViewLayout; + +@property (assign, nonatomic) FSCalendarTransition transition; +@property (assign, nonatomic) FSCalendarTransitionState state; + +@property (assign, nonatomic) CGSize cachedMonthSize; + +@property (readonly, nonatomic) FSCalendarScope representingScope; + +- (instancetype)initWithCalendar:(FSCalendar *)calendar; + +- (void)performScopeTransitionFromScope:(FSCalendarScope)fromScope toScope:(FSCalendarScope)toScope animated:(BOOL)animated; +- (void)performBoundingRectTransitionFromMonth:(NSDate *)fromMonth toMonth:(NSDate *)toMonth duration:(CGFloat)duration; + +- (void)handleScopeGesture:(id)sender; + +@end + + +@interface FSCalendarTransitionAttributes : NSObject + +@property (assign, nonatomic) CGRect sourceBounds; +@property (assign, nonatomic) CGRect targetBounds; +@property (strong, nonatomic) NSDate *sourcePage; +@property (strong, nonatomic) NSDate *targetPage; +@property (assign, nonatomic) NSInteger focusedRowNumber; +@property (assign, nonatomic) NSDate *focusedDate; +@property (strong, nonatomic) NSDate *firstDayOfMonth; + +@end + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarTransitionCoordinator.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarTransitionCoordinator.m new file mode 100644 index 0000000..0c0e7d3 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarTransitionCoordinator.m @@ -0,0 +1,752 @@ +// +// FSCalendarTransitionCoordinator.m +// FSCalendar +// +// Created by Wenchao Ding on 3/13/16. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendarTransitionCoordinator.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarDynamicHeader.h" +#import + +@interface FSCalendarTransitionCoordinator () + +@property (readonly, nonatomic) FSCalendarTransitionAttributes *transitionAttributes; +@property (strong , nonatomic) FSCalendarTransitionAttributes *pendingAttributes; +@property (assign , nonatomic) CGFloat lastTranslation; + +- (void)performTransitionCompletionAnimated:(BOOL)animated; +- (void)performTransitionCompletion:(FSCalendarTransition)transition animated:(BOOL)animated; + +- (void)performAlphaAnimationFrom:(CGFloat)fromAlpha to:(CGFloat)toAlpha duration:(CGFloat)duration exception:(NSInteger)exception completion:(void(^)())completion; +- (void)performForwardTransition:(FSCalendarTransition)transition fromProgress:(CGFloat)progress; +- (void)performBackwardTransition:(FSCalendarTransition)transition fromProgress:(CGFloat)progress; +- (void)performAlphaAnimationWithProgress:(CGFloat)progress; +- (void)performPathAnimationWithProgress:(CGFloat)progress; + +- (void)scopeTransitionDidBegin:(UIPanGestureRecognizer *)panGesture; +- (void)scopeTransitionDidUpdate:(UIPanGestureRecognizer *)panGesture; +- (void)scopeTransitionDidEnd:(UIPanGestureRecognizer *)panGesture; + +- (CGRect)boundingRectForScope:(FSCalendarScope)scope page:(NSDate *)page; + +- (void)boundingRectWillChange:(CGRect)targetBounds animated:(BOOL)animated; + +@end + +@implementation FSCalendarTransitionCoordinator + +- (instancetype)initWithCalendar:(FSCalendar *)calendar +{ + self = [super init]; + if (self) { + self.calendar = calendar; + self.collectionView = self.calendar.collectionView; + self.collectionViewLayout = self.calendar.collectionViewLayout; + } + return self; +} + +#pragma mark - Target actions + +- (void)handleScopeGesture:(UIPanGestureRecognizer *)sender +{ + switch (sender.state) { + case UIGestureRecognizerStateBegan: { + [self scopeTransitionDidBegin:sender]; + break; + } + case UIGestureRecognizerStateChanged: { + [self scopeTransitionDidUpdate:sender]; + break; + } + case UIGestureRecognizerStateEnded: { + [self scopeTransitionDidEnd:sender]; + break; + } + case UIGestureRecognizerStateCancelled: { + [self scopeTransitionDidEnd:sender]; + break; + } + case UIGestureRecognizerStateFailed: { + [self scopeTransitionDidEnd:sender]; + break; + } + default: { + break; + } + } +} + +#pragma mark - + +- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer +{ + if (self.state != FSCalendarTransitionStateIdle) { + return NO; + } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + + if (gestureRecognizer == self.calendar.scopeGesture && self.calendar.collectionViewLayout.scrollDirection == UICollectionViewScrollDirectionVertical) { + return NO; + } + if (gestureRecognizer == self.calendar.scopeHandle.panGesture) { + CGFloat velocity = [(UIPanGestureRecognizer *)gestureRecognizer velocityInView:gestureRecognizer.view].y; + return self.calendar.scope == FSCalendarScopeWeek ? velocity >= 0 : velocity <= 0; + } + if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [[gestureRecognizer valueForKey:@"_targets"] containsObject:self.calendar]) { + CGPoint velocity = [(UIPanGestureRecognizer *)gestureRecognizer velocityInView:gestureRecognizer.view]; + BOOL shouldStart = self.calendar.scope == FSCalendarScopeWeek ? velocity.y >= 0 : velocity.y <= 0; + if (!shouldStart) return NO; + shouldStart = (ABS(velocity.x)<=ABS(velocity.y)); + if (shouldStart) { + self.calendar.collectionView.panGestureRecognizer.enabled = NO; + self.calendar.collectionView.panGestureRecognizer.enabled = YES; + } + return shouldStart; + } + return YES; + +#pragma GCC diagnostic pop + + return NO; +} + +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer +{ + return otherGestureRecognizer == self.collectionView.panGestureRecognizer && self.collectionView.decelerating; +} + +- (void)scopeTransitionDidBegin:(UIPanGestureRecognizer *)panGesture +{ + if (self.state != FSCalendarTransitionStateIdle) return; + + CGPoint velocity = [panGesture velocityInView:panGesture.view]; + switch (self.calendar.scope) { + case FSCalendarScopeMonth: { + if (velocity.y < 0) { + self.state = FSCalendarTransitionStateChanging; + self.transition = FSCalendarTransitionMonthToWeek; + } + break; + } + case FSCalendarScopeWeek: { + if (velocity.y > 0) { + self.state = FSCalendarTransitionStateChanging; + self.transition = FSCalendarTransitionWeekToMonth; + } + break; + } + default: + break; + } + if (self.state != FSCalendarTransitionStateChanging) return; + + self.pendingAttributes = self.transitionAttributes; + self.lastTranslation = [panGesture translationInView:panGesture.view].y; + + if (self.transition == FSCalendarTransitionWeekToMonth) { + [self.calendar fs_setVariable:self.pendingAttributes.targetPage forKey:@"_currentPage"]; + [self prelayoutForWeekToMonthTransition]; + self.collectionView.fs_top = -self.pendingAttributes.focusedRowNumber*self.calendar.collectionViewLayout.estimatedItemSize.height; + + } +} + +- (void)scopeTransitionDidUpdate:(UIPanGestureRecognizer *)panGesture +{ + if (self.state != FSCalendarTransitionStateChanging) return; + + CGFloat translation = [panGesture translationInView:panGesture.view].y; + + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + switch (self.transition) { + case FSCalendarTransitionMonthToWeek: { + CGFloat progress = ({ + CGFloat minTranslation = CGRectGetHeight(self.pendingAttributes.targetBounds) - CGRectGetHeight(self.pendingAttributes.sourceBounds); + translation = MAX(minTranslation, translation); + translation = MIN(0, translation); + CGFloat progress = translation/minTranslation; + progress; + }); + [self performAlphaAnimationWithProgress:progress]; + [self performPathAnimationWithProgress:progress]; + break; + } + case FSCalendarTransitionWeekToMonth: { + CGFloat progress = ({ + CGFloat maxTranslation = CGRectGetHeight(self.pendingAttributes.targetBounds) - CGRectGetHeight(self.pendingAttributes.sourceBounds); + translation = MIN(maxTranslation, translation); + translation = MAX(0, translation); + CGFloat progress = translation/maxTranslation; + progress; + }); + [self performAlphaAnimationWithProgress:progress]; + [self performPathAnimationWithProgress:progress]; + break; + } + default: + break; + } + [CATransaction commit]; + self.lastTranslation = translation; +} + +- (void)scopeTransitionDidEnd:(UIPanGestureRecognizer *)panGesture +{ + if (self.state != FSCalendarTransitionStateChanging) return; + + self.state = FSCalendarTransitionStateFinishing; + + CGFloat translation = [panGesture translationInView:panGesture.view].y; + CGFloat velocity = [panGesture velocityInView:panGesture.view].y; + + switch (self.transition) { + case FSCalendarTransitionMonthToWeek: { + CGFloat progress = ({ + CGFloat minTranslation = CGRectGetHeight(self.pendingAttributes.targetBounds) - CGRectGetHeight(self.pendingAttributes.sourceBounds); + translation = MAX(minTranslation, translation); + translation = MIN(0, translation); + CGFloat progress = translation/minTranslation; + progress; + }); + if (velocity >= 0) { + [self performBackwardTransition:self.transition fromProgress:progress]; + } else { + [self performForwardTransition:self.transition fromProgress:progress]; + } + break; + } + case FSCalendarTransitionWeekToMonth: { + CGFloat progress = ({ + CGFloat maxTranslation = CGRectGetHeight(self.pendingAttributes.targetBounds) - CGRectGetHeight(self.pendingAttributes.sourceBounds); + translation = MAX(0, translation); + translation = MIN(maxTranslation, translation); + CGFloat progress = translation/maxTranslation; + progress; + }); + if (velocity >= 0) { + [self performForwardTransition:self.transition fromProgress:progress]; + } else { + [self performBackwardTransition:self.transition fromProgress:progress]; + } + break; + } + default: + break; + } + +} + +#pragma mark - Public methods + +- (void)performScopeTransitionFromScope:(FSCalendarScope)fromScope toScope:(FSCalendarScope)toScope animated:(BOOL)animated +{ + if (fromScope == toScope) return; + + self.transition = ({ + FSCalendarTransition transition = FSCalendarTransitionNone; + if (fromScope == FSCalendarScopeMonth && toScope == FSCalendarScopeWeek) { + transition = FSCalendarTransitionMonthToWeek; + } else if (fromScope == FSCalendarScopeWeek && toScope == FSCalendarScopeMonth) { + transition = FSCalendarTransitionWeekToMonth; + } + transition; + }); + + // Start transition + self.state = FSCalendarTransitionStateFinishing; + FSCalendarTransitionAttributes *attr = self.transitionAttributes; + self.pendingAttributes = attr; + + switch (self.transition) { + + case FSCalendarTransitionMonthToWeek: { + + [self.calendar fs_setVariable:attr.targetPage forKey:@"_currentPage"]; + self.calendar.contentView.clipsToBounds = YES; + + if (animated) { + CGFloat duration = 0.3; + + [self performAlphaAnimationFrom:1 to:0 duration:0.22 exception:attr.focusedRowNumber completion:^{ + [self performTransitionCompletionAnimated:animated]; + }]; + + if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationsEnabled:YES]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:duration]; + self.collectionView.fs_top = -attr.focusedRowNumber*self.calendar.collectionViewLayout.estimatedItemSize.height; + [self boundingRectWillChange:attr.targetBounds animated:animated]; + [UIView commitAnimations]; + } + + } else { + + [self performTransitionCompletionAnimated:animated]; + [self boundingRectWillChange:attr.targetBounds animated:animated]; + + } + + break; + } + + case FSCalendarTransitionWeekToMonth: { + + [self.calendar fs_setVariable:attr.targetPage forKey:@"_currentPage"]; + + [self prelayoutForWeekToMonthTransition]; + + if (animated) { + + CGFloat duration = 0.3; + + [self performAlphaAnimationFrom:0 to:1 duration:duration exception:attr.focusedRowNumber completion:^{ + [self performTransitionCompletionAnimated:animated]; + }]; + + [CATransaction begin]; + [CATransaction setDisableActions:NO]; + if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { + self.collectionView.fs_top = -attr.focusedRowNumber*self.calendar.collectionViewLayout.estimatedItemSize.height; + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationsEnabled:YES]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:duration]; + self.collectionView.fs_top = 0; + [self boundingRectWillChange:attr.targetBounds animated:animated]; + [UIView commitAnimations]; + } + [CATransaction commit]; + + } else { + + [self performTransitionCompletionAnimated:animated]; + [self boundingRectWillChange:attr.targetBounds animated:animated]; + + } + break; + } + default: + break; + } + +} + +- (void)performBoundingRectTransitionFromMonth:(NSDate *)fromMonth toMonth:(NSDate *)toMonth duration:(CGFloat)duration +{ + if (self.calendar.scope != FSCalendarScopeMonth) return; + NSInteger lastRowCount = [self.calendar.calculator numberOfRowsInMonth:fromMonth]; + NSInteger currentRowCount = [self.calendar.calculator numberOfRowsInMonth:toMonth]; + if (lastRowCount != currentRowCount) { + CGFloat animationDuration = duration; + CGRect bounds = (CGRect){CGPointZero,[self.calendar sizeThatFits:self.calendar.frame.size scope:FSCalendarScopeMonth]}; + self.state = FSCalendarTransitionStateChanging; + void (^completion)(BOOL) = ^(BOOL finished) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(MAX(0, duration-animationDuration) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.calendar.needsAdjustingViewFrame = YES; + [self.calendar setNeedsLayout]; + self.state = FSCalendarTransitionStateIdle; + }); + }; + if (FSCalendarInAppExtension) { + // Detect today extension: http://stackoverflow.com/questions/25048026/ios-8-extension-how-to-detect-running + [self boundingRectWillChange:bounds animated:YES]; + completion(YES); + } else { + [UIView animateWithDuration:animationDuration delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ + [self boundingRectWillChange:bounds animated:YES]; + } completion:completion]; + } + + } +} + +#pragma mark - Private properties + +- (void)performTransitionCompletionAnimated:(BOOL)animated +{ + [self performTransitionCompletion:self.transition animated:animated]; +} + +- (void)performTransitionCompletion:(FSCalendarTransition)transition animated:(BOOL)animated +{ + switch (transition) { + case FSCalendarTransitionMonthToWeek: { + [self.calendar.visibleCells enumerateObjectsUsingBlock:^(UICollectionViewCell *obj, NSUInteger idx, BOOL * stop) { + obj.contentView.layer.opacity = 1; + }]; + self.collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + self.calendar.calendarHeaderView.scrollDirection = self.collectionViewLayout.scrollDirection; + self.calendar.needsAdjustingViewFrame = YES; + [self.collectionView reloadData]; + [self.calendar.calendarHeaderView reloadData]; + break; + } + case FSCalendarTransitionWeekToMonth: { + self.calendar.needsAdjustingViewFrame = YES; + [self.calendar.visibleCells enumerateObjectsUsingBlock:^(UICollectionViewCell *obj, NSUInteger idx, BOOL * stop) { + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + obj.contentView.layer.opacity = 1; + [CATransaction commit]; + [obj.contentView.layer removeAnimationForKey:@"opacity"]; + }]; + break; + } + default: + break; + } + self.state = FSCalendarTransitionStateIdle; + self.transition = FSCalendarTransitionNone; + self.calendar.contentView.clipsToBounds = NO; + self.pendingAttributes = nil; + [self.calendar setNeedsLayout]; + [self.calendar layoutIfNeeded]; +} + +- (FSCalendarTransitionAttributes *)transitionAttributes +{ + FSCalendarTransitionAttributes *attributes = [[FSCalendarTransitionAttributes alloc] init]; + attributes.sourceBounds = self.calendar.bounds; + attributes.sourcePage = self.calendar.currentPage; + switch (self.transition) { + + case FSCalendarTransitionMonthToWeek: { + + NSDate *focusedDate = ({ + NSArray *candidates = ({ + NSMutableArray *dates = self.calendar.selectedDates.reverseObjectEnumerator.allObjects.mutableCopy; + if (self.calendar.today) { + [dates addObject:self.calendar.today]; + } + if (self.calendar.currentPage) { + [dates addObject:self.calendar.currentPage]; + } + dates.copy; + }); + NSArray *visibleCandidates = [candidates filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSDate * _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { + NSIndexPath *indexPath = [self.calendar.calculator indexPathForDate:evaluatedObject scope:FSCalendarScopeMonth]; + NSInteger currentSection = [self.calendar.calculator indexPathForDate:self.calendar.currentPage scope:FSCalendarScopeMonth].section; + return indexPath.section == currentSection; + }]]; + NSDate *date = visibleCandidates.firstObject; + date; + }); + NSInteger focusedRow = [self.calendar.calculator coordinateForIndexPath:[self.calendar.calculator indexPathForDate:focusedDate scope:FSCalendarScopeMonth]].row; + + NSDate *currentPage = self.calendar.currentPage; + NSIndexPath *indexPath = [self.calendar.calculator indexPathForDate:currentPage scope:FSCalendarScopeMonth]; + NSDate *monthHead = [self.calendar.calculator monthHeadForSection:indexPath.section]; + NSDate *targetPage = [self.calendar.gregorian dateByAddingUnit:NSCalendarUnitDay value:focusedRow*7 toDate:monthHead options:0]; + + attributes.focusedRowNumber = focusedRow; + attributes.focusedDate = focusedDate; + attributes.targetPage = targetPage; + attributes.targetBounds = [self boundingRectForScope:FSCalendarScopeWeek page:attributes.targetPage]; + + break; + } + case FSCalendarTransitionWeekToMonth: { + + NSInteger focusedRow = 0; + NSDate *currentPage = self.calendar.currentPage; + + NSDate *focusedDate = ({ + NSArray *candidates = ({ + NSMutableArray *dates = self.calendar.selectedDates.reverseObjectEnumerator.allObjects.mutableCopy; + if (self.calendar.today) { + [dates addObject:self.calendar.today]; + } + if (self.calendar.currentPage) { + [dates addObject:[self.calendar.gregorian fs_lastDayOfWeek:currentPage]]; + } + dates.copy; + }); + NSArray *visibleCandidates = [candidates filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSDate * _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { + NSIndexPath *indexPath = [self.calendar.calculator indexPathForDate:evaluatedObject scope:FSCalendarScopeWeek]; + NSInteger currentSection = [self.calendar.calculator indexPathForDate:self.calendar.currentPage scope:FSCalendarScopeWeek].section; + return indexPath.section == currentSection; + }]]; + NSDate *date = visibleCandidates.firstObject; + date; + }); + + NSDate *firstDayOfMonth = [self.calendar.gregorian fs_firstDayOfMonth:focusedDate]; + attributes.focusedDate = focusedDate; + firstDayOfMonth = firstDayOfMonth ?: [self.calendar.gregorian fs_firstDayOfMonth:currentPage]; + NSInteger numberOfPlaceholdersForPrev = [self.calendar.calculator numberOfHeadPlaceholdersForMonth:firstDayOfMonth]; + NSDate *firstDateOfPage = [self.calendar.gregorian dateByAddingUnit:NSCalendarUnitDay value:-numberOfPlaceholdersForPrev toDate:firstDayOfMonth options:0]; + + for (int i = 0; i < 6; i++) { + NSDate *currentRow = [self.calendar.gregorian dateByAddingUnit:NSCalendarUnitWeekOfYear value:i toDate:firstDateOfPage options:0]; + if ([self.calendar.gregorian isDate:currentRow inSameDayAsDate:currentPage]) { + focusedRow = i; + currentPage = firstDayOfMonth; + break; + } + } + attributes.focusedRowNumber = focusedRow; + attributes.targetPage = currentPage; + attributes.firstDayOfMonth = firstDayOfMonth; + + attributes.targetBounds = [self boundingRectForScope:FSCalendarScopeMonth page:attributes.targetPage]; + + break; + } + default: + break; + } + return attributes; +} + +#pragma mark - Private properties + +- (FSCalendarScope)representingScope +{ + switch (self.state) { + case FSCalendarTransitionStateIdle: { + return self.calendar.scope; + } + case FSCalendarTransitionStateChanging: + case FSCalendarTransitionStateFinishing: { + return FSCalendarScopeMonth; + } + } +} + +#pragma mark - Private methods + +- (CGRect)boundingRectForScope:(FSCalendarScope)scope page:(NSDate *)page +{ + CGSize contentSize; + switch (scope) { + case FSCalendarScopeMonth: { + if (self.calendar.placeholderType == FSCalendarPlaceholderTypeFillSixRows) { + contentSize = self.cachedMonthSize; + } else { + CGFloat padding = self.calendar.collectionViewLayout.sectionInsets.top + self.calendar.collectionViewLayout.sectionInsets.bottom; + contentSize = CGSizeMake(self.calendar.fs_width, + self.calendar.preferredHeaderHeight+ + self.calendar.preferredWeekdayHeight+ + ([self.calendar.calculator numberOfRowsInMonth:page]*self.calendar.collectionViewLayout.estimatedItemSize.height)+ + self.calendar.scopeHandle.fs_height+padding); + } + break; + } + case FSCalendarScopeWeek: { + contentSize = [self.calendar sizeThatFits:self.calendar.frame.size scope:scope]; + break; + } + } + return (CGRect){CGPointZero,contentSize}; +} + +- (void)boundingRectWillChange:(CGRect)targetBounds animated:(BOOL)animated +{ + self.calendar.scopeHandle.fs_bottom = CGRectGetMaxY(targetBounds); + self.calendar.contentView.fs_height = CGRectGetHeight(targetBounds)-self.calendar.scopeHandle.fs_height; + self.calendar.daysContainer.fs_height = CGRectGetHeight(targetBounds)-self.calendar.preferredHeaderHeight-self.calendar.preferredWeekdayHeight-self.calendar.scopeHandle.fs_height; + [[self.calendar valueForKey:@"delegateProxy"] calendar:self.calendar boundingRectWillChange:targetBounds animated:animated]; +} + +- (void)performForwardTransition:(FSCalendarTransition)transition fromProgress:(CGFloat)progress +{ + FSCalendarTransitionAttributes *attr = self.pendingAttributes; + switch (transition) { + case FSCalendarTransitionMonthToWeek: { + + [self.calendar willChangeValueForKey:@"scope"]; + [self.calendar fs_setUnsignedIntegerVariable:FSCalendarScopeWeek forKey:@"_scope"]; + [self.calendar didChangeValueForKey:@"scope"]; + + [self.calendar fs_setVariable:attr.targetPage forKey:@"_currentPage"]; + + self.calendar.contentView.clipsToBounds = YES; + + CGFloat currentAlpha = MAX(1-progress*1.1,0); + CGFloat duration = 0.3; + [self performAlphaAnimationFrom:currentAlpha to:0 duration:0.22 exception:attr.focusedRowNumber completion:^{ + [self performTransitionCompletionAnimated:YES]; + }]; + + if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { + [UIView beginAnimations:@"delegateTranslation" context:"translation"]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:duration]; + self.collectionView.fs_top = -attr.focusedRowNumber*self.calendar.collectionViewLayout.estimatedItemSize.height; + [self boundingRectWillChange:attr.targetBounds animated:YES]; + [UIView commitAnimations]; + } + + break; + } + case FSCalendarTransitionWeekToMonth: { + + [self.calendar willChangeValueForKey:@"scope"]; + [self.calendar fs_setUnsignedIntegerVariable:FSCalendarScopeMonth forKey:@"_scope"]; + [self.calendar didChangeValueForKey:@"scope"]; + + [self performAlphaAnimationFrom:progress to:1 duration:0.4 exception:attr.focusedRowNumber completion:^{ + [self performTransitionCompletionAnimated:YES]; + }]; + + CGFloat duration = 0.3; + [CATransaction begin]; + [CATransaction setDisableActions:NO]; + + if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { + [UIView beginAnimations:@"delegateTranslation" context:"translation"]; + [UIView setAnimationsEnabled:YES]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:duration]; + self.collectionView.fs_top = 0; + [self boundingRectWillChange:attr.targetBounds animated:YES]; + [UIView commitAnimations]; + } + [CATransaction commit]; + break; + } + default: + break; + } +} + +- (void)performBackwardTransition:(FSCalendarTransition)transition fromProgress:(CGFloat)progress +{ + switch (transition) { + case FSCalendarTransitionMonthToWeek: { + + [self.calendar willChangeValueForKey:@"scope"]; + [self.calendar fs_setUnsignedIntegerVariable:FSCalendarScopeMonth forKey:@"_scope"]; + [self.calendar didChangeValueForKey:@"scope"]; + + [self performAlphaAnimationFrom:MAX(1-progress*1.1,0) to:1 duration:0.3 exception:self.pendingAttributes.focusedRowNumber completion:^{ + [self.calendar.visibleCells enumerateObjectsUsingBlock:^(__kindof UICollectionViewCell * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + obj.contentView.layer.opacity = 1; + [obj.contentView.layer removeAnimationForKey:@"opacity"]; + }]; + self.pendingAttributes = nil; + self.state = FSCalendarTransitionStateIdle; + }]; + + if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { + [UIView beginAnimations:@"delegateTranslation" context:"translation"]; + [UIView setAnimationsEnabled:YES]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:0.3]; + self.collectionView.fs_top = 0; + [self boundingRectWillChange:self.pendingAttributes.sourceBounds animated:YES]; + [UIView commitAnimations]; + } + break; + } + case FSCalendarTransitionWeekToMonth: { + + [self.calendar willChangeValueForKey:@"scope"]; + [self.calendar fs_setUnsignedIntegerVariable:FSCalendarScopeWeek forKey:@"_scope"]; + [self.calendar didChangeValueForKey:@"scope"]; + + [self performAlphaAnimationFrom:progress to:0 duration:0.3 exception:self.pendingAttributes.focusedRowNumber completion:^{ + [self.calendar fs_setVariable:self.pendingAttributes.sourcePage forKey:@"_currentPage"]; + [self performTransitionCompletion:FSCalendarTransitionMonthToWeek animated:YES]; + }]; + + if (self.calendar.delegate && ([self.calendar.delegate respondsToSelector:@selector(calendar:boundingRectWillChange:animated:)] || [self.calendar.delegate respondsToSelector:@selector(calendarCurrentScopeWillChange:animated:)])) { + [UIView beginAnimations:@"delegateTranslation" context:"translation"]; + [UIView setAnimationsEnabled:YES]; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView setAnimationDuration:0.3]; + self.collectionView.fs_top = (-self.pendingAttributes.focusedRowNumber*self.calendar.collectionViewLayout.estimatedItemSize.height); + [self boundingRectWillChange:self.pendingAttributes.sourceBounds animated:YES]; + [UIView commitAnimations]; + } + break; + } + default: + break; + } +} + +- (void)performAlphaAnimationFrom:(CGFloat)fromAlpha to:(CGFloat)toAlpha duration:(CGFloat)duration exception:(NSInteger)exception completion:(void(^)())completion; +{ + [self.calendar.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger idx, BOOL *stop) { + if (CGRectContainsPoint(self.collectionView.bounds, cell.center)) { + BOOL shouldPerformAlpha = NO; + NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell]; + NSInteger row = [self.calendar.calculator coordinateForIndexPath:indexPath].row; + shouldPerformAlpha = row != exception; + if (shouldPerformAlpha) { + CABasicAnimation *opacity = [CABasicAnimation animationWithKeyPath:@"opacity"]; + opacity.duration = duration; + opacity.fromValue = @(fromAlpha); + opacity.toValue = @(toAlpha); + opacity.removedOnCompletion = NO; + opacity.fillMode = kCAFillModeForwards; + [cell.contentView.layer addAnimation:opacity forKey:@"opacity"]; + } + } + }]; + if (completion) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + completion(); + }); + } +} + +- (void)performAlphaAnimationWithProgress:(CGFloat)progress +{ + CGFloat opacity = self.transition == FSCalendarTransitionMonthToWeek ? MAX((1-progress*1.1),0) : progress; + [self.calendar.visibleCells enumerateObjectsUsingBlock:^(FSCalendarCell *cell, NSUInteger idx, BOOL *stop) { + if (CGRectContainsPoint(self.collectionView.bounds, cell.center)) { + BOOL shouldPerformAlpha = NO; + NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell]; + NSInteger row = [self.calendar.calculator coordinateForIndexPath:indexPath].row; + shouldPerformAlpha = row != self.pendingAttributes.focusedRowNumber; + if (shouldPerformAlpha) { + cell.contentView.layer.opacity = opacity; + } + } + }]; +} + +- (void)performPathAnimationWithProgress:(CGFloat)progress +{ + CGFloat targetHeight = CGRectGetHeight(self.pendingAttributes.targetBounds); + CGFloat sourceHeight = CGRectGetHeight(self.pendingAttributes.sourceBounds); + CGFloat currentHeight = sourceHeight - (sourceHeight-targetHeight)*progress - self.calendar.scopeHandle.fs_height; + CGRect currentBounds = CGRectMake(0, 0, CGRectGetWidth(self.pendingAttributes.targetBounds), currentHeight+self.calendar.scopeHandle.fs_height); + self.collectionView.fs_top = (-self.pendingAttributes.focusedRowNumber*self.calendar.collectionViewLayout.estimatedItemSize.height)*(self.transition == FSCalendarTransitionMonthToWeek?progress:(1-progress)); + [self boundingRectWillChange:currentBounds animated:NO]; + if (self.transition == FSCalendarTransitionWeekToMonth) { + self.calendar.contentView.fs_height = targetHeight; + } +} + + +- (void)prelayoutForWeekToMonthTransition +{ + self.calendar.contentView.clipsToBounds = YES; + self.calendar.contentView.fs_height = CGRectGetHeight(self.pendingAttributes.targetBounds)-self.calendar.scopeHandle.fs_height; + self.collectionViewLayout.scrollDirection = (UICollectionViewScrollDirection)self.calendar.scrollDirection; + self.calendar.calendarHeaderView.scrollDirection = self.collectionViewLayout.scrollDirection; + self.calendar.needsAdjustingViewFrame = YES; + [self.calendar setNeedsLayout]; + [self.collectionView reloadData]; + [self.calendar.calendarHeaderView reloadData]; + [self.calendar layoutIfNeeded]; +} + +@end + +@implementation FSCalendarTransitionAttributes + + +@end + diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarWeekdayView.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarWeekdayView.h new file mode 100644 index 0000000..282c90e --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarWeekdayView.h @@ -0,0 +1,27 @@ +// +// FSCalendarWeekdayView.h +// FSCalendar +// +// Created by dingwenchao on 03/11/2016. +// Copyright © 2016 dingwenchao. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class FSCalendar; + +@interface FSCalendarWeekdayView : UIView + +/** + An array of UILabel objects displaying the weekday symbols. + */ +@property (readonly, nonatomic) NSArray *weekdayLabels; + +- (void)configureAppearance; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarWeekdayView.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarWeekdayView.m new file mode 100644 index 0000000..7698be6 --- /dev/null +++ b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/FSCalendarWeekdayView.m @@ -0,0 +1,109 @@ +// +// FSCalendarWeekdayView.m +// FSCalendar +// +// Created by dingwenchao on 03/11/2016. +// Copyright © 2016 Wenchao Ding. All rights reserved. +// + +#import "FSCalendarWeekdayView.h" +#import "FSCalendar.h" +#import "FSCalendarDynamicHeader.h" +#import "FSCalendarExtensions.h" + +@interface FSCalendarWeekdayView() + +@property (strong, nonatomic) NSPointerArray *weekdayPointers; +@property (weak , nonatomic) UIView *contentView; +@property (weak , nonatomic) FSCalendar *calendar; + +- (void)commonInit; + +@end + +@implementation FSCalendarWeekdayView + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self commonInit]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + [self commonInit]; + } + return self; +} + +- (void)commonInit +{ + UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero]; + [self addSubview:contentView]; + _contentView = contentView; + + _weekdayPointers = [NSPointerArray weakObjectsPointerArray]; + for (int i = 0; i < 7; i++) { + UILabel *weekdayLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + weekdayLabel.textAlignment = NSTextAlignmentCenter; + [self.contentView addSubview:weekdayLabel]; + [_weekdayPointers addPointer:(__bridge void * _Nullable)(weekdayLabel)]; + } +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + self.contentView.frame = self.bounds; + + // Position Calculation + NSInteger count = self.weekdayPointers.count; + size_t size = sizeof(CGFloat)*count; + CGFloat *widths = malloc(size); + CGFloat contentWidth = self.contentView.fs_width; + FSCalendarSliceCake(contentWidth, count, widths); + + CGFloat x = 0; + for (NSInteger i = 0; i < count; i++) { + CGFloat width = widths[i]; + UILabel *label = [self.weekdayPointers pointerAtIndex:i]; + label.frame = CGRectMake(x, 0, width, self.contentView.fs_height); + x += width; + } + free(widths); +} + +- (void)setCalendar:(FSCalendar *)calendar +{ + _calendar = calendar; + [self configureAppearance]; +} + +- (NSArray *)weekdayLabels +{ + return self.weekdayPointers.allObjects; +} + +- (void)configureAppearance +{ + BOOL useVeryShortWeekdaySymbols = (self.calendar.appearance.caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesSingleUpperCase; + NSArray *weekdaySymbols = useVeryShortWeekdaySymbols ? self.calendar.gregorian.veryShortStandaloneWeekdaySymbols : self.calendar.gregorian.shortStandaloneWeekdaySymbols; + BOOL useDefaultWeekdayCase = (self.calendar.appearance.caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesDefaultCase; + + for (NSInteger i = 0; i < self.weekdayPointers.count; i++) { + NSInteger index = (i + self.calendar.firstWeekday-1) % 7; + UILabel *label = [self.weekdayPointers pointerAtIndex:i]; + label.font = self.calendar.appearance.weekdayFont; + label.textColor = self.calendar.appearance.weekdayTextColor; + label.text = useDefaultWeekdayCase ? weekdaySymbols[index] : [weekdaySymbols[index] uppercaseString]; + } + +} + +@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSDate+FSExtension.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSDate+FSExtension.h deleted file mode 100644 index c91d31c..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSDate+FSExtension.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// NSDate+FSExtension.h -// Pods -// -// Created by Wenchao Ding on 29/1/15. -// -// - -#import - -/** - * This category is deprecated in this framework as it premised that the calendar should be gregorian. But feel free to use it for gregorian-only. - */ -@interface NSDate (FSExtension) - -@property (readonly, nonatomic) NSInteger fs_year; -@property (readonly, nonatomic) NSInteger fs_month; -@property (readonly, nonatomic) NSInteger fs_day; -@property (readonly, nonatomic) NSInteger fs_weekday; -@property (readonly, nonatomic) NSInteger fs_weekOfYear; -@property (readonly, nonatomic) NSInteger fs_hour; -@property (readonly, nonatomic) NSInteger fs_minute; -@property (readonly, nonatomic) NSInteger fs_second; - -@property (readonly, nonatomic) NSDate *fs_dateByIgnoringTimeComponents; -@property (readonly, nonatomic) NSDate *fs_firstDayOfMonth; -@property (readonly, nonatomic) NSDate *fs_lastDayOfMonth; -@property (readonly, nonatomic) NSDate *fs_firstDayOfWeek; -@property (readonly, nonatomic) NSDate *fs_middleOfWeek; -@property (readonly, nonatomic) NSDate *fs_tomorrow; -@property (readonly, nonatomic) NSDate *fs_yesterday; -@property (readonly, nonatomic) NSInteger fs_numberOfDaysInMonth; - -+ (instancetype)fs_dateFromString:(NSString *)string format:(NSString *)format; -+ (instancetype)fs_dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day; - -- (NSDate *)fs_dateByAddingYears:(NSInteger)years; -- (NSDate *)fs_dateBySubtractingYears:(NSInteger)years; -- (NSDate *)fs_dateByAddingMonths:(NSInteger)months; -- (NSDate *)fs_dateBySubtractingMonths:(NSInteger)months; -- (NSDate *)fs_dateByAddingWeeks:(NSInteger)weeks; -- (NSDate *)fs_dateBySubtractingWeeks:(NSInteger)weeks; -- (NSDate *)fs_dateByAddingDays:(NSInteger)days; -- (NSDate *)fs_dateBySubtractingDays:(NSInteger)days; -- (NSInteger)fs_yearsFrom:(NSDate *)date; -- (NSInteger)fs_monthsFrom:(NSDate *)date; -- (NSInteger)fs_weeksFrom:(NSDate *)date; -- (NSInteger)fs_daysFrom:(NSDate *)date; - -- (BOOL)fs_isEqualToDateForMonth:(NSDate *)date; -- (BOOL)fs_isEqualToDateForWeek:(NSDate *)date; -- (BOOL)fs_isEqualToDateForDay:(NSDate *)date; - -- (NSString *)fs_stringWithFormat:(NSString *)format; -- (NSString *)fs_string; - -@end - - -@interface NSCalendar (FSExtension) - -+ (instancetype)fs_sharedCalendar; - -@end - -@interface NSDateFormatter (FSExtension) - -+ (instancetype)fs_sharedDateFormatter; - -@end - -@interface NSDateComponents (FSExtension) - -+ (instancetype)fs_sharedDateComponents; - -@end - - - diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSDate+FSExtension.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSDate+FSExtension.m deleted file mode 100644 index 7a46413..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSDate+FSExtension.m +++ /dev/null @@ -1,344 +0,0 @@ -// -// NSDate+FSExtension.m -// Pods -// -// Created by Wenchao Ding on 29/1/15. -// -// - -#import "NSDate+FSExtension.h" - -@implementation NSDate (FSExtension) - -- (NSInteger)fs_year -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitYear fromDate:self]; - return component.year; -} - -- (NSInteger)fs_month -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitMonth - fromDate:self]; - return component.month; -} - -- (NSInteger)fs_day -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitDay - fromDate:self]; - return component.day; -} - -- (NSInteger)fs_weekday -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitWeekday fromDate:self]; - return component.weekday; -} - -- (NSInteger)fs_weekOfYear -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitWeekOfYear fromDate:self]; - return component.weekOfYear; -} - -- (NSInteger)fs_hour -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitHour - fromDate:self]; - return component.hour; -} - -- (NSInteger)fs_minute -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitMinute - fromDate:self]; - return component.minute; -} - -- (NSInteger)fs_second -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *component = [calendar components:NSCalendarUnitSecond - fromDate:self]; - return component.second; -} - -- (NSDate *)fs_dateByIgnoringTimeComponents -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:self]; - return [calendar dateFromComponents:components]; -} - -- (NSDate *)fs_firstDayOfMonth -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth| NSCalendarUnitDay fromDate:self]; - components.day = 1; - return [calendar dateFromComponents:components]; -} - -- (NSDate *)fs_lastDayOfMonth -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:self]; - components.month++; - components.day = 0; - return [calendar dateFromComponents:components]; -} - -- (NSDate *)fs_firstDayOfWeek -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *weekdayComponents = [calendar components:NSCalendarUnitWeekday fromDate:self]; - NSDateComponents *componentsToSubtract = [NSDateComponents fs_sharedDateComponents]; - componentsToSubtract.day = - (weekdayComponents.weekday - calendar.firstWeekday); - NSDate *beginningOfWeek = [calendar dateByAddingComponents:componentsToSubtract toDate:self options:0]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:beginningOfWeek]; - beginningOfWeek = [calendar dateFromComponents:components]; - componentsToSubtract.day = NSIntegerMax; - return beginningOfWeek; -} - -- (NSDate *)fs_middleOfWeek -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *weekdayComponents = [calendar components:NSCalendarUnitWeekday fromDate:self]; - NSDateComponents *componentsToSubtract = [NSDateComponents fs_sharedDateComponents]; - componentsToSubtract.day = - (weekdayComponents.weekday - calendar.firstWeekday) + 3; - NSDate *middleOfWeek = [calendar dateByAddingComponents:componentsToSubtract toDate:self options:0]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:middleOfWeek]; - middleOfWeek = [calendar dateFromComponents:components]; - componentsToSubtract.day = NSIntegerMax; - return middleOfWeek; -} - -- (NSDate *)fs_tomorrow -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:self]; - components.day++; - return [calendar dateFromComponents:components]; -} - -- (NSDate *)fs_yesterday -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:self]; - components.day--; - return [calendar dateFromComponents:components]; -} - -- (NSInteger)fs_numberOfDaysInMonth -{ - NSCalendar *c = [NSCalendar fs_sharedCalendar]; - NSRange days = [c rangeOfUnit:NSCalendarUnitDay - inUnit:NSCalendarUnitMonth - forDate:self]; - return days.length; -} - -+ (instancetype)fs_dateFromString:(NSString *)string format:(NSString *)format -{ - NSDateFormatter *formatter = [NSDateFormatter fs_sharedDateFormatter]; - formatter.dateFormat = format; - return [formatter dateFromString:string]; -} - -+ (instancetype)fs_dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [NSDateComponents fs_sharedDateComponents]; - components.year = year; - components.month = month; - components.day = day; - NSDate *date = [calendar dateFromComponents:components]; - components.year = NSIntegerMax; - components.month = NSIntegerMax; - components.day = NSIntegerMax; - return date; -} - -- (NSDate *)fs_dateByAddingYears:(NSInteger)years -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [NSDateComponents fs_sharedDateComponents]; - components.year = years; - NSDate *date = [calendar dateByAddingComponents:components toDate:self options:0]; - components.year = NSIntegerMax; - return date; -} - -- (NSDate *)fs_dateBySubtractingYears:(NSInteger)years -{ - return [self fs_dateByAddingYears:-years]; -} - -- (NSDate *)fs_dateByAddingMonths:(NSInteger)months -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [NSDateComponents fs_sharedDateComponents]; - components.month = months; - NSDate *date = [calendar dateByAddingComponents:components toDate:self options:0]; - components.month = NSIntegerMax; - return date; -} - -- (NSDate *)fs_dateBySubtractingMonths:(NSInteger)months -{ - return [self fs_dateByAddingMonths:-months]; -} - -- (NSDate *)fs_dateByAddingWeeks:(NSInteger)weeks -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [NSDateComponents fs_sharedDateComponents]; - components.weekOfYear = weeks; - NSDate *date = [calendar dateByAddingComponents:components toDate:self options:0]; - components.weekOfYear = NSIntegerMax; - return date; -} - --(NSDate *)fs_dateBySubtractingWeeks:(NSInteger)weeks -{ - return [self fs_dateByAddingWeeks:-weeks]; -} - -- (NSDate *)fs_dateByAddingDays:(NSInteger)days -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [NSDateComponents fs_sharedDateComponents]; - components.day = days; - NSDate *date = [calendar dateByAddingComponents:components toDate:self options:0]; - components.day = NSIntegerMax; - return date; -} - -- (NSDate *)fs_dateBySubtractingDays:(NSInteger)days -{ - return [self fs_dateByAddingDays:-days]; -} - -- (NSInteger)fs_yearsFrom:(NSDate *)date -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitYear - fromDate:date - toDate:self - options:0]; - return components.year; -} - -- (NSInteger)fs_monthsFrom:(NSDate *)date -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitMonth - fromDate:date - toDate:self - options:0]; - return components.month; -} - -- (NSInteger)fs_weeksFrom:(NSDate *)date -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitWeekOfYear - fromDate:date - toDate:self - options:0]; - return components.weekOfYear; -} - -- (NSInteger)fs_daysFrom:(NSDate *)date -{ - NSCalendar *calendar = [NSCalendar fs_sharedCalendar]; - NSDateComponents *components = [calendar components:NSCalendarUnitDay - fromDate:date - toDate:self - options:0]; - return components.day; -} - -- (NSString *)fs_stringWithFormat:(NSString *)format -{ - NSDateFormatter *formatter = [NSDateFormatter fs_sharedDateFormatter]; - formatter.dateFormat = format; - return [formatter stringFromDate:self]; -} - -- (NSString *)fs_string -{ - return [self fs_stringWithFormat:@"yyyyMMdd"]; -} - - -- (BOOL)fs_isEqualToDateForMonth:(NSDate *)date -{ - return self.fs_year == date.fs_year && self.fs_month == date.fs_month; -} - -- (BOOL)fs_isEqualToDateForWeek:(NSDate *)date -{ - return self.fs_year == date.fs_year && self.fs_weekOfYear == date.fs_weekOfYear; -} - -- (BOOL)fs_isEqualToDateForDay:(NSDate *)date -{ - return self.fs_year == date.fs_year && self.fs_month == date.fs_month && self.fs_day == date.fs_day; -} - -@end - - -@implementation NSCalendar (FSExtension) - -+ (instancetype)fs_sharedCalendar -{ - static id instance; - static dispatch_once_t fs_sharedCalendar_onceToken; - dispatch_once(&fs_sharedCalendar_onceToken, ^{ - instance = [NSCalendar currentCalendar]; - }); - return instance; -} - -@end - - -@implementation NSDateFormatter (FSExtension) - -+ (instancetype)fs_sharedDateFormatter -{ - static id instance; - static dispatch_once_t fs_sharedDateFormatter_onceToken; - dispatch_once(&fs_sharedDateFormatter_onceToken, ^{ - instance = [[NSDateFormatter alloc] init]; - }); - return instance; -} - -@end - -@implementation NSDateComponents (FSExtension) - -+ (instancetype)fs_sharedDateComponents -{ - static id instance; - static dispatch_once_t fs_sharedDateFormatter_onceToken; - dispatch_once(&fs_sharedDateFormatter_onceToken, ^{ - instance = [[NSDateComponents alloc] init]; - }); - return instance; -} - -@end - - diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSString+FSExtension.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSString+FSExtension.h deleted file mode 100644 index abffa9a..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSString+FSExtension.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSString+FSExtension.h -// FSCalendar -// -// Created by Wenchao Ding on 8/29/15. -// Copyright (c) 2015 wenchaoios. All rights reserved. -// - -#import - -@interface NSString (FSExtension) - -- (NSDate *)fs_dateWithFormat:(NSString *)format; -- (NSDate *)fs_date; - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSString+FSExtension.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSString+FSExtension.m deleted file mode 100644 index ce22fb0..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/NSString+FSExtension.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// NSString+FSExtension.m -// FSCalendar -// -// Created by Wenchao Ding on 8/29/15. -// Copyright (c) 2015 wenchaoios. All rights reserved. -// - -#import "NSString+FSExtension.h" -#import "NSDate+FSExtension.h" - -@implementation NSString (FSExtension) - -- (NSDate *)fs_dateWithFormat:(NSString *)format -{ - NSDateFormatter *formatter = [NSDateFormatter fs_sharedDateFormatter]; - formatter.dateFormat = format; - return [formatter dateFromString:self]; -} - -- (NSDate *)fs_date -{ - return [self fs_dateWithFormat:@"yyyyMMdd"]; -} - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/UIView+FSExtension.h b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/UIView+FSExtension.h deleted file mode 100644 index 3dfbea0..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/UIView+FSExtension.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// UIView+FSExtension.h -// Pods -// -// Created by Wenchao Ding on 29/1/15. -// -// - -#import - -@interface UIView (FSExtension) - -@property (nonatomic) CGFloat fs_width; -@property (nonatomic) CGFloat fs_height; - -@property (nonatomic) CGFloat fs_top; -@property (nonatomic) CGFloat fs_left; -@property (nonatomic) CGFloat fs_bottom; -@property (nonatomic) CGFloat fs_right; - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/UIView+FSExtension.m b/Verdnaturaventas/Pods/FSCalendar/FSCalendar/UIView+FSExtension.m deleted file mode 100644 index e11507f..0000000 --- a/Verdnaturaventas/Pods/FSCalendar/FSCalendar/UIView+FSExtension.m +++ /dev/null @@ -1,73 +0,0 @@ -// -// UIView+FSExtension.m -// Pods -// -// Created by Wenchao Ding on 29/1/15. -// -// - -#import "UIView+FSExtension.h" - -@implementation UIView (FSExtension) - -- (CGFloat)fs_width -{ - return CGRectGetWidth(self.frame); -} - -- (void)setFs_width:(CGFloat)fs_width -{ - self.frame = CGRectMake(self.fs_left, self.fs_top, fs_width, self.fs_height); -} - -- (CGFloat)fs_height -{ - return CGRectGetHeight(self.frame); -} - -- (void)setFs_height:(CGFloat)fs_height -{ - self.frame = CGRectMake(self.fs_left, self.fs_top, self.fs_width, fs_height); -} - -- (CGFloat)fs_top -{ - return CGRectGetMinY(self.frame); -} - -- (void)setFs_top:(CGFloat)fs_top -{ - self.frame = CGRectMake(self.fs_left, fs_top, self.fs_width, self.fs_height); -} - -- (CGFloat)fs_bottom -{ - return CGRectGetMaxY(self.frame); -} - -- (void)setFs_bottom:(CGFloat)fs_bottom -{ - self.fs_top = fs_bottom - self.fs_height; -} - -- (CGFloat)fs_left -{ - return CGRectGetMinX(self.frame); -} - -- (void)setFs_left:(CGFloat)fs_left -{ - self.frame = CGRectMake(fs_left, self.fs_top, self.fs_width, self.fs_height); -} - -- (CGFloat)fs_right -{ - return CGRectGetMaxX(self.frame); -} - -- (void)setFs_right:(CGFloat)fs_right -{ - self.fs_left = self.fs_right - self.fs_width; -} - -@end diff --git a/Verdnaturaventas/Pods/FSCalendar/LICENSE b/Verdnaturaventas/Pods/FSCalendar/LICENSE index 656a6e1..fb2a795 100644 --- a/Verdnaturaventas/Pods/FSCalendar/LICENSE +++ b/Verdnaturaventas/Pods/FSCalendar/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2016 FSCalendar (https://github.com/WenchaoIOS/FSCalendar) +Copyright (c) 2013-2016 FSCalendar (https://github.com/WenchaoD/FSCalendar) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Verdnaturaventas/Pods/FSCalendar/README.md b/Verdnaturaventas/Pods/FSCalendar/README.md index c62c481..ac97e27 100644 --- a/Verdnaturaventas/Pods/FSCalendar/README.md +++ b/Verdnaturaventas/Pods/FSCalendar/README.md @@ -1,45 +1,90 @@ -![fscalendar](https://cloud.githubusercontent.com/assets/5186464/6655324/213a814a-cb36-11e4-9add-f80515a83291.png)

+ +![logo](https://cloud.githubusercontent.com/assets/5186464/16540124/efc51f72-408b-11e6-934a-4e750b8b55bb.png) +

+[![Apps Using](https://img.shields.io/badge/Apps%20Using-%3E%2010,000-00BFFF.svg?style=plastic)](https://cocoapods.org/pods/FSCalendar) +[![Total Downloads](https://img.shields.io/badge/Total%20Downloads-%3E%20500,000-00BFFF.svg?style=plastic)](https://cocoapods.org/pods/FSCalendar) +
[![Travis](https://travis-ci.org/WenchaoD/FSCalendar.svg?branch=master)](https://travis-ci.org/WenchaoD/FSCalendar) [![Version](https://img.shields.io/cocoapods/v/FSCalendar.svg?style=flat)](http://cocoadocs.org/docsets/FSCalendar) [![Platform](https://img.shields.io/badge/platform-iOS%207%2B-blue.svg?style=flat)](http://cocoadocs.org/docsets/FSCalendar) -[![Swift2 compatible](https://img.shields.io/badge/swift2-compatible-4BC51D.svg?style=flat)](https://developer.apple.com/swift/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![License](https://img.shields.io/cocoapods/l/FSCalendar.svg?style=flat)](http://cocoadocs.org/docsets/FSCalendar) -[![Join the chat at https://gitter.im/WenchaoD/FSCalendar](https://badges.gitter.im/WenchaoD/FSCalendar.svg)](https://gitter.im/WenchaoD/FSCalendar?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +
+[![Languages](https://img.shields.io/badge/language-objc%20|%20swift-FF69B4.svg?style=plastic)](#) -# Screenshots +# Table of contents +* [Screenshots](#screenshots) +* [Installation](#installation) +* [Pre-knowledge](#pre-knowledge) +* [Support](#support) +* [Contact](#contact) -## iPhone +## Screenshots + +### iPhone ![fscalendar](https://cloud.githubusercontent.com/assets/5186464/10262249/4fabae40-69f2-11e5-97ab-afbacd0a3da2.jpg) -## iPad +### iPad ![fscalendar-ipad](https://cloud.githubusercontent.com/assets/5186464/10927681/d2448cb6-82dc-11e5-9d11-f664a06698a7.jpg) -## Working with AutoLayout and Orientation -![fscalendar-scope-orientation-autolayout](https://cloud.githubusercontent.com/assets/5186464/13728798/59855e3e-e95e-11e5-84db-60f843427ef3.gif) +### Safe Orientation +![fscalendar-scope-orientation-autolayout](https://cloud.githubusercontent.com/assets/5186464/20325758/ea125e1e-abc0-11e6-9e29-491acbcb0d07.gif) -# Installation +### Today Extension +| iOS8/9 | iOS10 | +|--------------|-------------| +|![today1](https://cloud.githubusercontent.com/assets/5186464/20288375/ed3fba0e-ab0d-11e6-8b15-43d3dc656f22.gif)|![today2](https://cloud.githubusercontent.com/assets/5186464/20288378/f11e318c-ab0d-11e6-8d1d-9d89b563e9d7.gif)| + +### Interactive Scope Gesture +| ![1](https://cloud.githubusercontent.com/assets/5186464/21559640/e92a9ccc-ce8a-11e6-8c60-e52204f33249.gif) | +| ---- | + +### DIY support +| ![1](https://cloud.githubusercontent.com/assets/5186464/20026983/22354a0e-a342-11e6-8ae6-0614ea7f35ae.gif) | +| ------------- | +> To customize your own cell, view DIY Example in `Example-Swift` or `Example-Objc` + + +### Swipe-To-Choose + +|Single-Selection
Swipe-To-Choose|Multiple-Selection
Swipe-To-Choose|DIY
Swipe-To-Choose| +|----------|--------|--------| +|![1](https://cloud.githubusercontent.com/assets/5186464/20257768/cb1905d4-aa86-11e6-9ef7-af76f9caa024.gif)|![2](https://cloud.githubusercontent.com/assets/5186464/20257826/254070ec-aa87-11e6-81b1-1815453fd464.gif)|![3](https://cloud.githubusercontent.com/assets/5186464/20257836/2ffa3252-aa87-11e6-8ff9-3b40f5b2307b.gif)| + +## Achievement of Users + +| ![1](https://cloud.githubusercontent.com/assets/5186464/21747193/3111e4ee-d59a-11e6-8e4d-ca695b53e421.png) | ![2](https://cloud.githubusercontent.com/assets/5186464/21747393/42a753fa-d5a0-11e6-9cb2-de7cc642e69e.png) | ![3](https://cloud.githubusercontent.com/assets/5186464/21897255/ff78fcdc-d923-11e6-9d59-62119bc4343f.png) | ![4](https://cloud.githubusercontent.com/assets/5186464/21747192/3111cacc-d59a-11e6-8626-44cd75ebd794.png) | +| ------------- | ------------- | ------------- | ------------- | + +#### [***More Achievements***](https://github.com/WenchaoD/FSCalendar/wiki/) are available in [***FSCalendar Gallery***](https://github.com/WenchaoD/FSCalendar/wiki/) + +=== + +# Installation ## CocoaPods: * For iOS8+: 👍 + ```ruby use_frameworks! -pod 'FSCalendar' +target '' do + pod 'FSCalendar' +end ``` * For iOS7+: + ```ruby -pod 'FSCalendar' +target '' do + pod 'FSCalendar' +end ``` -* Alternatively to give it a test run, run the command: -```ruby -pod try FSCalendar -``` +> [NSCalendarExtension](https://github.com/WenchaoD/NSCalendarExtension) is required to get iOS7 compatibility. ## Carthage: * For iOS8+ + ```ruby github "WenchaoD/FSCalendar" ``` @@ -47,20 +92,21 @@ github "WenchaoD/FSCalendar" ## Manually: * Drag all files under `FSCalendar` folder into your project. 👍 -## Support IBInspectable / IBDesignable -Only the methods marked "👍" support IBInspectable / IBDesignable feature. [Have fun with Interface builder](#roll_with_interface_builder) +> Alternatively to give it a test run, simply press `command+u` in `Example-Objc` or `Example-Swift` and launch the ***UITest Target***.
+> Only the methods marked "👍" support IBInspectable / IBDesignable feature. [Have fun with Interface builder](#roll_with_interface_builder) + # Setup ## Use Interface Builder -1. Drag an UIView object to ViewController Scene -2. Change the `Custom Class` to `FSCalendar`
-3. Link `dataSource` and `delegate` to the ViewController
+1、 Drag an UIView object to ViewController Scene +2、 Change the `Custom Class` to `FSCalendar`
+3、 Link `dataSource` and `delegate` to the ViewController
![fscalendar-ib](https://cloud.githubusercontent.com/assets/5186464/9488580/a360297e-4c0d-11e5-8548-ee9274e7c4af.jpg) -4. Finally, you should implement `FSCalendarDataSource` and `FSCalendarDelegate` in ViewController.m +4、 Finally, implement `FSCalendarDataSource` and `FSCalendarDelegate` in your `ViewController` ## Or use code @@ -83,7 +129,7 @@ self.calendar = calendar; ```swift -private weak var calendar: FSCalendar! +fileprivate weak var calendar: FSCalendar! ``` ```swift // In loadView or viewDidLoad @@ -93,57 +139,190 @@ calendar.delegate = self view.addSubview(calendar) self.calendar = calendar ``` -
+ +> To use **FSCalendar** in Swift3, see `Example-Swift` for details. -## Hide placeholder dates -![fscalendar-showsplaceholder](https://cloud.githubusercontent.com/assets/5186464/13727902/21a90042-e940-11e5-9b9f-392f38cf007d.gif) +## Warning +`FSCalendar` ***doesn't*** update frame by itself, Please implement -1. Set `calendar.showsPlaceholders = NO`; -2. Implement `-calendar:boundingRectWillChange:animated:` +* For ***AutoLayout*** ```objc -// For autoLayout - (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated { - _calendarHeightConstraint.constant = CGRectGetHeight(bounds); + self.calendarHeightConstraint.constant = CGRectGetHeight(bounds); + // Do other updates here [self.view layoutIfNeeded]; } ``` +* For ***Manual Layout*** + ```objc -// For manual layout - (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated { calendar.frame = (CGRect){calendar.frame.origin,bounds.size}; + // Do other updates here +} +``` + +* If you are using ***Masonry*** + +```objc +- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated +{ + [calendar mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.equalTo(@(bounds.size.height)); + // Do other updates + }]; + [self.view layoutIfNeeded]; +} +``` + +* If you are using ***SnapKit*** + +```swift +func calendar(_ calendar: FSCalendar, boundingRectWillChange bounds: CGRect, animated: Bool) { + calendar.snp.updateConstraints { (make) in + make.height.equalTo(bounds.height) + // Do other updates + } + self.view.layoutIfNeeded() } ``` ### Roll with Interface Builder ![fscalendar - ibdesignable](https://cloud.githubusercontent.com/assets/5186464/9301716/2e76a2ca-4503-11e5-8450-1fa7aa93e9fd.gif) -## More Usage -* To view more usage, download the zip file and read the example. -* Or you could refer to [this document](https://github.com/WenchaoD/FSCalendar/blob/master/MOREUSAGE.md) -* To view the full documentation, see [CocoaPods Documentation](http://cocoadocs.org/docsets/FSCalendar/2.0.1/) +# Pre-knowledge -# If you like this repo -* ***Star*** this repo. -* Send your calendar screenshot or `itunes link address` [here](https://github.com/WenchaoD/FSCalendar/issues/2). +> In `Swift3`, `NSDate` and `NSDateFormatter` have been renamed to ***Date*** and ***DateFormatter*** , see `Example-Swift` for details. + +## How to create NSDate object + +* By **NSCalendar**. + +```objc +self.gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; +``` + +Then: + +```objc +NSDate *date = [gregorian dateWithEra:1 year:2016 month:9 day:10 hour:0 minute:0 second:0 nanosecond:0]; +// 2016-09-10 00:00:00 +``` + + +* Or by **NSDateFormatter** + +```objc +self.formatter = [[NSDateFormatter alloc] init]; +self.formatter.dateFormat = @"yyyy-MM-dd"; +``` + +Then: + +```objc +NSDate *date = [self.formatter dateFromString:@"2016-09-10"]; +``` + +## How to print out NSDate object + +* Use **NSDateFormatter** + +```objc +self.formatter = [[NSDateFormatter alloc] init]; +self.formatter.dateFormat = @"yyyy/MM/dd"; +``` + +```objc +NSString *string = [self.formatter stringFromDate:date]; +NSLog(@"Date is %@", string); +``` + +## How to manipulate NSDate with NSCalendar + +```objc +self.gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; +``` +* Get component of NSDate + +```objc +NSInteger era = [self.gregorian component:NSCalendarUnitEra fromDate:date]; +NSInteger year = [self.gregorian component:NSCalendarUnitYear fromDate:date]; +NSInteger month = [self.gregorian component:NSCalendarUnitMonth fromDate:date]; +NSInteger day = [self.gregorian component:NSCalendarUnitDay fromDate:date]; +NSInteger hour = [self.gregorian component:NSCalendarUnitHour fromDate:date]; +NSInteger minute = [self.gregorian component:NSCalendarUnitMinute fromDate:date]; +... + +``` + +* Get next **month** + +```objc +NSDate *nextMonth = [self.gregorain dateByAddingUnit:NSCalendarUnitMonth value:1 toDate:date options:0]; +``` + +* Get next **day** + +```objc +NSDate *nextDay = [self.gregorain dateByAddingUnit:NSCalendarUnitDay value:1 toDate:date options:0]; +``` + +* Is date in today/tomorrow/yesterday/weekend + +```objc +BOOL isToday = [self.gregorian isDateInToday:date]; +BOOL isYesterday = [self.gregorian isDateInYesterday:date]; +BOOL isTomorrow = [self.gregorian isDateInTomorrow:date]; +BOOL isWeekend = [self.gregorian isDateInWeekend:date]; +``` + +* Compare two dates + +```objc + +BOOL sameDay = [self.gregorian isDate:date1 inSameDayAsDate:date2]; +// Yes if the date1 and date2 are in same day + + +[self.gregorian compareDate:date1 toDate:date2 toUnitGranularity:unit]; +// compare the era/year/month/day/hour/minute .etc ... +// return NSOrderAscending/NSOrderSame/NSOrderDecending + +BOOL inSameUnit = [self.gregorian isDate:date1 equalToDate:date2 toUnitGranularity:unit]; +// if the given unit (era/year/month/day/hour/minute .etc) are the same + + +``` + + +## Support this repo +* [**★Star**](#) this repo +
+* Support with   +
+* Support with or + + + +
+ + +## Contact +* 微博: [**@WenchaoD**](http://weibo.com/WenchaoD) +* Twitter:[**@WenchaoD**](https://twitter.com/WenchaoD) +* QQ支持群:

+       +![fscalendar](https://cloud.githubusercontent.com/assets/5186464/18407011/8e4b6e48-7738-11e6-9fad-0e23cc881516.JPG) + +> If your made a beautiful calendar with this library in your app, please take a screen shot and [@me](https://twitter.com/WenchaoD) in twitter. Your help really means a lot to me!
-# Support me via [![paypal](https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg)](https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg) -* ☕️ [This coffee is on me!](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=Z84P82H3V4Q26&lc=C2&item_name=This%20coffee%20is%20on%20me%21&item_number=Support%20FSCalendar%20%2d%20WenchaoIOS&amount=5%2e00¤cy_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted) -* [Lunch is on me!](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=Z84P82H3V4Q26&lc=C2&item_name=Lunch%20is%20on%20me%21&item_number=Support%20FSCalendar&amount=10%2e00¤cy_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted) -* [Have a nice dinner!](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=Z84P82H3V4Q26&lc=C2&item_name=Tonight%27s%20dinner%20is%20on%20me%21&item_number=Support%20FSCalendar%20%2d%20WenchaoIOS&amount=25%2e00¤cy_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted) -* [Greate work! Keep the change!](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=Z84P82H3V4Q26&lc=C2&item_name=Great%20work%21%20Keep%20the%20change%21&item_number=Support%20FSCalendar%20%2d%20WenchaoIOS&amount=100%2e00¤cy_code=USD&button_subtype=services&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted) # License FSCalendar is available under the MIT license. See the LICENSE file for more info. -# Contributions -* Issues and pull requests are absolutely welcome. -* For code contributions, please follow [Coding Guidelines for Cocoa](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html) - -# Contact -* Email: `f33chobits@gmail.com` - +### [Documentation](http://cocoadocs.org/docsets/FSCalendar/) | [More Usage](https://github.com/WenchaoD/FSCalendar/blob/master/MOREUSAGE.md) | [简书](http://www.jianshu.com/notebooks/4276521/latest) diff --git a/Verdnaturaventas/Pods/Firebase/CoreOnly/Sources/Firebase.h b/Verdnaturaventas/Pods/Firebase/CoreOnly/Sources/Firebase.h new file mode 100755 index 0000000..8defb61 --- /dev/null +++ b/Verdnaturaventas/Pods/Firebase/CoreOnly/Sources/Firebase.h @@ -0,0 +1,101 @@ +#import + +#if !defined(__has_include) + #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \ + import the headers individually." +#else + #if __has_include() + #import + #else + #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING + #warning "FirebaseAnalytics.framework is not included in your target. Please add \ +`Firebase/Core` to your Podfile or add FirebaseAnalytics.framework to your project to ensure \ +Firebase services work as intended." + #endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + + #if __has_include() + #import + #endif + +#endif // defined(__has_include) diff --git a/Verdnaturaventas/Pods/Firebase/CoreOnly/Sources/module.modulemap b/Verdnaturaventas/Pods/Firebase/CoreOnly/Sources/module.modulemap new file mode 100755 index 0000000..3685b54 --- /dev/null +++ b/Verdnaturaventas/Pods/Firebase/CoreOnly/Sources/module.modulemap @@ -0,0 +1,4 @@ +module Firebase { + export * + header "Firebase.h" +} \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Firebase/README.md b/Verdnaturaventas/Pods/Firebase/README.md new file mode 100755 index 0000000..49aa2ee --- /dev/null +++ b/Verdnaturaventas/Pods/Firebase/README.md @@ -0,0 +1,87 @@ +# Firebase APIs for iOS + +Simplify your iOS development, grow your user base, and monetize more +effectively with Firebase services. + +Much more information can be found at [https://firebase.google.com](https://firebase.google.com). + +## Install a Firebase SDK using CocoaPods + +Firebase distributes several iOS specific APIs and SDKs via CocoaPods. +You can install the CocoaPods tool on OS X by running the following command from +the terminal. Detailed information is available in the [Getting Started +guide](https://guides.cocoapods.org/using/getting-started.html#getting-started). + +``` +$ sudo gem install cocoapods +``` + +## Try out an SDK + +You can try any of the SDKs with `pod try`. Run the following command and select +the SDK you are interested in when prompted: + +``` +$ pod try Firebase +``` + +Note that some SDKs may require credentials. More information is available in +the SDK-specific documentation at [https://firebase.google.com/docs/](https://firebase.google.com/docs/). + +## Add a Firebase SDK to your iOS app + +CocoaPods is used to install and manage dependencies in existing Xcode projects. + +1. Create an Xcode project, and save it to your local machine. +2. Create a file named `Podfile` in your project directory. This file defines + your project's dependencies, and is commonly referred to as a Podspec. +3. Open `Podfile`, and add your dependencies. A simple Podspec is shown here: + + ``` + platform :ios, '8.0' + pod 'Firebase' + ``` + +4. Save the file. + +5. Open a terminal and `cd` to the directory containing the Podfile. + + ``` + $ cd /project/ + ``` + +6. Run the `pod install` command. This will install the SDKs specified in the + Podspec, along with any dependencies they may have. + + ``` + $ pod install + ``` + +7. Open your app's `.xcworkspace` file to launch Xcode. Use this file for all + development on your app. + +8. You can also install other Firebase SDKs by adding the subspecs in the + Podfile. + + ``` + pod 'Firebase/AdMob' + pod 'Firebase/Analytics' + pod 'Firebase/Auth' + pod 'Firebase/Crash' + pod 'Firebase/Database' + pod 'Firebase/DynamicLinks' + pod 'Firebase/Firestore' + pod 'Firebase/Functions' + pod 'Firebase/Invites' + pod 'Firebase/Messaging' + pod 'Firebase/MLCommon' + pod 'Firebase/MLModelInterpreter' + pod 'Firebase/MLVision' + pod 'Firebase/MLVisionBarcodeModel' + pod 'Firebase/MLVisionFaceModel' + pod 'Firebase/MLVisionLabelModel' + pod 'Firebase/MLVisionTextModel' + pod 'Firebase/Performance' + pod 'Firebase/RemoteConfig' + pod 'Firebase/Storage' + ``` diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics new file mode 100755 index 0000000..dd2c2c1 Binary files /dev/null and b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics differ diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h new file mode 100755 index 0000000..d499af6 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h @@ -0,0 +1,62 @@ +#import + +#import "FIRAnalytics.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Provides App Delegate handlers to be used in your App Delegate. + * + * To save time integrating Firebase Analytics in an application, Firebase Analytics does not + * require delegation implementation from the AppDelegate. Instead this is automatically done by + * Firebase Analytics. Should you choose instead to delegate manually, you can turn off the App + * Delegate Proxy by adding FirebaseAppDelegateProxyEnabled into your app's Info.plist and setting + * it to NO, and adding the methods in this category to corresponding delegation handlers. + * + * To handle Universal Links, you must return YES in + * [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. + */ +@interface FIRAnalytics (AppDelegate) + +/** + * Handles events related to a URL session that are waiting to be processed. + * + * For optimal use of Firebase Analytics, call this method from the + * [UIApplicationDelegate application:handleEventsForBackgroundURLSession:completionHandler] + * method of the app delegate in your app. + * + * @param identifier The identifier of the URL session requiring attention. + * @param completionHandler The completion handler to call when you finish processing the events. + * Calling this completion handler lets the system know that your app's user interface is + * updated and a new snapshot can be taken. + */ ++ (void)handleEventsForBackgroundURLSession:(NSString *)identifier + completionHandler:(nullable void (^)(void))completionHandler; + +/** + * Handles the event when the app is launched by a URL. + * + * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and + * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on + * iOS 8.x and below) in your app. + * + * @param url The URL resource to open. This resource can be a network resource or a file. + */ ++ (void)handleOpenURL:(NSURL *)url; + +/** + * Handles the event when the app receives data associated with user activity that includes a + * Universal Link (on iOS 9.0 and above). + * + * Call this method from [UIApplication continueUserActivity:restorationHandler:] in your app + * delegate (on iOS 9.0 and above). + * + * @param userActivity The activity object containing the data associated with the task the user + * was performing. + */ ++ (void)handleUserActivity:(id)userActivity; + +@end + +NS_ASSUME_NONNULL_END + diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h new file mode 100755 index 0000000..39d23f1 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h @@ -0,0 +1,119 @@ +#import + +#import "FIREventNames.h" +#import "FIRParameterNames.h" +#import "FIRUserPropertyNames.h" + +NS_ASSUME_NONNULL_BEGIN + +/// The top level Firebase Analytics singleton that provides methods for logging events and setting +/// user properties. See the developer guides for general +/// information on using Firebase Analytics in your apps. +NS_SWIFT_NAME(Analytics) +@interface FIRAnalytics : NSObject + +/// Logs an app event. The event can have up to 25 parameters. Events with the same name must have +/// the same parameters. Up to 500 event names are supported. Using predefined events and/or +/// parameters is recommended for optimal reporting. +/// +/// The following event names are reserved and cannot be used: +///
    +///
  • ad_activeview
  • +///
  • ad_click
  • +///
  • ad_exposure
  • +///
  • ad_impression
  • +///
  • ad_query
  • +///
  • adunit_exposure
  • +///
  • app_clear_data
  • +///
  • app_remove
  • +///
  • app_update
  • +///
  • error
  • +///
  • first_open
  • +///
  • in_app_purchase
  • +///
  • notification_dismiss
  • +///
  • notification_foreground
  • +///
  • notification_open
  • +///
  • notification_receive
  • +///
  • os_update
  • +///
  • screen_view
  • +///
  • session_start
  • +///
  • user_engagement
  • +///
+/// +/// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or +/// underscores. The name must start with an alphabetic character. Some event names are +/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used. Note that event names are +/// case-sensitive and that logging two events whose names differ only in case will result in +/// two distinct events. +/// @param parameters The dictionary of event parameters. Passing nil indicates that the event has +/// no parameters. Parameter names can be up to 40 characters long and must start with an +/// alphabetic character and contain only alphanumeric characters and underscores. Only NSString +/// and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are +/// supported. NSString parameter values can be up to 100 characters long. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used for parameter names. ++ (void)logEventWithName:(NSString *)name + parameters:(nullable NSDictionary *)parameters + NS_SWIFT_NAME(logEvent(_:parameters:)); + +/// Sets a user property to a given value. Up to 25 user property names are supported. Once set, +/// user property values persist throughout the app lifecycle and across sessions. +/// +/// The following user property names are reserved and cannot be used: +///
    +///
  • first_open_time
  • +///
  • last_deep_link_referrer
  • +///
  • user_id
  • +///
+/// +/// @param value The value of the user property. Values can be up to 36 characters long. Setting the +/// value to nil removes the user property. +/// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters +/// or underscores and must start with an alphabetic character. The "firebase_", "google_", and +/// "ga_" prefixes are reserved and should not be used for user property names. ++ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name + NS_SWIFT_NAME(setUserProperty(_:forName:)); + +/// Sets the user ID property. This feature must be used in accordance with +/// Google's Privacy Policy +/// +/// @param userID The user ID to ascribe to the user of this app on this device, which must be +/// non-empty and no more than 256 characters long. Setting userID to nil removes the user ID. ++ (void)setUserID:(nullable NSString *)userID; + +/// Sets the current screen name, which specifies the current visual context in your app. This helps +/// identify the areas in your app where users spend their time and how they interact with your app. +/// Must be called on the main thread. +/// +/// Note that screen reporting is enabled automatically and records the class name of the current +/// UIViewController for you without requiring you to call this method. If you implement +/// viewDidAppear in your UIViewController but do not call [super viewDidAppear:], that screen class +/// will not be automatically tracked. The class name can optionally be overridden by calling this +/// method in the viewDidAppear callback of your UIViewController and specifying the +/// screenClassOverride parameter. setScreenName:screenClass: must be called after +/// [super viewDidAppear:]. +/// +/// If your app does not use a distinct UIViewController for each screen, you should call this +/// method and specify a distinct screenName each time a new screen is presented to the user. +/// +/// The screen name and screen class remain in effect until the current UIViewController changes or +/// a new call to setScreenName:screenClass: is made. +/// +/// @param screenName The name of the current screen. Should contain 1 to 100 characters. Set to nil +/// to clear the current screen name. +/// @param screenClassOverride The name of the screen class. Should contain 1 to 100 characters. By +/// default this is the class name of the current UIViewController. Set to nil to revert to the +/// default class name. ++ (void)setScreenName:(nullable NSString *)screenName + screenClass:(nullable NSString *)screenClassOverride; + +/// The unique ID for this instance of the application. ++ (NSString *)appInstanceID; + +/// Clears all analytics data for this instance from the device and resets the app instance ID. +/// FIRAnalyticsConfiguration values will be reset to the default values. ++ (void)resetAnalyticsData; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h new file mode 100755 index 0000000..50fbf2e --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h @@ -0,0 +1,13 @@ +#ifndef FIR_SWIFT_NAME + +#import + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 + +#endif // FIR_SWIFT_NAME diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h new file mode 100755 index 0000000..c70c53e --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h @@ -0,0 +1,407 @@ +/// @file FIREventNames.h +/// +/// Predefined event names. +/// +/// An Event is an important occurrence in your app that you want to measure. You can report up to +/// 500 different types of Events per app and you can associate up to 25 unique parameters with each +/// Event type. Some common events are suggested below, but you may also choose to specify custom +/// Event types that are associated with your specific app. Each event type is identified by a +/// unique name. Event names can be up to 40 characters long, may only contain alphanumeric +/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used. + +#import + +/// Add Payment Info event. This event signifies that a user has submitted their payment information +/// to your app. +static NSString *const kFIREventAddPaymentInfo NS_SWIFT_NAME(AnalyticsEventAddPaymentInfo) = + @"add_payment_info"; + +/// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for +/// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness +/// of your checkout process. Note: If you supply the @c kFIRParameterValue parameter, you must +/// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed +/// accurately. Params: +/// +///
    +///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterItemID (NSString)
  • +///
  • @c kFIRParameterItemName (NSString)
  • +///
  • @c kFIRParameterItemCategory (NSString)
  • +///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • +///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterOrigin (NSString) (optional)
  • +///
  • @c kFIRParameterDestination (NSString) (optional)
  • +///
  • @c kFIRParameterStartDate (NSString) (optional)
  • +///
  • @c kFIRParameterEndDate (NSString) (optional)
  • +///
+static NSString *const kFIREventAddToCart NS_SWIFT_NAME(AnalyticsEventAddToCart) = @"add_to_cart"; + +/// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. +/// Use this event to identify popular gift items in your app. Note: If you supply the +/// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency +/// parameter so that revenue metrics can be computed accurately. Params: +/// +///
    +///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterItemID (NSString)
  • +///
  • @c kFIRParameterItemName (NSString)
  • +///
  • @c kFIRParameterItemCategory (NSString)
  • +///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • +///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
+static NSString *const kFIREventAddToWishlist NS_SWIFT_NAME(AnalyticsEventAddToWishlist) = + @"add_to_wishlist"; + +/// App Open event. By logging this event when an App becomes active, developers can understand how +/// often users leave and return during the course of a Session. Although Sessions are automatically +/// reported, this event can provide further clarification around the continuous engagement of +/// app-users. +static NSString *const kFIREventAppOpen NS_SWIFT_NAME(AnalyticsEventAppOpen) = @"app_open"; + +/// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of +/// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the +/// effectiveness of your checkout process. Note: If you supply the @c kFIRParameterValue +/// parameter, you must also supply the @c kFIRParameterCurrency parameter so that revenue +/// metrics can be computed accurately. Params: +/// +///
    +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • +///
  • @c kFIRParameterStartDate (NSString) (optional)
  • +///
  • @c kFIRParameterEndDate (NSString) (optional)
  • +///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for +/// hotel bookings
  • +///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for +/// hotel bookings
  • +///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) +/// for travel bookings
  • +///
  • @c kFIRParameterOrigin (NSString) (optional)
  • +///
  • @c kFIRParameterDestination (NSString) (optional)
  • +///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • +///
+static NSString *const kFIREventBeginCheckout NS_SWIFT_NAME(AnalyticsEventBeginCheckout) = + @"begin_checkout"; + +/// Campaign Detail event. Log this event to supply the referral details of a re-engagement +/// campaign. Note: you must supply at least one of the required parameters kFIRParameterSource, +/// kFIRParameterMedium or kFIRParameterCampaign. Params: +/// +///
    +///
  • @c kFIRParameterSource (NSString)
  • +///
  • @c kFIRParameterMedium (NSString)
  • +///
  • @c kFIRParameterCampaign (NSString)
  • +///
  • @c kFIRParameterTerm (NSString) (optional)
  • +///
  • @c kFIRParameterContent (NSString) (optional)
  • +///
  • @c kFIRParameterAdNetworkClickID (NSString) (optional)
  • +///
  • @c kFIRParameterCP1 (NSString) (optional)
  • +///
+static NSString *const kFIREventCampaignDetails NS_SWIFT_NAME(AnalyticsEventCampaignDetails) = + @"campaign_details"; + +/// Checkout progress. Params: +/// +///
    +///
  • @c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterCheckoutOption (NSString) (optional)
  • +///
+static NSString *const kFIREventCheckoutProgress NS_SWIFT_NAME(AnalyticsEventCheckoutProgress) = + @"checkout_progress"; + +/// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log +/// this along with @c kFIREventSpendVirtualCurrency to better understand your virtual economy. +/// Params: +/// +///
    +///
  • @c kFIRParameterVirtualCurrencyName (NSString)
  • +///
  • @c kFIRParameterValue (signed 64-bit integer or double as NSNumber)
  • +///
+static NSString *const kFIREventEarnVirtualCurrency + NS_SWIFT_NAME(AnalyticsEventEarnVirtualCurrency) = @"earn_virtual_currency"; + +/// E-Commerce Purchase event. This event signifies that an item was purchased by a user. Note: +/// This is different from the in-app purchase event, which is reported automatically for App +/// Store-based apps. Note: If you supply the @c kFIRParameterValue parameter, you must also +/// supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed +/// accurately. Params: +/// +///
    +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • +///
  • @c kFIRParameterTax (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterShipping (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterCoupon (NSString) (optional)
  • +///
  • @c kFIRParameterLocation (NSString) (optional)
  • +///
  • @c kFIRParameterStartDate (NSString) (optional)
  • +///
  • @c kFIRParameterEndDate (NSString) (optional)
  • +///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for +/// hotel bookings
  • +///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for +/// hotel bookings
  • +///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) +/// for travel bookings
  • +///
  • @c kFIRParameterOrigin (NSString) (optional)
  • +///
  • @c kFIRParameterDestination (NSString) (optional)
  • +///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • +///
+static NSString *const kFIREventEcommercePurchase NS_SWIFT_NAME(AnalyticsEventEcommercePurchase) = + @"ecommerce_purchase"; + +/// Generate Lead event. Log this event when a lead has been generated in the app to understand the +/// efficacy of your install and re-engagement campaigns. Note: If you supply the +/// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency +/// parameter so that revenue metrics can be computed accurately. Params: +/// +///
    +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
+static NSString *const kFIREventGenerateLead NS_SWIFT_NAME(AnalyticsEventGenerateLead) = + @"generate_lead"; + +/// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use +/// this event to analyze how popular certain groups or social features are in your app. Params: +/// +///
    +///
  • @c kFIRParameterGroupID (NSString)
  • +///
+static NSString *const kFIREventJoinGroup NS_SWIFT_NAME(AnalyticsEventJoinGroup) = @"join_group"; + +/// Level Up event. This event signifies that a player has leveled up in your gaming app. It can +/// help you gauge the level distribution of your userbase and help you identify certain levels that +/// are difficult to pass. Params: +/// +///
    +///
  • @c kFIRParameterLevel (signed 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterCharacter (NSString) (optional)
  • +///
+static NSString *const kFIREventLevelUp NS_SWIFT_NAME(AnalyticsEventLevelUp) = @"level_up"; + +/// Login event. Apps with a login feature can report this event to signify that a user has logged +/// in. +static NSString *const kFIREventLogin NS_SWIFT_NAME(AnalyticsEventLogin) = @"login"; + +/// Post Score event. Log this event when the user posts a score in your gaming app. This event can +/// help you understand how users are actually performing in your game and it can help you correlate +/// high scores with certain audiences or behaviors. Params: +/// +///
    +///
  • @c kFIRParameterScore (signed 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterLevel (signed 64-bit integer as NSNumber) (optional)
  • +///
  • @c kFIRParameterCharacter (NSString) (optional)
  • +///
+static NSString *const kFIREventPostScore NS_SWIFT_NAME(AnalyticsEventPostScore) = @"post_score"; + +/// Present Offer event. This event signifies that the app has presented a purchase offer to a user. +/// Add this event to a funnel with the kFIREventAddToCart and kFIREventEcommercePurchase to gauge +/// your conversion process. Note: If you supply the @c kFIRParameterValue parameter, you must +/// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed +/// accurately. Params: +/// +///
    +///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterItemID (NSString)
  • +///
  • @c kFIRParameterItemName (NSString)
  • +///
  • @c kFIRParameterItemCategory (NSString)
  • +///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • +///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
+static NSString *const kFIREventPresentOffer NS_SWIFT_NAME(AnalyticsEventPresentOffer) = + @"present_offer"; + +/// E-Commerce Purchase Refund event. This event signifies that an item purchase was refunded. +/// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the +/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. +/// Params: +/// +///
    +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • +///
+static NSString *const kFIREventPurchaseRefund NS_SWIFT_NAME(AnalyticsEventPurchaseRefund) = + @"purchase_refund"; + +/// Remove from cart event. Params: +/// +///
    +///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterItemID (NSString)
  • +///
  • @c kFIRParameterItemName (NSString)
  • +///
  • @c kFIRParameterItemCategory (NSString)
  • +///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • +///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterOrigin (NSString) (optional)
  • +///
  • @c kFIRParameterDestination (NSString) (optional)
  • +///
  • @c kFIRParameterStartDate (NSString) (optional)
  • +///
  • @c kFIRParameterEndDate (NSString) (optional)
  • +///
+static NSString *const kFIREventRemoveFromCart NS_SWIFT_NAME(AnalyticsEventRemoveFromCart) = + @"remove_from_cart"; + +/// Search event. Apps that support search features can use this event to contextualize search +/// operations by supplying the appropriate, corresponding parameters. This event can help you +/// identify the most popular content in your app. Params: +/// +///
    +///
  • @c kFIRParameterSearchTerm (NSString)
  • +///
  • @c kFIRParameterStartDate (NSString) (optional)
  • +///
  • @c kFIRParameterEndDate (NSString) (optional)
  • +///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for +/// hotel bookings
  • +///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for +/// hotel bookings
  • +///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) +/// for travel bookings
  • +///
  • @c kFIRParameterOrigin (NSString) (optional)
  • +///
  • @c kFIRParameterDestination (NSString) (optional)
  • +///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • +///
+static NSString *const kFIREventSearch NS_SWIFT_NAME(AnalyticsEventSearch) = @"search"; + +/// Select Content event. This general purpose event signifies that a user has selected some content +/// of a certain type in an app. The content can be any object in your app. This event can help you +/// identify popular content and categories of content in your app. Params: +/// +///
    +///
  • @c kFIRParameterContentType (NSString)
  • +///
  • @c kFIRParameterItemID (NSString)
  • +///
+static NSString *const kFIREventSelectContent NS_SWIFT_NAME(AnalyticsEventSelectContent) = + @"select_content"; + +/// Set checkout option. Params: +/// +///
    +///
  • @c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)
  • +///
  • @c kFIRParameterCheckoutOption (NSString)
  • +///
+static NSString *const kFIREventSetCheckoutOption NS_SWIFT_NAME(AnalyticsEventSetCheckoutOption) = + @"set_checkout_option"; + +/// Share event. Apps with social features can log the Share event to identify the most viral +/// content. Params: +/// +///
    +///
  • @c kFIRParameterContentType (NSString)
  • +///
  • @c kFIRParameterItemID (NSString)
  • +///
+static NSString *const kFIREventShare NS_SWIFT_NAME(AnalyticsEventShare) = @"share"; + +/// Sign Up event. This event indicates that a user has signed up for an account in your app. The +/// parameter signifies the method by which the user signed up. Use this event to understand the +/// different behaviors between logged in and logged out users. Params: +/// +///
    +///
  • @c kFIRParameterSignUpMethod (NSString)
  • +///
+static NSString *const kFIREventSignUp NS_SWIFT_NAME(AnalyticsEventSignUp) = @"sign_up"; + +/// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can +/// help you identify which virtual goods are the most popular objects of purchase. Params: +/// +///
    +///
  • @c kFIRParameterItemName (NSString)
  • +///
  • @c kFIRParameterVirtualCurrencyName (NSString)
  • +///
  • @c kFIRParameterValue (signed 64-bit integer or double as NSNumber)
  • +///
+static NSString *const kFIREventSpendVirtualCurrency + NS_SWIFT_NAME(AnalyticsEventSpendVirtualCurrency) = @"spend_virtual_currency"; + +/// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use +/// this in a funnel with kFIREventTutorialComplete to understand how many users complete this +/// process and move on to the full app experience. +static NSString *const kFIREventTutorialBegin NS_SWIFT_NAME(AnalyticsEventTutorialBegin) = + @"tutorial_begin"; + +/// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding +/// process. Add this to a funnel with kFIREventTutorialBegin to gauge the completion rate of your +/// on-boarding process. +static NSString *const kFIREventTutorialComplete NS_SWIFT_NAME(AnalyticsEventTutorialComplete) = + @"tutorial_complete"; + +/// Unlock Achievement event. Log this event when the user has unlocked an achievement in your +/// game. Since achievements generally represent the breadth of a gaming experience, this event can +/// help you understand how many users are experiencing all that your game has to offer. Params: +/// +///
    +///
  • @c kFIRParameterAchievementID (NSString)
  • +///
+static NSString *const kFIREventUnlockAchievement NS_SWIFT_NAME(AnalyticsEventUnlockAchievement) = + @"unlock_achievement"; + +/// View Item event. This event signifies that some content was shown to the user. This content may +/// be a product, a webpage or just a simple image or text. Use the appropriate parameters to +/// contextualize the event. Use this event to discover the most popular items viewed in your app. +/// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the +/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. +/// Params: +/// +///
    +///
  • @c kFIRParameterItemID (NSString)
  • +///
  • @c kFIRParameterItemName (NSString)
  • +///
  • @c kFIRParameterItemCategory (NSString)
  • +///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • +///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber) (optional)
  • +///
  • @c kFIRParameterCurrency (NSString) (optional)
  • +///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • +///
  • @c kFIRParameterStartDate (NSString) (optional)
  • +///
  • @c kFIRParameterEndDate (NSString) (optional)
  • +///
  • @c kFIRParameterFlightNumber (NSString) (optional) for travel bookings
  • +///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) +/// for travel bookings
  • +///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for +/// travel bookings
  • +///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for +/// travel bookings
  • +///
  • @c kFIRParameterOrigin (NSString) (optional)
  • +///
  • @c kFIRParameterDestination (NSString) (optional)
  • +///
  • @c kFIRParameterSearchTerm (NSString) (optional) for travel bookings
  • +///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • +///
+static NSString *const kFIREventViewItem NS_SWIFT_NAME(AnalyticsEventViewItem) = @"view_item"; + +/// View Item List event. Log this event when the user has been presented with a list of items of a +/// certain category. Params: +/// +///
    +///
  • @c kFIRParameterItemCategory (NSString)
  • +///
+static NSString *const kFIREventViewItemList NS_SWIFT_NAME(AnalyticsEventViewItemList) = + @"view_item_list"; + +/// View Search Results event. Log this event when the user has been presented with the results of a +/// search. Params: +/// +///
    +///
  • @c kFIRParameterSearchTerm (NSString)
  • +///
+static NSString *const kFIREventViewSearchResults NS_SWIFT_NAME(AnalyticsEventViewSearchResults) = + @"view_search_results"; + +/// Level Start event. Log this event when the user starts a new level. Params: +/// +///
    +///
  • @c kFIRParameterLevelName (NSString)
  • +///
+static NSString *const kFIREventLevelStart NS_SWIFT_NAME(AnalyticsEventLevelStart) = + @"level_start"; + +/// Level End event. Log this event when the user finishes a level. Params: +/// +///
    +///
  • @c kFIRParameterLevelName (NSString)
  • +///
  • @c kFIRParameterSuccess (NSString)
  • +///
+static NSString *const kFIREventLevelEnd NS_SWIFT_NAME(AnalyticsEventLevelEnd) = @"level_end"; diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h new file mode 100755 index 0000000..4e1366c --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h @@ -0,0 +1,507 @@ +/// @file FIRParameterNames.h +/// +/// Predefined event parameter names. +/// +/// Params supply information that contextualize Events. You can associate up to 25 unique Params +/// with each Event type. Some Params are suggested below for certain common Events, but you are +/// not limited to these. You may supply extra Params for suggested Events or custom Params for +/// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric +/// characters and underscores ("_"), and must start with an alphabetic character. Param values can +/// be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and +/// should not be used. + +#import + +/// Game achievement ID (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterAchievementID : @"10_matches_won",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterAchievementID NS_SWIFT_NAME(AnalyticsParameterAchievementID) = + @"achievement_id"; + +/// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format. +///
+///     NSDictionary *params = @{
+///       kFIRParameterAdNetworkClickID : @"1234567",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterAdNetworkClickID + NS_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid"; + +/// The store or affiliation from which this transaction occurred (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterAffiliation : @"Google Store",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterAffiliation NS_SWIFT_NAME(AnalyticsParameterAffiliation) = + @"affiliation"; + +/// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to +/// capture campaign information, otherwise can be populated by developer. Highly Recommended +/// (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCampaign : @"winter_promotion",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCampaign NS_SWIFT_NAME(AnalyticsParameterCampaign) = + @"campaign"; + +/// Character used in game (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCharacter : @"beat_boss",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCharacter NS_SWIFT_NAME(AnalyticsParameterCharacter) = + @"character"; + +/// The checkout step (1..N) (unsigned 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCheckoutStep : @"1",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCheckoutStep NS_SWIFT_NAME(AnalyticsParameterCheckoutStep) = + @"checkout_step"; + +/// Some option on a step in an ecommerce flow (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCheckoutOption : @"Visa",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCheckoutOption + NS_SWIFT_NAME(AnalyticsParameterCheckoutOption) = @"checkout_option"; + +/// Campaign content (NSString). +static NSString *const kFIRParameterContent NS_SWIFT_NAME(AnalyticsParameterContent) = @"content"; + +/// Type of content selected (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterContentType : @"news article",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterContentType NS_SWIFT_NAME(AnalyticsParameterContentType) = + @"content_type"; + +/// Coupon code for a purchasable item (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCoupon : @"zz123",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCoupon NS_SWIFT_NAME(AnalyticsParameterCoupon) = @"coupon"; + +/// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign. +/// Use varies by network. +///
+///     NSDictionary *params = @{
+///       kFIRParameterCP1 : @"custom_data",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCP1 NS_SWIFT_NAME(AnalyticsParameterCP1) = @"cp1"; + +/// The name of a creative used in a promotional spot (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCreativeName : @"Summer Sale",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCreativeName NS_SWIFT_NAME(AnalyticsParameterCreativeName) = + @"creative_name"; + +/// The name of a creative slot (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCreativeSlot : @"summer_banner2",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCreativeSlot NS_SWIFT_NAME(AnalyticsParameterCreativeSlot) = + @"creative_slot"; + +/// Purchase currency in 3-letter +/// ISO_4217 format (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterCurrency : @"USD",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterCurrency NS_SWIFT_NAME(AnalyticsParameterCurrency) = + @"currency"; + +/// Flight or Travel destination (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterDestination : @"Mountain View, CA",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterDestination NS_SWIFT_NAME(AnalyticsParameterDestination) = + @"destination"; + +/// The arrival date, check-out date or rental end date for the item. This should be in +/// YYYY-MM-DD format (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterEndDate : @"2015-09-14",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterEndDate NS_SWIFT_NAME(AnalyticsParameterEndDate) = @"end_date"; + +/// Flight number for travel events (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterFlightNumber : @"ZZ800",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterFlightNumber NS_SWIFT_NAME(AnalyticsParameterFlightNumber) = + @"flight_number"; + +/// Group/clan/guild ID (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterGroupID : @"g1",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterGroupID NS_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id"; + +/// Index of an item in a list (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterIndex : @(1),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterIndex NS_SWIFT_NAME(AnalyticsParameterIndex) = @"index"; + +/// Item brand (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemBrand : @"Google",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemBrand NS_SWIFT_NAME(AnalyticsParameterItemBrand) = + @"item_brand"; + +/// Item category (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemCategory : @"t-shirts",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemCategory NS_SWIFT_NAME(AnalyticsParameterItemCategory) = + @"item_category"; + +/// Item ID (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemID : @"p7654",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemID NS_SWIFT_NAME(AnalyticsParameterItemID) = @"item_id"; + +/// The Google Place ID (NSString) that +/// corresponds to the associated item. Alternatively, you can supply your own custom Location ID. +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemLocationID : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemLocationID + NS_SWIFT_NAME(AnalyticsParameterItemLocationID) = @"item_location_id"; + +/// Item name (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemName : @"abc",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemName NS_SWIFT_NAME(AnalyticsParameterItemName) = + @"item_name"; + +/// The list in which the item was presented to the user (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemList : @"Search Results",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemList NS_SWIFT_NAME(AnalyticsParameterItemList) = + @"item_list"; + +/// Item variant (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterItemVariant : @"Red",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterItemVariant NS_SWIFT_NAME(AnalyticsParameterItemVariant) = + @"item_variant"; + +/// Level in game (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterLevel : @(42),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterLevel NS_SWIFT_NAME(AnalyticsParameterLevel) = @"level"; + +/// Location (NSString). The Google Place ID +/// that corresponds to the associated event. Alternatively, you can supply your own custom +/// Location ID. +///
+///     NSDictionary *params = @{
+///       kFIRParameterLocation : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterLocation NS_SWIFT_NAME(AnalyticsParameterLocation) = + @"location"; + +/// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended +/// (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterMedium : @"email",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterMedium NS_SWIFT_NAME(AnalyticsParameterMedium) = @"medium"; + +/// Number of nights staying at hotel (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterNumberOfNights : @(3),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterNumberOfNights + NS_SWIFT_NAME(AnalyticsParameterNumberOfNights) = @"number_of_nights"; + +/// Number of passengers traveling (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterNumberOfPassengers : @(11),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterNumberOfPassengers + NS_SWIFT_NAME(AnalyticsParameterNumberOfPassengers) = @"number_of_passengers"; + +/// Number of rooms for travel events (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterNumberOfRooms : @(2),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterNumberOfRooms NS_SWIFT_NAME(AnalyticsParameterNumberOfRooms) = + @"number_of_rooms"; + +/// Flight or Travel origin (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterOrigin : @"Mountain View, CA",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterOrigin NS_SWIFT_NAME(AnalyticsParameterOrigin) = @"origin"; + +/// Purchase price (double as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterPrice : @(1.0),
+///       kFIRParameterCurrency : @"USD",  // e.g. $1.00 USD
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterPrice NS_SWIFT_NAME(AnalyticsParameterPrice) = @"price"; + +/// Purchase quantity (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterQuantity : @(1),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterQuantity NS_SWIFT_NAME(AnalyticsParameterQuantity) = + @"quantity"; + +/// Score in game (signed 64-bit integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterScore : @(4200),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterScore NS_SWIFT_NAME(AnalyticsParameterScore) = @"score"; + +/// The search string/keywords used (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterSearchTerm : @"periodic table",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterSearchTerm NS_SWIFT_NAME(AnalyticsParameterSearchTerm) = + @"search_term"; + +/// Shipping cost (double as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterShipping : @(9.50),
+///       kFIRParameterCurrency : @"USD",  // e.g. $9.50 USD
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterShipping NS_SWIFT_NAME(AnalyticsParameterShipping) = + @"shipping"; + +/// Sign up method (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterSignUpMethod : @"google",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterSignUpMethod NS_SWIFT_NAME(AnalyticsParameterSignUpMethod) = + @"sign_up_method"; + +/// The origin of your traffic, such as an Ad network (for example, google) or partner (urban +/// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your +/// property. Highly recommended (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterSource : @"InMobi",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterSource NS_SWIFT_NAME(AnalyticsParameterSource) = @"source"; + +/// The departure date, check-in date or rental start date for the item. This should be in +/// YYYY-MM-DD format (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterStartDate : @"2015-09-14",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterStartDate NS_SWIFT_NAME(AnalyticsParameterStartDate) = + @"start_date"; + +/// Tax amount (double as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterTax : @(1.0),
+///       kFIRParameterCurrency : @"USD",  // e.g. $1.00 USD
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterTax NS_SWIFT_NAME(AnalyticsParameterTax) = @"tax"; + +/// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword +/// (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterTerm : @"game",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterTerm NS_SWIFT_NAME(AnalyticsParameterTerm) = @"term"; + +/// A single ID for a ecommerce group transaction (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterTransactionID : @"ab7236dd9823",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterTransactionID NS_SWIFT_NAME(AnalyticsParameterTransactionID) = + @"transaction_id"; + +/// Travel class (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterTravelClass : @"business",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterTravelClass NS_SWIFT_NAME(AnalyticsParameterTravelClass) = + @"travel_class"; + +/// A context-specific numeric value which is accumulated automatically for each event type. This is +/// a general purpose parameter that is useful for accumulating a key metric that pertains to an +/// event. Examples include revenue, distance, time and points. Value should be specified as signed +/// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events +/// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be +/// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is +/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the +/// corresponding @c kFIRParameterCurrency parameter, or supplying an invalid +/// currency code for conversion events will cause that +/// conversion to be omitted from reporting. +///
+///     NSDictionary *params = @{
+///       kFIRParameterValue : @(3.99),
+///       kFIRParameterCurrency : @"USD",  // e.g. $3.99 USD
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterValue NS_SWIFT_NAME(AnalyticsParameterValue) = @"value"; + +/// Name of virtual currency type (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterVirtualCurrencyName : @"virtual_currency_name",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterVirtualCurrencyName + NS_SWIFT_NAME(AnalyticsParameterVirtualCurrencyName) = @"virtual_currency_name"; + +/// The name of a level in a game (NSString). +///
+///     NSDictionary *params = @{
+///       kFIRParameterLevelName : @"room_1",
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterLevelName NS_SWIFT_NAME(AnalyticsParameterLevelName) = + @"level_name"; + +/// The result of an operation. Specify 1 to indicate success and 0 to indicate failure (unsigned +/// integer as NSNumber). +///
+///     NSDictionary *params = @{
+///       kFIRParameterSuccess : @(1),
+///       // ...
+///     };
+/// 
+static NSString *const kFIRParameterSuccess NS_SWIFT_NAME(AnalyticsParameterSuccess) = @"success"; diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h new file mode 100755 index 0000000..f50707f --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h @@ -0,0 +1,17 @@ +/// @file FIRUserPropertyNames.h +/// +/// Predefined user property names. +/// +/// A UserProperty is an attribute that describes the app-user. By supplying UserProperties, you can +/// later analyze different behaviors of various segments of your userbase. You may supply up to 25 +/// unique UserProperties per app, and you can use the name and value of your choosing for each one. +/// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and +/// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to +/// 36 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and should not +/// be used. + +#import + +/// The method used to sign in. For example, "google", "facebook" or "twitter". +static NSString *const kFIRUserPropertySignUpMethod + NS_SWIFT_NAME(AnalyticsUserPropertySignUpMethod) = @"sign_up_method"; diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h new file mode 100755 index 0000000..80f9871 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h @@ -0,0 +1,6 @@ +#import "FIRAnalytics+AppDelegate.h" +#import "FIRAnalytics.h" +#import "FIRAnalyticsSwiftNameSupport.h" +#import "FIREventNames.h" +#import "FIRParameterNames.h" +#import "FIRUserPropertyNames.h" diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap new file mode 100755 index 0000000..ef80595 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap @@ -0,0 +1,10 @@ +framework module FirebaseAnalytics { + umbrella header "FirebaseAnalytics.h" + export * + module * { export *} + link "sqlite3" + link "z" + link framework "Security" + link framework "StoreKit" + link framework "SystemConfiguration" + link framework "UIKit"} diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics new file mode 100755 index 0000000..d98cffe Binary files /dev/null and b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics differ diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap new file mode 100755 index 0000000..bbcb94e --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module FirebaseCoreDiagnostics { + export * + module * { export *} + link "z" + link framework "Security" + link framework "SystemConfiguration"} diff --git a/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB new file mode 100755 index 0000000..1a317d6 Binary files /dev/null and b/Verdnaturaventas/Pods/FirebaseAnalytics/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB differ diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRAnalyticsConfiguration.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRAnalyticsConfiguration.m new file mode 100644 index 0000000..33aa168 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRAnalyticsConfiguration.m @@ -0,0 +1,69 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "FIRAnalyticsConfiguration.h" + +#import "Private/FIRAnalyticsConfiguration+Internal.h" + +@implementation FIRAnalyticsConfiguration + ++ (FIRAnalyticsConfiguration *)sharedInstance { + static FIRAnalyticsConfiguration *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[FIRAnalyticsConfiguration alloc] init]; + }); + return sharedInstance; +} + +- (void)postNotificationName:(NSString *)name value:(id)value { + if (!name.length || !value) { + return; + } + [[NSNotificationCenter defaultCenter] postNotificationName:name + object:self + userInfo:@{name : value}]; +} + +- (void)setMinimumSessionInterval:(NSTimeInterval)minimumSessionInterval { + [self postNotificationName:kFIRAnalyticsConfigurationSetMinimumSessionIntervalNotification + value:@(minimumSessionInterval)]; +} + +- (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval { + [self postNotificationName:kFIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification + value:@(sessionTimeoutInterval)]; +} + +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled { + [self setAnalyticsCollectionEnabled:analyticsCollectionEnabled persistSetting:YES]; +} + +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled + persistSetting:(BOOL)shouldPersist { + // Persist the measurementEnabledState. Use FIRAnalyticsEnabledState values instead of YES/NO. + FIRAnalyticsEnabledState analyticsEnabledState = + analyticsCollectionEnabled ? kFIRAnalyticsEnabledStateSetYes : kFIRAnalyticsEnabledStateSetNo; + if (shouldPersist) { + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + [userDefaults setObject:@(analyticsEnabledState) + forKey:kFIRAPersistedConfigMeasurementEnabledStateKey]; + [userDefaults synchronize]; + } + + [self postNotificationName:kFIRAnalyticsConfigurationSetEnabledNotification + value:@(analyticsCollectionEnabled)]; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRApp.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRApp.m new file mode 100644 index 0000000..91a7aba --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRApp.m @@ -0,0 +1,737 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#import "FIRApp.h" +#import "FIRConfiguration.h" +#import "Private/FIRAnalyticsConfiguration+Internal.h" +#import "Private/FIRAppInternal.h" +#import "Private/FIRBundleUtil.h" +#import "Private/FIRLogger.h" +#import "Private/FIROptionsInternal.h" +#import "third_party/FIRAppEnvironmentUtil.h" + +NSString *const kFIRServiceAdMob = @"AdMob"; +NSString *const kFIRServiceAuth = @"Auth"; +NSString *const kFIRServiceAuthUI = @"AuthUI"; +NSString *const kFIRServiceCrash = @"Crash"; +NSString *const kFIRServiceDatabase = @"Database"; +NSString *const kFIRServiceDynamicLinks = @"DynamicLinks"; +NSString *const kFIRServiceFirestore = @"Firestore"; +NSString *const kFIRServiceFunctions = @"Functions"; +NSString *const kFIRServiceInstanceID = @"InstanceID"; +NSString *const kFIRServiceInvites = @"Invites"; +NSString *const kFIRServiceMessaging = @"Messaging"; +NSString *const kFIRServiceMeasurement = @"Measurement"; +NSString *const kFIRServicePerformance = @"Performance"; +NSString *const kFIRServiceRemoteConfig = @"RemoteConfig"; +NSString *const kFIRServiceStorage = @"Storage"; +NSString *const kGGLServiceAnalytics = @"Analytics"; +NSString *const kGGLServiceSignIn = @"SignIn"; + +NSString *const kFIRDefaultAppName = @"__FIRAPP_DEFAULT"; +NSString *const kFIRAppReadyToConfigureSDKNotification = @"FIRAppReadyToConfigureSDKNotification"; +NSString *const kFIRAppDeleteNotification = @"FIRAppDeleteNotification"; +NSString *const kFIRAppIsDefaultAppKey = @"FIRAppIsDefaultAppKey"; +NSString *const kFIRAppNameKey = @"FIRAppNameKey"; +NSString *const kFIRGoogleAppIDKey = @"FIRGoogleAppIDKey"; + +NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat = + @"/google/firebase/global_data_collection_enabled:%@"; +NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey = + @"FirebaseAutomaticDataCollectionEnabled"; + +NSString *const kFIRAppDiagnosticsNotification = @"FIRAppDiagnosticsNotification"; + +NSString *const kFIRAppDiagnosticsConfigurationTypeKey = @"ConfigType"; +NSString *const kFIRAppDiagnosticsErrorKey = @"Error"; +NSString *const kFIRAppDiagnosticsFIRAppKey = @"FIRApp"; +NSString *const kFIRAppDiagnosticsSDKNameKey = @"SDKName"; +NSString *const kFIRAppDiagnosticsSDKVersionKey = @"SDKVersion"; + +// Auth internal notification notification and key. +NSString *const FIRAuthStateDidChangeInternalNotification = + @"FIRAuthStateDidChangeInternalNotification"; +NSString *const FIRAuthStateDidChangeInternalNotificationAppKey = + @"FIRAuthStateDidChangeInternalNotificationAppKey"; +NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey = + @"FIRAuthStateDidChangeInternalNotificationTokenKey"; +NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey = + @"FIRAuthStateDidChangeInternalNotificationUIDKey"; + +/** + * The URL to download plist files. + */ +static NSString *const kPlistURL = @"https://console.firebase.google.com/"; + +@interface FIRApp () + +@property(nonatomic) BOOL alreadySentConfigureNotification; + +@property(nonatomic) BOOL alreadySentDeleteNotification; + +@end + +@implementation FIRApp + +// This is necessary since our custom getter prevents `_options` from being created. +@synthesize options = _options; + +static NSMutableDictionary *sAllApps; +static FIRApp *sDefaultApp; +static NSMutableDictionary *sLibraryVersions; + ++ (void)configure { + FIROptions *options = [FIROptions defaultOptions]; + if (!options) { + [[NSNotificationCenter defaultCenter] + postNotificationName:kFIRAppDiagnosticsNotification + object:nil + userInfo:@{ + kFIRAppDiagnosticsConfigurationTypeKey : @(FIRConfigTypeCore), + kFIRAppDiagnosticsErrorKey : [FIRApp errorForMissingOptions] + }]; + [NSException raise:kFirebaseCoreErrorDomain + format: + @"`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find " + @"a valid GoogleService-Info.plist in your project. Please download one " + @"from %@.", + kPlistURL]; + } + [FIRApp configureDefaultAppWithOptions:options sendingNotifications:YES]; +#if TARGET_OS_OSX || TARGET_OS_TV + FIRLogNotice(kFIRLoggerCore, @"I-COR000028", + @"tvOS and macOS SDK support is not part of the official Firebase product. " + @"Instead they are community supported. Details at " + @"https://github.com/firebase/firebase-ios-sdk/blob/master/README.md."); +#endif +} + ++ (void)configureWithOptions:(FIROptions *)options { + if (!options) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"Options is nil. Please pass a valid options."]; + } + [FIRApp configureDefaultAppWithOptions:options sendingNotifications:YES]; +} + ++ (void)configureDefaultAppWithOptions:(FIROptions *)options + sendingNotifications:(BOOL)sendNotifications { + if (sDefaultApp) { + // FIRApp sets up FirebaseAnalytics and does plist validation, but does not cause it + // to fire notifications. So, if the default app already exists, but has not sent out + // configuration notifications, then continue re-initializing it. + if (!sendNotifications || sDefaultApp.alreadySentConfigureNotification) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"Default app has already been configured."]; + } + } + @synchronized(self) { + FIRLogDebug(kFIRLoggerCore, @"I-COR000001", @"Configuring the default app."); + sDefaultApp = [[FIRApp alloc] initInstanceWithName:kFIRDefaultAppName options:options]; + [FIRApp addAppToAppDictionary:sDefaultApp]; + if (!sDefaultApp.alreadySentConfigureNotification && sendNotifications) { + [FIRApp sendNotificationsToSDKs:sDefaultApp]; + sDefaultApp.alreadySentConfigureNotification = YES; + } + } +} + ++ (void)configureWithName:(NSString *)name options:(FIROptions *)options { + if (!name || !options) { + [NSException raise:kFirebaseCoreErrorDomain format:@"Neither name nor options can be nil."]; + } + if (name.length == 0) { + [NSException raise:kFirebaseCoreErrorDomain format:@"Name cannot be empty."]; + } + if ([name isEqualToString:kFIRDefaultAppName]) { + [NSException raise:kFirebaseCoreErrorDomain format:@"Name cannot be __FIRAPP_DEFAULT."]; + } + for (NSInteger charIndex = 0; charIndex < name.length; charIndex++) { + char character = [name characterAtIndex:charIndex]; + if (!((character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') || + (character >= '0' && character <= '9') || character == '_' || character == '-')) { + [NSException raise:kFirebaseCoreErrorDomain + format: + @"App name should only contain Letters, " + @"Numbers, Underscores, and Dashes."]; + } + } + + if (sAllApps && sAllApps[name]) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"App named %@ has already been configured.", name]; + } + + @synchronized(self) { + FIRLogDebug(kFIRLoggerCore, @"I-COR000002", @"Configuring app named %@", name); + FIRApp *app = [[FIRApp alloc] initInstanceWithName:name options:options]; + [FIRApp addAppToAppDictionary:app]; + if (!app.alreadySentConfigureNotification) { + [FIRApp sendNotificationsToSDKs:app]; + app.alreadySentConfigureNotification = YES; + } + } +} + ++ (FIRApp *)defaultApp { + if (sDefaultApp) { + return sDefaultApp; + } + FIRLogError(kFIRLoggerCore, @"I-COR000003", + @"The default Firebase app has not yet been " + @"configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your " + @"application initialization. Read more: https://goo.gl/ctyzm8."); + return nil; +} + ++ (FIRApp *)appNamed:(NSString *)name { + @synchronized(self) { + if (sAllApps) { + FIRApp *app = sAllApps[name]; + if (app) { + return app; + } + } + FIRLogError(kFIRLoggerCore, @"I-COR000004", @"App with name %@ does not exist.", name); + return nil; + } +} + ++ (NSDictionary *)allApps { + @synchronized(self) { + if (!sAllApps) { + FIRLogError(kFIRLoggerCore, @"I-COR000005", @"No app has been configured yet."); + } + NSDictionary *dict = [NSDictionary dictionaryWithDictionary:sAllApps]; + return dict; + } +} + +// Public only for tests ++ (void)resetApps { + sDefaultApp = nil; + [sAllApps removeAllObjects]; + sAllApps = nil; + [sLibraryVersions removeAllObjects]; + sLibraryVersions = nil; +} + +- (void)deleteApp:(FIRAppVoidBoolCallback)completion { + @synchronized([self class]) { + if (sAllApps && sAllApps[self.name]) { + FIRLogDebug(kFIRLoggerCore, @"I-COR000006", @"Deleting app named %@", self.name); + [sAllApps removeObjectForKey:self.name]; + [self clearDataCollectionSwitchFromUserDefaults]; + if ([self.name isEqualToString:kFIRDefaultAppName]) { + sDefaultApp = nil; + } + if (!self.alreadySentDeleteNotification) { + NSDictionary *appInfoDict = @{kFIRAppNameKey : self.name}; + [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppDeleteNotification + object:[self class] + userInfo:appInfoDict]; + self.alreadySentDeleteNotification = YES; + } + completion(YES); + } else { + FIRLogError(kFIRLoggerCore, @"I-COR000007", @"App does not exist."); + completion(NO); + } + } +} + ++ (void)addAppToAppDictionary:(FIRApp *)app { + if (!sAllApps) { + sAllApps = [NSMutableDictionary dictionary]; + } + if ([app configureCore]) { + sAllApps[app.name] = app; + [[NSNotificationCenter defaultCenter] + postNotificationName:kFIRAppDiagnosticsNotification + object:nil + userInfo:@{ + kFIRAppDiagnosticsConfigurationTypeKey : @(FIRConfigTypeCore), + kFIRAppDiagnosticsFIRAppKey : app + }]; + } else { + [NSException raise:kFirebaseCoreErrorDomain + format: + @"Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in " + @"GoogleService-Info.plist or set in the customized options."]; + } +} + +- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options { + self = [super init]; + if (self) { + _name = [name copy]; + _options = [options copy]; + _options.editingLocked = YES; + + FIRApp *app = sAllApps[name]; + _alreadySentConfigureNotification = app.alreadySentConfigureNotification; + _alreadySentDeleteNotification = app.alreadySentDeleteNotification; + } + return self; +} + +- (void)getTokenForcingRefresh:(BOOL)forceRefresh withCallback:(FIRTokenCallback)callback { + if (!_getTokenImplementation) { + callback(nil, nil); + return; + } + + _getTokenImplementation(forceRefresh, callback); +} + +- (BOOL)configureCore { + [self checkExpectedBundleID]; + if (![self isAppIDValid]) { + if (_options.usingOptionsFromDefaultPlist) { + [[NSNotificationCenter defaultCenter] + postNotificationName:kFIRAppDiagnosticsNotification + object:nil + userInfo:@{ + kFIRAppDiagnosticsConfigurationTypeKey : @(FIRConfigTypeCore), + kFIRAppDiagnosticsErrorKey : [FIRApp errorForInvalidAppID], + }]; + } + return NO; + } + + // Initialize the Analytics once there is a valid options under default app. Analytics should + // always initialize first by itself before the other SDKs. + if ([self.name isEqualToString:kFIRDefaultAppName]) { + Class firAnalyticsClass = NSClassFromString(@"FIRAnalytics"); + if (!firAnalyticsClass) { + FIRLogError(kFIRLoggerCore, @"I-COR000022", @"Firebase Analytics is not available."); + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" + SEL startWithConfigurationSelector = @selector(startWithConfiguration:options:); +#pragma clang diagnostic pop + if ([firAnalyticsClass respondsToSelector:startWithConfigurationSelector]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [firAnalyticsClass performSelector:startWithConfigurationSelector + withObject:[FIRConfiguration sharedInstance].analyticsConfiguration + withObject:_options]; +#pragma clang diagnostic pop + } + } + } + return YES; +} + +- (FIROptions *)options { + return [_options copy]; +} + +- (void)setAutomaticDataCollectionEnabled:(BOOL)automaticDataCollectionEnabled { + NSString *key = + [NSString stringWithFormat:kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat, self.name]; + [[NSUserDefaults standardUserDefaults] setBool:automaticDataCollectionEnabled forKey:key]; + + // Core also controls the FirebaseAnalytics flag, so check if the Analytics flags are set + // within FIROptions and change the Analytics value if necessary. Analytics only works with the + // default app, so return if this isn't the default app. + if (self != sDefaultApp) { + return; + } + + // Check if the Analytics flag is explicitly set. If so, no further actions are necessary. + if ([self.options isAnalyticsCollectionExpicitlySet]) { + return; + } + + // The Analytics flag has not been explicitly set, so update with the value being set. + [[FIRAnalyticsConfiguration sharedInstance] + setAnalyticsCollectionEnabled:automaticDataCollectionEnabled + persistSetting:NO]; +} + +- (BOOL)isAutomaticDataCollectionEnabled { + // Check if it's been manually set before in code, and use that as the higher priority value. + NSNumber *defaultsObject = [[self class] readDataCollectionSwitchFromUserDefaultsForApp:self]; + if (defaultsObject) { + return [defaultsObject boolValue]; + } + + // Read the Info.plist to see if the flag is set. If it's not set, it should default to `YES`. + // As per the implementation of `readDataCollectionSwitchFromPlist`, it's a cached value and has + // no performance impact calling multiple times. + NSNumber *collectionEnabledPlistValue = [[self class] readDataCollectionSwitchFromPlist]; + if (collectionEnabledPlistValue) { + return [collectionEnabledPlistValue boolValue]; + } + + return YES; +} + +#pragma mark - private + ++ (void)sendNotificationsToSDKs:(FIRApp *)app { + NSNumber *isDefaultApp = [NSNumber numberWithBool:(app == sDefaultApp)]; + NSDictionary *appInfoDict = @{ + kFIRAppNameKey : app.name, + kFIRAppIsDefaultAppKey : isDefaultApp, + kFIRGoogleAppIDKey : app.options.googleAppID + }; + [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppReadyToConfigureSDKNotification + object:self + userInfo:appInfoDict]; +} + ++ (NSError *)errorForMissingOptions { + NSDictionary *errorDict = @{ + NSLocalizedDescriptionKey : + @"Unable to parse GoogleService-Info.plist in order to configure services.", + NSLocalizedRecoverySuggestionErrorKey : + @"Check formatting and location of GoogleService-Info.plist." + }; + return [NSError errorWithDomain:kFirebaseCoreErrorDomain + code:FIRErrorCodeInvalidPlistFile + userInfo:errorDict]; +} + ++ (NSError *)errorForSubspecConfigurationFailureWithDomain:(NSString *)domain + errorCode:(FIRErrorCode)code + service:(NSString *)service + reason:(NSString *)reason { + NSString *description = + [NSString stringWithFormat:@"Configuration failed for service %@.", service]; + NSDictionary *errorDict = + @{NSLocalizedDescriptionKey : description, NSLocalizedFailureReasonErrorKey : reason}; + return [NSError errorWithDomain:domain code:code userInfo:errorDict]; +} + ++ (NSError *)errorForInvalidAppID { + NSDictionary *errorDict = @{ + NSLocalizedDescriptionKey : @"Unable to validate Google App ID", + NSLocalizedRecoverySuggestionErrorKey : + @"Check formatting and location of GoogleService-Info.plist or GoogleAppID set in the " + @"customized options." + }; + return [NSError errorWithDomain:kFirebaseCoreErrorDomain + code:FIRErrorCodeInvalidAppID + userInfo:errorDict]; +} + ++ (BOOL)isDefaultAppConfigured { + return (sDefaultApp != nil); +} + ++ (void)registerLibrary:(nonnull NSString *)library withVersion:(nonnull NSString *)version { + // Create the set of characters which aren't allowed, only if this feature is used. + NSMutableCharacterSet *allowedSet = [NSMutableCharacterSet alphanumericCharacterSet]; + [allowedSet addCharactersInString:@"-_."]; + NSCharacterSet *disallowedSet = [allowedSet invertedSet]; + // Make sure the library name and version strings do not contain unexpected characters, and + // add the name/version pair to the dictionary. + if ([library rangeOfCharacterFromSet:disallowedSet].location == NSNotFound && + [version rangeOfCharacterFromSet:disallowedSet].location == NSNotFound) { + if (!sLibraryVersions) { + sLibraryVersions = [[NSMutableDictionary alloc] init]; + } + sLibraryVersions[library] = version; + } else { + FIRLogError(kFIRLoggerCore, @"I-COR000027", + @"The library name (%@) or version number (%@) contain illegal characters. " + @"Only alphanumeric, dash, underscore and period characters are allowed.", + library, version); + } +} + ++ (NSString *)firebaseUserAgent { + NSMutableArray *libraries = + [[NSMutableArray alloc] initWithCapacity:sLibraryVersions.count]; + for (NSString *libraryName in sLibraryVersions) { + [libraries + addObject:[NSString stringWithFormat:@"%@/%@", libraryName, sLibraryVersions[libraryName]]]; + } + [libraries sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; + return [libraries componentsJoinedByString:@" "]; +} + +- (void)checkExpectedBundleID { + NSArray *bundles = [FIRBundleUtil relevantBundles]; + NSString *expectedBundleID = [self expectedBundleID]; + // The checking is only done when the bundle ID is provided in the serviceInfo dictionary for + // backward compatibility. + if (expectedBundleID != nil && + ![FIRBundleUtil hasBundleIdentifier:expectedBundleID inBundles:bundles]) { + FIRLogError(kFIRLoggerCore, @"I-COR000008", + @"The project's Bundle ID is inconsistent with " + @"either the Bundle ID in '%@.%@', or the Bundle ID in the options if you are " + @"using a customized options. To ensure that everything can be configured " + @"correctly, you may need to make the Bundle IDs consistent. To continue with this " + @"plist file, you may change your app's bundle identifier to '%@'. Or you can " + @"download a new configuration file that matches your bundle identifier from %@ " + @"and replace the current one.", + kServiceInfoFileName, kServiceInfoFileType, expectedBundleID, kPlistURL); + } +} + +- (nullable NSString *)getUID { + if (!_getUIDImplementation) { + FIRLogWarning(kFIRLoggerCore, @"I-COR000025", @"FIRAuth getUID implementation wasn't set."); + return nil; + } + return _getUIDImplementation(); +} + +#pragma mark - private - App ID Validation + +/** + * Validates the format and fingerprint of the app ID contained in GOOGLE_APP_ID in the plist file. + * This is the main method for validating app ID. + * + * @return YES if the app ID fulfills the expected format and fingerprint, NO otherwise. + */ +- (BOOL)isAppIDValid { + NSString *appID = _options.googleAppID; + BOOL isValid = [FIRApp validateAppID:appID]; + if (!isValid) { + NSString *expectedBundleID = [self expectedBundleID]; + FIRLogError(kFIRLoggerCore, @"I-COR000009", + @"The GOOGLE_APP_ID either in the plist file " + @"'%@.%@' or the one set in the customized options is invalid. If you are using " + @"the plist file, use the iOS version of bundle identifier to download the file, " + @"and do not manually edit the GOOGLE_APP_ID. You may change your app's bundle " + @"identifier to '%@'. Or you can download a new configuration file that matches " + @"your bundle identifier from %@ and replace the current one.", + kServiceInfoFileName, kServiceInfoFileType, expectedBundleID, kPlistURL); + }; + return isValid; +} + ++ (BOOL)validateAppID:(NSString *)appID { + // Failing validation only occurs when we are sure we are looking at a V2 app ID and it does not + // have a valid fingerprint, otherwise we just warn about the potential issue. + if (!appID.length) { + return NO; + } + + // All app IDs must start with at least ":". + NSString *const versionPattern = @"^\\d+:"; + NSRegularExpression *versionRegex = + [NSRegularExpression regularExpressionWithPattern:versionPattern options:0 error:NULL]; + if (!versionRegex) { + return NO; + } + + NSRange appIDRange = NSMakeRange(0, appID.length); + NSArray *versionMatches = [versionRegex matchesInString:appID options:0 range:appIDRange]; + if (versionMatches.count != 1) { + return NO; + } + + NSRange versionRange = [(NSTextCheckingResult *)versionMatches.firstObject range]; + NSString *appIDVersion = [appID substringWithRange:versionRange]; + NSArray *knownVersions = @[ @"1:" ]; + if (![knownVersions containsObject:appIDVersion]) { + // Permit unknown yet properly formatted app ID versions. + return YES; + } + + if (![FIRApp validateAppIDFormat:appID withVersion:appIDVersion]) { + return NO; + } + + if (![FIRApp validateAppIDFingerprint:appID withVersion:appIDVersion]) { + return NO; + } + + return YES; +} + ++ (NSString *)actualBundleID { + return [[NSBundle mainBundle] bundleIdentifier]; +} + +/** + * Validates that the format of the app ID string is what is expected based on the supplied version. + * The version must end in ":". + * + * For v1 app ids the format is expected to be + * '::ios:'. + * + * This method does not verify that the contents of the app id are correct, just that they fulfill + * the expected format. + * + * @param appID Contents of GOOGLE_APP_ID from the plist file. + * @param version Indicates what version of the app id format this string should be. + * @return YES if provided string fufills the expected format, NO otherwise. + */ ++ (BOOL)validateAppIDFormat:(NSString *)appID withVersion:(NSString *)version { + if (!appID.length || !version.length) { + return NO; + } + + if (![version hasSuffix:@":"]) { + return NO; + } + + if (![appID hasPrefix:version]) { + return NO; + } + + NSString *const pattern = @"^\\d+:ios:[a-f0-9]+$"; + NSRegularExpression *regex = + [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:NULL]; + if (!regex) { + return NO; + } + + NSRange localRange = NSMakeRange(version.length, appID.length - version.length); + NSUInteger numberOfMatches = [regex numberOfMatchesInString:appID options:0 range:localRange]; + if (numberOfMatches != 1) { + return NO; + } + return YES; +} + +/** + * Validates that the fingerprint of the app ID string is what is expected based on the supplied + * version. The version must end in ":". + * + * Note that the v1 hash algorithm is not permitted on the client and cannot be fully validated. + * + * @param appID Contents of GOOGLE_APP_ID from the plist file. + * @param version Indicates what version of the app id format this string should be. + * @return YES if provided string fufills the expected fingerprint and the version is known, NO + * otherwise. + */ ++ (BOOL)validateAppIDFingerprint:(NSString *)appID withVersion:(NSString *)version { + if (!appID.length || !version.length) { + return NO; + } + + if (![version hasSuffix:@":"]) { + return NO; + } + + if (![appID hasPrefix:version]) { + return NO; + } + + // Extract the supplied fingerprint from the supplied app ID. + // This assumes the app ID format is the same for all known versions below. If the app ID format + // changes in future versions, the tokenizing of the app ID format will need to take into account + // the version of the app ID. + NSArray *components = [appID componentsSeparatedByString:@":"]; + if (components.count != 4) { + return NO; + } + + NSString *suppliedFingerprintString = components[3]; + if (!suppliedFingerprintString.length) { + return NO; + } + + uint64_t suppliedFingerprint; + NSScanner *scanner = [NSScanner scannerWithString:suppliedFingerprintString]; + if (![scanner scanHexLongLong:&suppliedFingerprint]) { + return NO; + } + + if ([version isEqual:@"1:"]) { + // The v1 hash algorithm is not permitted on the client so the actual hash cannot be validated. + return YES; + } + + // Unknown version. + return NO; +} + +- (NSString *)expectedBundleID { + return _options.bundleID; +} + +// end App ID validation + +#pragma mark - Reading From Plist & User Defaults + +/** + * Clears the data collection switch from the standard NSUserDefaults for easier testing and + * readability. + */ +- (void)clearDataCollectionSwitchFromUserDefaults { + NSString *key = + [NSString stringWithFormat:kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat, self.name]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]; +} + +/** + * Reads the data collection switch from the standard NSUserDefaults for easier testing and + * readability. + */ ++ (nullable NSNumber *)readDataCollectionSwitchFromUserDefaultsForApp:(FIRApp *)app { + // Read the object in user defaults, and only return if it's an NSNumber. + NSString *key = + [NSString stringWithFormat:kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat, app.name]; + id collectionEnabledDefaultsObject = [[NSUserDefaults standardUserDefaults] objectForKey:key]; + if ([collectionEnabledDefaultsObject isKindOfClass:[NSNumber class]]) { + return collectionEnabledDefaultsObject; + } + + return nil; +} + +/** + * Reads the data collection switch from the Info.plist for easier testing and readability. Will + * only read once from the plist and return the cached value. + */ ++ (nullable NSNumber *)readDataCollectionSwitchFromPlist { + static NSNumber *collectionEnabledPlistObject; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + // Read the data from the `Info.plist`, only assign it if it's there and an NSNumber. + id plistValue = [[NSBundle mainBundle] + objectForInfoDictionaryKey:kFIRGlobalAppDataCollectionEnabledPlistKey]; + if (plistValue && [plistValue isKindOfClass:[NSNumber class]]) { + collectionEnabledPlistObject = (NSNumber *)plistValue; + } + }); + + return collectionEnabledPlistObject; +} + +#pragma mark - Sending Logs + +- (void)sendLogsWithServiceName:(NSString *)serviceName + version:(NSString *)version + error:(NSError *)error { + // If the user has manually turned off data collection, return and don't send logs. + if (![self isAutomaticDataCollectionEnabled]) { + return; + } + + NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] initWithDictionary:@{ + kFIRAppDiagnosticsConfigurationTypeKey : @(FIRConfigTypeSDK), + kFIRAppDiagnosticsSDKNameKey : serviceName, + kFIRAppDiagnosticsSDKVersionKey : version, + kFIRAppDiagnosticsFIRAppKey : self + }]; + if (error) { + userInfo[kFIRAppDiagnosticsErrorKey] = error; + } + [[NSNotificationCenter defaultCenter] postNotificationName:kFIRAppDiagnosticsNotification + object:nil + userInfo:userInfo]; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRAppAssociationRegistration.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRAppAssociationRegistration.m new file mode 100644 index 0000000..2aecdab --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRAppAssociationRegistration.m @@ -0,0 +1,47 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRAppAssociationRegistration.h" + +#import + +@implementation FIRAppAssociationRegistration + ++ (nullable id)registeredObjectWithHost:(id)host + key:(NSString *)key + creationBlock:(id _Nullable (^)(void))creationBlock { + @synchronized(self) { + SEL dictKey = @selector(registeredObjectWithHost:key:creationBlock:); + NSMutableDictionary *objectsByKey = objc_getAssociatedObject(host, dictKey); + if (!objectsByKey) { + objectsByKey = [[NSMutableDictionary alloc] init]; + objc_setAssociatedObject(host, dictKey, objectsByKey, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + id obj = objectsByKey[key]; + NSValue *creationBlockBeingCalled = [NSValue valueWithPointer:dictKey]; + if (obj) { + if ([creationBlockBeingCalled isEqual:obj]) { + [NSException raise:@"Reentering registeredObjectWithHost:key:creationBlock: not allowed" + format:@"host: %@ key: %@", host, key]; + } + return obj; + } + objectsByKey[key] = creationBlockBeingCalled; + obj = creationBlock(); + objectsByKey[key] = obj; + return obj; + } +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRBundleUtil.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRBundleUtil.m new file mode 100644 index 0000000..93ee02e --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRBundleUtil.m @@ -0,0 +1,57 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRBundleUtil.h" + +@implementation FIRBundleUtil + ++ (NSArray *)relevantBundles { + return @[ [NSBundle mainBundle], [NSBundle bundleForClass:[self class]] ]; +} + ++ (NSString *)optionsDictionaryPathWithResourceName:(NSString *)resourceName + andFileType:(NSString *)fileType + inBundles:(NSArray *)bundles { + // Loop through all bundles to find the config dict. + for (NSBundle *bundle in bundles) { + NSString *path = [bundle pathForResource:resourceName ofType:fileType]; + // Use the first one we find. + if (path) { + return path; + } + } + return nil; +} + ++ (NSArray *)relevantURLSchemes { + NSMutableArray *result = [[NSMutableArray alloc] init]; + for (NSBundle *bundle in [[self class] relevantBundles]) { + NSArray *urlTypes = [bundle objectForInfoDictionaryKey:@"CFBundleURLTypes"]; + for (NSDictionary *urlType in urlTypes) { + [result addObjectsFromArray:urlType[@"CFBundleURLSchemes"]]; + } + } + return result; +} + ++ (BOOL)hasBundleIdentifier:(NSString *)bundleIdentifier inBundles:(NSArray *)bundles { + for (NSBundle *bundle in bundles) { + if ([bundle.bundleIdentifier isEqualToString:bundleIdentifier]) { + return YES; + } + } + return NO; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRConfiguration.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRConfiguration.m new file mode 100644 index 0000000..cd64862 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRConfiguration.m @@ -0,0 +1,44 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "FIRConfiguration.h" + +extern void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel); + +@implementation FIRConfiguration + ++ (instancetype)sharedInstance { + static FIRConfiguration *sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedInstance = [[FIRConfiguration alloc] init]; + }); + return sharedInstance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _analyticsConfiguration = [FIRAnalyticsConfiguration sharedInstance]; + } + return self; +} + +- (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel { + NSAssert(loggerLevel <= FIRLoggerLevelMax && loggerLevel >= FIRLoggerLevelMin, + @"Invalid logger level, %ld", (long)loggerLevel); + FIRSetLoggerLevel(loggerLevel); +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRErrors.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRErrors.m new file mode 100644 index 0000000..6d6d52d --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRErrors.m @@ -0,0 +1,29 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRErrors.h" + +NSString *const kFirebaseErrorDomain = @"com.firebase"; +NSString *const kFirebaseAdMobErrorDomain = @"com.firebase.admob"; +NSString *const kFirebaseAppInviteErrorDomain = @"com.firebase.appinvite"; +NSString *const kFirebaseAuthErrorDomain = @"com.firebase.auth"; +NSString *const kFirebaseCloudMessagingErrorDomain = @"com.firebase.cloudmessaging"; +NSString *const kFirebaseConfigErrorDomain = @"com.firebase.config"; +NSString *const kFirebaseCoreErrorDomain = @"com.firebase.core"; +NSString *const kFirebaseCrashReportingErrorDomain = @"com.firebase.crashreporting"; +NSString *const kFirebaseDatabaseErrorDomain = @"com.firebase.database"; +NSString *const kFirebaseDurableDeepLinkErrorDomain = @"com.firebase.durabledeeplink"; +NSString *const kFirebaseInstanceIDErrorDomain = @"com.firebase.instanceid"; +NSString *const kFirebasePerfErrorDomain = @"com.firebase.perf"; +NSString *const kFirebaseStorageErrorDomain = @"com.firebase.storage"; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRLogger.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRLogger.m new file mode 100644 index 0000000..03f8a79 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRLogger.m @@ -0,0 +1,282 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRLogger.h" + +#import "FIRLoggerLevel.h" +#import "Private/FIRVersion.h" +#import "third_party/FIRAppEnvironmentUtil.h" + +#include +#include +#include +#include +#include +#include + +FIRLoggerService kFIRLoggerABTesting = @"[Firebase/ABTesting]"; +FIRLoggerService kFIRLoggerAdMob = @"[Firebase/AdMob]"; +FIRLoggerService kFIRLoggerAnalytics = @"[Firebase/Analytics]"; +FIRLoggerService kFIRLoggerAuth = @"[Firebase/Auth]"; +FIRLoggerService kFIRLoggerCore = @"[Firebase/Core]"; +FIRLoggerService kFIRLoggerCrash = @"[Firebase/Crash]"; +FIRLoggerService kFIRLoggerDatabase = @"[Firebase/Database]"; +FIRLoggerService kFIRLoggerDynamicLinks = @"[Firebase/DynamicLinks]"; +FIRLoggerService kFIRLoggerFirestore = @"[Firebase/Firestore]"; +FIRLoggerService kFIRLoggerInstanceID = @"[Firebase/InstanceID]"; +FIRLoggerService kFIRLoggerInvites = @"[Firebase/Invites]"; +FIRLoggerService kFIRLoggerMLKit = @"[Firebase/MLKit]"; +FIRLoggerService kFIRLoggerMessaging = @"[Firebase/Messaging]"; +FIRLoggerService kFIRLoggerPerf = @"[Firebase/Performance]"; +FIRLoggerService kFIRLoggerRemoteConfig = @"[Firebase/RemoteConfig]"; +FIRLoggerService kFIRLoggerStorage = @"[Firebase/Storage]"; +FIRLoggerService kFIRLoggerSwizzler = @"[FirebaseSwizzlingUtilities]"; + +/// Arguments passed on launch. +NSString *const kFIRDisableDebugModeApplicationArgument = @"-FIRDebugDisabled"; +NSString *const kFIREnableDebugModeApplicationArgument = @"-FIRDebugEnabled"; +NSString *const kFIRLoggerForceSDTERRApplicationArgument = @"-FIRLoggerForceSTDERR"; + +/// Key for the debug mode bit in NSUserDefaults. +NSString *const kFIRPersistedDebugModeKey = @"/google/firebase/debug_mode"; + +/// ASL client facility name used by FIRLogger. +const char *kFIRLoggerASLClientFacilityName = "com.firebase.app.logger"; + +/// Message format used by ASL client that matches format of NSLog. +const char *kFIRLoggerCustomASLMessageFormat = + "$((Time)(J.3)) $(Sender)[$(PID)] <$((Level)(str))> $Message"; + +/// Keys for the number of errors and warnings logged. +NSString *const kFIRLoggerErrorCountKey = @"/google/firebase/count_of_errors_logged"; +NSString *const kFIRLoggerWarningCountKey = @"/google/firebase/count_of_warnings_logged"; + +static dispatch_once_t sFIRLoggerOnceToken; + +static aslclient sFIRLoggerClient; + +static dispatch_queue_t sFIRClientQueue; + +static BOOL sFIRLoggerDebugMode; + +// The sFIRAnalyticsDebugMode flag is here to support the -FIRDebugEnabled/-FIRDebugDisabled +// flags used by Analytics. Users who use those flags expect Analytics to log verbosely, +// while the rest of Firebase logs at the default level. This flag is introduced to support +// that behavior. +static BOOL sFIRAnalyticsDebugMode; + +static FIRLoggerLevel sFIRLoggerMaximumLevel; + +#ifdef DEBUG +/// The regex pattern for the message code. +static NSString *const kMessageCodePattern = @"^I-[A-Z]{3}[0-9]{6}$"; +static NSRegularExpression *sMessageCodeRegex; +#endif + +void FIRLoggerInitializeASL() { + dispatch_once(&sFIRLoggerOnceToken, ^{ + NSInteger majorOSVersion = [[FIRAppEnvironmentUtil systemVersion] integerValue]; + uint32_t aslOptions = ASL_OPT_STDERR; +#if TARGET_OS_SIMULATOR + // The iOS 11 simulator doesn't need the ASL_OPT_STDERR flag. + if (majorOSVersion >= 11) { + aslOptions = 0; + } +#else + // Devices running iOS 10 or higher don't need the ASL_OPT_STDERR flag. + if (majorOSVersion >= 10) { + aslOptions = 0; + } +#endif // TARGET_OS_SIMULATOR + + // Override the aslOptions to ASL_OPT_STDERR if the override argument is passed in. + NSArray *arguments = [NSProcessInfo processInfo].arguments; + if ([arguments containsObject:kFIRLoggerForceSDTERRApplicationArgument]) { + aslOptions = ASL_OPT_STDERR; + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" // asl is deprecated + // Initialize the ASL client handle. + sFIRLoggerClient = asl_open(NULL, kFIRLoggerASLClientFacilityName, aslOptions); + + // Set the filter used by system/device log. Initialize in default mode. + asl_set_filter(sFIRLoggerClient, ASL_FILTER_MASK_UPTO(ASL_LEVEL_NOTICE)); + sFIRLoggerDebugMode = NO; + sFIRAnalyticsDebugMode = NO; + sFIRLoggerMaximumLevel = FIRLoggerLevelNotice; + + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + BOOL debugMode = [userDefaults boolForKey:kFIRPersistedDebugModeKey]; + + if ([arguments containsObject:kFIRDisableDebugModeApplicationArgument]) { // Default mode + [userDefaults removeObjectForKey:kFIRPersistedDebugModeKey]; + } else if ([arguments containsObject:kFIREnableDebugModeApplicationArgument] || + debugMode) { // Debug mode + [userDefaults setBool:YES forKey:kFIRPersistedDebugModeKey]; + asl_set_filter(sFIRLoggerClient, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG)); + sFIRLoggerDebugMode = YES; + } + + // We should disable debug mode if we are running from App Store. + if (sFIRLoggerDebugMode && [FIRAppEnvironmentUtil isFromAppStore]) { + sFIRLoggerDebugMode = NO; + } + + sFIRClientQueue = dispatch_queue_create("FIRLoggingClientQueue", DISPATCH_QUEUE_SERIAL); + dispatch_set_target_queue(sFIRClientQueue, + dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)); + +#ifdef DEBUG + sMessageCodeRegex = + [NSRegularExpression regularExpressionWithPattern:kMessageCodePattern options:0 error:NULL]; +#endif + }); +} + +void FIRSetAnalyticsDebugMode(BOOL analyticsDebugMode) { + FIRLoggerInitializeASL(); + dispatch_async(sFIRClientQueue, ^{ + // We should not enable debug mode if we are running from App Store. + if (analyticsDebugMode && [FIRAppEnvironmentUtil isFromAppStore]) { + return; + } + sFIRAnalyticsDebugMode = analyticsDebugMode; + asl_set_filter(sFIRLoggerClient, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG)); + }); +} + +void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel) { + if (loggerLevel < FIRLoggerLevelMin || loggerLevel > FIRLoggerLevelMax) { + FIRLogError(kFIRLoggerCore, @"I-COR000023", @"Invalid logger level, %ld", (long)loggerLevel); + return; + } + FIRLoggerInitializeASL(); + // We should not raise the logger level if we are running from App Store. + if (loggerLevel >= FIRLoggerLevelNotice && [FIRAppEnvironmentUtil isFromAppStore]) { + return; + } + + sFIRLoggerMaximumLevel = loggerLevel; + dispatch_async(sFIRClientQueue, ^{ + asl_set_filter(sFIRLoggerClient, ASL_FILTER_MASK_UPTO(loggerLevel)); + }); +} + +/** + * Check if the level is high enough to be loggable. + * + * Analytics can override the log level with an intentional race condition. + * Add the attribute to get a clean thread sanitizer run. + */ +__attribute__((no_sanitize("thread"))) BOOL FIRIsLoggableLevel(FIRLoggerLevel loggerLevel, + BOOL analyticsComponent) { + FIRLoggerInitializeASL(); + if (sFIRLoggerDebugMode) { + return YES; + } else if (sFIRAnalyticsDebugMode && analyticsComponent) { + return YES; + } + return (BOOL)(loggerLevel <= sFIRLoggerMaximumLevel); +} + +#ifdef DEBUG +void FIRResetLogger() { + sFIRLoggerOnceToken = 0; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:kFIRPersistedDebugModeKey]; +} + +aslclient getFIRLoggerClient() { + return sFIRLoggerClient; +} + +dispatch_queue_t getFIRClientQueue() { + return sFIRClientQueue; +} + +BOOL getFIRLoggerDebugMode() { + return sFIRLoggerDebugMode; +} +#endif + +void FIRLogBasic(FIRLoggerLevel level, + FIRLoggerService service, + NSString *messageCode, + NSString *message, + va_list args_ptr) { + FIRLoggerInitializeASL(); + BOOL canLog = level <= sFIRLoggerMaximumLevel; + + if (sFIRLoggerDebugMode) { + canLog = YES; + } else if (sFIRAnalyticsDebugMode && [kFIRLoggerAnalytics isEqualToString:service]) { + canLog = YES; + } + + if (!canLog) { + return; + } +#ifdef DEBUG + NSCAssert(messageCode.length == 11, @"Incorrect message code length."); + NSRange messageCodeRange = NSMakeRange(0, messageCode.length); + NSUInteger numberOfMatches = + [sMessageCodeRegex numberOfMatchesInString:messageCode options:0 range:messageCodeRange]; + NSCAssert(numberOfMatches == 1, @"Incorrect message code format."); +#endif + NSString *logMsg = [[NSString alloc] initWithFormat:message arguments:args_ptr]; + logMsg = + [NSString stringWithFormat:@"%s - %@[%@] %@", FIRVersionString, service, messageCode, logMsg]; + dispatch_async(sFIRClientQueue, ^{ + asl_log(sFIRLoggerClient, NULL, level, "%s", logMsg.UTF8String); + }); +} +#pragma clang diagnostic pop + +/** + * Generates the logging functions using macros. + * + * Calling FIRLogError(kFIRLoggerCore, @"I-COR000001", @"Configure %@ failed.", @"blah") shows: + * yyyy-mm-dd hh:mm:ss.SSS sender[PID] [Firebase/Core][I-COR000001] Configure blah failed. + * Calling FIRLogDebug(kFIRLoggerCore, @"I-COR000001", @"Configure succeed.") shows: + * yyyy-mm-dd hh:mm:ss.SSS sender[PID] [Firebase/Core][I-COR000001] Configure succeed. + */ +#define FIR_LOGGING_FUNCTION(level) \ + void FIRLog##level(FIRLoggerService service, NSString *messageCode, NSString *message, ...) { \ + va_list args_ptr; \ + va_start(args_ptr, message); \ + FIRLogBasic(FIRLoggerLevel##level, service, messageCode, message, args_ptr); \ + va_end(args_ptr); \ + } + +FIR_LOGGING_FUNCTION(Error) +FIR_LOGGING_FUNCTION(Warning) +FIR_LOGGING_FUNCTION(Notice) +FIR_LOGGING_FUNCTION(Info) +FIR_LOGGING_FUNCTION(Debug) + +#undef FIR_MAKE_LOGGER + +#pragma mark - FIRLoggerWrapper + +@implementation FIRLoggerWrapper + ++ (void)logWithLevel:(FIRLoggerLevel)level + withService:(FIRLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args { + FIRLogBasic(level, service, messageCode, message, args); +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRMutableDictionary.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRMutableDictionary.m new file mode 100644 index 0000000..31941bc --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRMutableDictionary.m @@ -0,0 +1,97 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRMutableDictionary.h" + +@implementation FIRMutableDictionary { + /// The mutable dictionary. + NSMutableDictionary *_objects; + + /// Serial synchronization queue. All reads should use dispatch_sync, while writes use + /// dispatch_async. + dispatch_queue_t _queue; +} + +- (instancetype)init { + self = [super init]; + + if (self) { + _objects = [[NSMutableDictionary alloc] init]; + _queue = dispatch_queue_create("FIRMutableDictionary", DISPATCH_QUEUE_SERIAL); + } + + return self; +} + +- (NSString *)description { + __block NSString *description; + dispatch_sync(_queue, ^{ + description = self->_objects.description; + }); + return description; +} + +- (id)objectForKey:(id)key { + __block id object; + dispatch_sync(_queue, ^{ + object = self->_objects[key]; + }); + return object; +} + +- (void)setObject:(id)object forKey:(id)key { + dispatch_async(_queue, ^{ + self->_objects[key] = object; + }); +} + +- (void)removeObjectForKey:(id)key { + dispatch_async(_queue, ^{ + [self->_objects removeObjectForKey:key]; + }); +} + +- (void)removeAllObjects { + dispatch_async(_queue, ^{ + [self->_objects removeAllObjects]; + }); +} + +- (NSUInteger)count { + __block NSUInteger count; + dispatch_sync(_queue, ^{ + count = self->_objects.count; + }); + return count; +} + +- (id)objectForKeyedSubscript:(id)key { + // The method this calls is already synchronized. + return [self objectForKey:key]; +} + +- (void)setObject:(id)obj forKeyedSubscript:(id)key { + // The method this calls is already synchronized. + [self setObject:obj forKey:key]; +} + +- (NSDictionary *)dictionary { + __block NSDictionary *dictionary; + dispatch_sync(_queue, ^{ + dictionary = [self->_objects copy]; + }); + return dictionary; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetwork.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetwork.m new file mode 100644 index 0000000..ff292fc --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetwork.m @@ -0,0 +1,390 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRNetwork.h" +#import "Private/FIRNetworkMessageCode.h" + +#import "Private/FIRLogger.h" +#import "Private/FIRMutableDictionary.h" +#import "Private/FIRNetworkConstants.h" +#import "Private/FIRReachabilityChecker.h" + +#import + +/// Constant string for request header Content-Encoding. +static NSString *const kFIRNetworkContentCompressionKey = @"Content-Encoding"; + +/// Constant string for request header Content-Encoding value. +static NSString *const kFIRNetworkContentCompressionValue = @"gzip"; + +/// Constant string for request header Content-Length. +static NSString *const kFIRNetworkContentLengthKey = @"Content-Length"; + +/// Constant string for request header Content-Type. +static NSString *const kFIRNetworkContentTypeKey = @"Content-Type"; + +/// Constant string for request header Content-Type value. +static NSString *const kFIRNetworkContentTypeValue = @"application/x-www-form-urlencoded"; + +/// Constant string for GET request method. +static NSString *const kFIRNetworkGETRequestMethod = @"GET"; + +/// Constant string for POST request method. +static NSString *const kFIRNetworkPOSTRequestMethod = @"POST"; + +/// Default constant string as a prefix for network logger. +static NSString *const kFIRNetworkLogTag = @"Firebase/Network"; + +@interface FIRNetwork () +@end + +@implementation FIRNetwork { + /// Network reachability. + FIRReachabilityChecker *_reachability; + + /// The dictionary of requests by session IDs { NSString : id }. + FIRMutableDictionary *_requests; +} + +- (instancetype)init { + return [self initWithReachabilityHost:kFIRNetworkReachabilityHost]; +} + +- (instancetype)initWithReachabilityHost:(NSString *)reachabilityHost { + self = [super init]; + if (self) { + // Setup reachability. + _reachability = [[FIRReachabilityChecker alloc] initWithReachabilityDelegate:self + loggerDelegate:self + withHost:reachabilityHost]; + if (![_reachability start]) { + return nil; + } + + _requests = [[FIRMutableDictionary alloc] init]; + _timeoutInterval = kFIRNetworkTimeOutInterval; + } + return self; +} + +- (void)dealloc { + _reachability.reachabilityDelegate = nil; + [_reachability stop]; +} + +#pragma mark - External Methods + ++ (void)handleEventsForBackgroundURLSessionID:(NSString *)sessionID + completionHandler:(FIRNetworkSystemCompletionHandler)completionHandler { + [FIRNetworkURLSession handleEventsForBackgroundURLSessionID:sessionID + completionHandler:completionHandler]; +} + +- (NSString *)postURL:(NSURL *)url + payload:(NSData *)payload + queue:(dispatch_queue_t)queue + usingBackgroundSession:(BOOL)usingBackgroundSession + completionHandler:(FIRNetworkCompletionHandler)handler { + if (!url.absoluteString.length) { + [self handleErrorWithCode:FIRErrorCodeNetworkInvalidURL queue:queue withHandler:handler]; + return nil; + } + + NSTimeInterval timeOutInterval = _timeoutInterval ?: kFIRNetworkTimeOutInterval; + + NSMutableURLRequest *request = + [[NSMutableURLRequest alloc] initWithURL:url + cachePolicy:NSURLRequestReloadIgnoringLocalCacheData + timeoutInterval:timeOutInterval]; + + if (!request) { + [self handleErrorWithCode:FIRErrorCodeNetworkSessionTaskCreation + queue:queue + withHandler:handler]; + return nil; + } + + NSError *compressError = nil; + NSData *compressedData = [NSData gtm_dataByGzippingData:payload error:&compressError]; + if (!compressedData || compressError) { + if (compressError || payload.length > 0) { + // If the payload is not empty but it fails to compress the payload, something has been wrong. + [self handleErrorWithCode:FIRErrorCodeNetworkPayloadCompression + queue:queue + withHandler:handler]; + return nil; + } + compressedData = [[NSData alloc] init]; + } + + NSString *postLength = @(compressedData.length).stringValue; + + // Set up the request with the compressed data. + [request setValue:postLength forHTTPHeaderField:kFIRNetworkContentLengthKey]; + request.HTTPBody = compressedData; + request.HTTPMethod = kFIRNetworkPOSTRequestMethod; + [request setValue:kFIRNetworkContentTypeValue forHTTPHeaderField:kFIRNetworkContentTypeKey]; + [request setValue:kFIRNetworkContentCompressionValue + forHTTPHeaderField:kFIRNetworkContentCompressionKey]; + + FIRNetworkURLSession *fetcher = [[FIRNetworkURLSession alloc] initWithNetworkLoggerDelegate:self]; + fetcher.backgroundNetworkEnabled = usingBackgroundSession; + + __weak FIRNetwork *weakSelf = self; + NSString *requestID = [fetcher + sessionIDFromAsyncPOSTRequest:request + completionHandler:^(NSHTTPURLResponse *response, NSData *data, + NSString *sessionID, NSError *error) { + FIRNetwork *strongSelf = weakSelf; + if (!strongSelf) { + return; + } + dispatch_queue_t queueToDispatch = queue ? queue : dispatch_get_main_queue(); + dispatch_async(queueToDispatch, ^{ + if (sessionID.length) { + [strongSelf->_requests removeObjectForKey:sessionID]; + } + if (handler) { + handler(response, data, error); + } + }); + }]; + if (!requestID) { + [self handleErrorWithCode:FIRErrorCodeNetworkSessionTaskCreation + queue:queue + withHandler:handler]; + return nil; + } + + [self firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeNetwork000 + message:@"Uploading data. Host" + context:url]; + _requests[requestID] = fetcher; + return requestID; +} + +- (NSString *)getURL:(NSURL *)url + headers:(NSDictionary *)headers + queue:(dispatch_queue_t)queue + usingBackgroundSession:(BOOL)usingBackgroundSession + completionHandler:(FIRNetworkCompletionHandler)handler { + if (!url.absoluteString.length) { + [self handleErrorWithCode:FIRErrorCodeNetworkInvalidURL queue:queue withHandler:handler]; + return nil; + } + + NSTimeInterval timeOutInterval = _timeoutInterval ?: kFIRNetworkTimeOutInterval; + NSMutableURLRequest *request = + [[NSMutableURLRequest alloc] initWithURL:url + cachePolicy:NSURLRequestReloadIgnoringLocalCacheData + timeoutInterval:timeOutInterval]; + + if (!request) { + [self handleErrorWithCode:FIRErrorCodeNetworkSessionTaskCreation + queue:queue + withHandler:handler]; + return nil; + } + + request.HTTPMethod = kFIRNetworkGETRequestMethod; + request.allHTTPHeaderFields = headers; + + FIRNetworkURLSession *fetcher = [[FIRNetworkURLSession alloc] initWithNetworkLoggerDelegate:self]; + fetcher.backgroundNetworkEnabled = usingBackgroundSession; + + __weak FIRNetwork *weakSelf = self; + NSString *requestID = [fetcher + sessionIDFromAsyncGETRequest:request + completionHandler:^(NSHTTPURLResponse *response, NSData *data, NSString *sessionID, + NSError *error) { + FIRNetwork *strongSelf = weakSelf; + if (!strongSelf) { + return; + } + dispatch_queue_t queueToDispatch = queue ? queue : dispatch_get_main_queue(); + dispatch_async(queueToDispatch, ^{ + if (sessionID.length) { + [strongSelf->_requests removeObjectForKey:sessionID]; + } + if (handler) { + handler(response, data, error); + } + }); + }]; + + if (!requestID) { + [self handleErrorWithCode:FIRErrorCodeNetworkSessionTaskCreation + queue:queue + withHandler:handler]; + return nil; + } + + [self firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeNetwork001 + message:@"Downloading data. Host" + context:url]; + _requests[requestID] = fetcher; + return requestID; +} + +- (BOOL)hasUploadInProgress { + return _requests.count > 0; +} + +#pragma mark - Network Reachability + +/// Tells reachability delegate to call reachabilityDidChangeToStatus: to notify the network +/// reachability has changed. +- (void)reachability:(FIRReachabilityChecker *)reachability + statusChanged:(FIRReachabilityStatus)status { + _networkConnected = (status == kFIRReachabilityViaCellular || status == kFIRReachabilityViaWifi); + [_reachabilityDelegate reachabilityDidChange]; +} + +#pragma mark - Network logger delegate + +- (void)setLoggerDelegate:(id)loggerDelegate { + // Explicitly check whether the delegate responds to the methods because conformsToProtocol does + // not work correctly even though the delegate does respond to the methods. + if (!loggerDelegate || + ![loggerDelegate + respondsToSelector:@selector(firNetwork_logWithLevel:messageCode:message:contexts:)] || + ![loggerDelegate + respondsToSelector:@selector(firNetwork_logWithLevel:messageCode:message:context:)] || + ! + [loggerDelegate respondsToSelector:@selector(firNetwork_logWithLevel:messageCode:message:)]) { + FIRLogError(kFIRLoggerAnalytics, + [NSString stringWithFormat:@"I-NET%06ld", (long)kFIRNetworkMessageCodeNetwork002], + @"Cannot set the network logger delegate: delegate does not conform to the network " + "logger protocol."); + return; + } + _loggerDelegate = loggerDelegate; +} + +#pragma mark - Private methods + +/// Handles network error and calls completion handler with the error. +- (void)handleErrorWithCode:(NSInteger)code + queue:(dispatch_queue_t)queue + withHandler:(FIRNetworkCompletionHandler)handler { + NSDictionary *userInfo = @{kFIRNetworkErrorContext : @"Failed to create network request"}; + NSError *error = + [[NSError alloc] initWithDomain:kFIRNetworkErrorDomain code:code userInfo:userInfo]; + [self firNetwork_logWithLevel:kFIRNetworkLogLevelWarning + messageCode:kFIRNetworkMessageCodeNetwork002 + message:@"Failed to create network request. Code, error" + contexts:@[ @(code), error ]]; + if (handler) { + dispatch_queue_t queueToDispatch = queue ? queue : dispatch_get_main_queue(); + dispatch_async(queueToDispatch, ^{ + handler(nil, nil, error); + }); + } +} + +#pragma mark - Network logger + +- (void)firNetwork_logWithLevel:(FIRNetworkLogLevel)logLevel + messageCode:(FIRNetworkMessageCode)messageCode + message:(NSString *)message + contexts:(NSArray *)contexts { + // Let the delegate log the message if there is a valid logger delegate. Otherwise, just log + // errors/warnings/info messages to the console log. + if (_loggerDelegate) { + [_loggerDelegate firNetwork_logWithLevel:logLevel + messageCode:messageCode + message:message + contexts:contexts]; + return; + } + if (_isDebugModeEnabled || logLevel == kFIRNetworkLogLevelError || + logLevel == kFIRNetworkLogLevelWarning || logLevel == kFIRNetworkLogLevelInfo) { + NSString *formattedMessage = FIRStringWithLogMessage(message, logLevel, contexts); + NSLog(@"%@", formattedMessage); + FIRLogBasic((FIRLoggerLevel)logLevel, kFIRLoggerCore, + [NSString stringWithFormat:@"I-NET%06ld", (long)messageCode], formattedMessage, + NULL); + } +} + +- (void)firNetwork_logWithLevel:(FIRNetworkLogLevel)logLevel + messageCode:(FIRNetworkMessageCode)messageCode + message:(NSString *)message + context:(id)context { + if (_loggerDelegate) { + [_loggerDelegate firNetwork_logWithLevel:logLevel + messageCode:messageCode + message:message + context:context]; + return; + } + NSArray *contexts = context ? @[ context ] : @[]; + [self firNetwork_logWithLevel:logLevel messageCode:messageCode message:message contexts:contexts]; +} + +- (void)firNetwork_logWithLevel:(FIRNetworkLogLevel)logLevel + messageCode:(FIRNetworkMessageCode)messageCode + message:(NSString *)message { + if (_loggerDelegate) { + [_loggerDelegate firNetwork_logWithLevel:logLevel messageCode:messageCode message:message]; + return; + } + [self firNetwork_logWithLevel:logLevel messageCode:messageCode message:message contexts:@[]]; +} + +/// Returns a string for the given log level (e.g. kFIRNetworkLogLevelError -> @"ERROR"). +static NSString *FIRLogLevelDescriptionFromLogLevel(FIRNetworkLogLevel logLevel) { + static NSDictionary *levelNames = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + levelNames = @{ + @(kFIRNetworkLogLevelError) : @"ERROR", + @(kFIRNetworkLogLevelWarning) : @"WARNING", + @(kFIRNetworkLogLevelInfo) : @"INFO", + @(kFIRNetworkLogLevelDebug) : @"DEBUG" + }; + }); + return levelNames[@(logLevel)]; +} + +/// Returns a formatted string to be used for console logging. +static NSString *FIRStringWithLogMessage(NSString *message, + FIRNetworkLogLevel logLevel, + NSArray *contexts) { + if (!message) { + message = @"(Message was nil)"; + } else if (!message.length) { + message = @"(Message was empty)"; + } + NSMutableString *result = [[NSMutableString alloc] + initWithFormat:@"<%@/%@> %@", kFIRNetworkLogTag, FIRLogLevelDescriptionFromLogLevel(logLevel), + message]; + + if (!contexts.count) { + return result; + } + + NSMutableArray *formattedContexts = [[NSMutableArray alloc] init]; + for (id item in contexts) { + [formattedContexts addObject:(item != [NSNull null] ? item : @"(nil)")]; + } + + [result appendString:@": "]; + [result appendString:[formattedContexts componentsJoinedByString:@", "]]; + return result; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetworkConstants.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetworkConstants.m new file mode 100644 index 0000000..c958201 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetworkConstants.m @@ -0,0 +1,39 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRNetworkConstants.h" + +#import + +NSString *const kFIRNetworkBackgroundSessionConfigIDPrefix = + @"com.firebase.network.background-upload"; +NSString *const kFIRNetworkApplicationSupportSubdirectory = @"Firebase/Network"; +NSString *const kFIRNetworkTempDirectoryName = @"FIRNetworkTemporaryDirectory"; +const NSTimeInterval kFIRNetworkTempFolderExpireTime = 60 * 60; // 1 hour +const NSTimeInterval kFIRNetworkTimeOutInterval = 60; // 1 minute. +NSString *const kFIRNetworkReachabilityHost = @"app-measurement.com"; +NSString *const kFIRNetworkErrorContext = @"Context"; + +const int kFIRNetworkHTTPStatusOK = 200; +const int kFIRNetworkHTTPStatusNoContent = 204; +const int kFIRNetworkHTTPStatusCodeMultipleChoices = 300; +const int kFIRNetworkHTTPStatusCodeMovedPermanently = 301; +const int kFIRNetworkHTTPStatusCodeFound = 302; +const int kFIRNetworkHTTPStatusCodeNotModified = 304; +const int kFIRNetworkHTTPStatusCodeMovedTemporarily = 307; +const int kFIRNetworkHTTPStatusCodeNotFound = 404; +const int kFIRNetworkHTTPStatusCodeCannotAcceptTraffic = 429; +const int kFIRNetworkHTTPStatusCodeUnavailable = 503; + +NSString *const kFIRNetworkErrorDomain = @"com.firebase.network.ErrorDomain"; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetworkURLSession.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetworkURLSession.m new file mode 100644 index 0000000..470d3e9 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRNetworkURLSession.m @@ -0,0 +1,669 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +#import "Private/FIRNetworkURLSession.h" + +#import "Private/FIRLogger.h" +#import "Private/FIRMutableDictionary.h" +#import "Private/FIRNetworkConstants.h" +#import "Private/FIRNetworkMessageCode.h" + +@implementation FIRNetworkURLSession { + /// The handler to be called when the request completes or error has occurs. + FIRNetworkURLSessionCompletionHandler _completionHandler; + + /// Session ID generated randomly with a fixed prefix. + NSString *_sessionID; + + /// The session configuration. + NSURLSessionConfiguration *_sessionConfig; + + /// The path to the directory where all temporary files are stored before uploading. + NSURL *_networkDirectoryURL; + + /// The downloaded data from fetching. + NSData *_downloadedData; + + /// The path to the temporary file which stores the uploading data. + NSURL *_uploadingFileURL; + + /// The current request. + NSURLRequest *_request; +} + +#pragma mark - Init + +- (instancetype)initWithNetworkLoggerDelegate:(id)networkLoggerDelegate { + self = [super init]; + if (self) { + // Create URL to the directory where all temporary files to upload have to be stored. + NSArray *paths = + NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); + NSString *applicationSupportDirectory = paths.firstObject; + NSArray *tempPathComponents = @[ + applicationSupportDirectory, kFIRNetworkApplicationSupportSubdirectory, + kFIRNetworkTempDirectoryName + ]; + _networkDirectoryURL = [NSURL fileURLWithPathComponents:tempPathComponents]; + _sessionID = [NSString stringWithFormat:@"%@-%@", kFIRNetworkBackgroundSessionConfigIDPrefix, + [[NSUUID UUID] UUIDString]]; + _loggerDelegate = networkLoggerDelegate; + } + return self; +} + +#pragma mark - External Methods + +#pragma mark - To be called from AppDelegate + ++ (void)handleEventsForBackgroundURLSessionID:(NSString *)sessionID + completionHandler: + (FIRNetworkSystemCompletionHandler)systemCompletionHandler { + // The session may not be FIRAnalytics background. Ignore those that do not have the prefix. + if (![sessionID hasPrefix:kFIRNetworkBackgroundSessionConfigIDPrefix]) { + return; + } + FIRNetworkURLSession *fetcher = [self fetcherWithSessionIdentifier:sessionID]; + if (fetcher != nil) { + [fetcher addSystemCompletionHandler:systemCompletionHandler forSession:sessionID]; + } else { + FIRLogError(kFIRLoggerCore, + [NSString stringWithFormat:@"I-NET%06ld", (long)kFIRNetworkMessageCodeNetwork003], + @"Failed to retrieve background session with ID %@ after app is relaunched.", + sessionID); + } +} + +#pragma mark - External Methods + +/// Sends an async POST request using NSURLSession for iOS >= 7.0, and returns an ID of the +/// connection. +- (NSString *)sessionIDFromAsyncPOSTRequest:(NSURLRequest *)request + completionHandler:(FIRNetworkURLSessionCompletionHandler)handler { + // NSURLSessionUploadTask does not work with NSData in the background. + // To avoid this issue, write the data to a temporary file to upload it. + // Make a temporary file with the data subset. + _uploadingFileURL = [self temporaryFilePathWithSessionID:_sessionID]; + NSError *writeError; + NSURLSessionUploadTask *postRequestTask; + NSURLSession *session; + BOOL didWriteFile = NO; + + // Clean up the entire temp folder to avoid temp files that remain in case the previous session + // crashed and did not clean up. + [self maybeRemoveTempFilesAtURL:_networkDirectoryURL + expiringTime:kFIRNetworkTempFolderExpireTime]; + + // If there is no background network enabled, no need to write to file. This will allow default + // network session which runs on the foreground. + if (_backgroundNetworkEnabled && [self ensureTemporaryDirectoryExists]) { + didWriteFile = [request.HTTPBody writeToFile:_uploadingFileURL.path + options:NSDataWritingAtomic + error:&writeError]; + + if (writeError) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession000 + message:@"Failed to write request data to file" + context:writeError]; + } + } + + if (didWriteFile) { + // Exclude this file from backing up to iTunes. There are conflicting reports that excluding + // directory from backing up does not excluding files of that directory from backing up. + [self excludeFromBackupForURL:_uploadingFileURL]; + + _sessionConfig = [self backgroundSessionConfigWithSessionID:_sessionID]; + [self populateSessionConfig:_sessionConfig withRequest:request]; + session = [NSURLSession sessionWithConfiguration:_sessionConfig + delegate:self + delegateQueue:[NSOperationQueue mainQueue]]; + postRequestTask = [session uploadTaskWithRequest:request fromFile:_uploadingFileURL]; + } else { + // If we cannot write to file, just send it in the foreground. + _sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; + [self populateSessionConfig:_sessionConfig withRequest:request]; + _sessionConfig.URLCache = nil; + session = [NSURLSession sessionWithConfiguration:_sessionConfig + delegate:self + delegateQueue:[NSOperationQueue mainQueue]]; + postRequestTask = [session uploadTaskWithRequest:request fromData:request.HTTPBody]; + } + + if (!session || !postRequestTask) { + NSError *error = [[NSError alloc] + initWithDomain:kFIRNetworkErrorDomain + code:FIRErrorCodeNetworkRequestCreation + userInfo:@{kFIRNetworkErrorContext : @"Cannot create network session"}]; + [self callCompletionHandler:handler withResponse:nil data:nil error:error]; + return nil; + } + + // Save the session into memory. + NSMapTable *sessionIdentifierToFetcherMap = [[self class] sessionIDToFetcherMap]; + [sessionIdentifierToFetcherMap setObject:self forKey:_sessionID]; + + _request = [request copy]; + + // Store completion handler because background session does not accept handler block but custom + // delegate. + _completionHandler = [handler copy]; + [postRequestTask resume]; + + return _sessionID; +} + +/// Sends an async GET request using NSURLSession for iOS >= 7.0, and returns an ID of the session. +- (NSString *)sessionIDFromAsyncGETRequest:(NSURLRequest *)request + completionHandler:(FIRNetworkURLSessionCompletionHandler)handler { + if (_backgroundNetworkEnabled) { + _sessionConfig = [self backgroundSessionConfigWithSessionID:_sessionID]; + } else { + _sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; + } + + [self populateSessionConfig:_sessionConfig withRequest:request]; + + // Do not cache the GET request. + _sessionConfig.URLCache = nil; + + NSURLSession *session = [NSURLSession sessionWithConfiguration:_sessionConfig + delegate:self + delegateQueue:[NSOperationQueue mainQueue]]; + NSURLSessionDownloadTask *downloadTask = [session downloadTaskWithRequest:request]; + + if (!session || !downloadTask) { + NSError *error = [[NSError alloc] + initWithDomain:kFIRNetworkErrorDomain + code:FIRErrorCodeNetworkRequestCreation + userInfo:@{kFIRNetworkErrorContext : @"Cannot create network session"}]; + [self callCompletionHandler:handler withResponse:nil data:nil error:error]; + return nil; + } + + // Save the session into memory. + NSMapTable *sessionIdentifierToFetcherMap = [[self class] sessionIDToFetcherMap]; + [sessionIdentifierToFetcherMap setObject:self forKey:_sessionID]; + + _request = [request copy]; + + _completionHandler = [handler copy]; + [downloadTask resume]; + + return _sessionID; +} + +#pragma mark - NSURLSessionTaskDelegate + +/// Called by the NSURLSession once the download task is completed. The file is saved in the +/// provided URL so we need to read the data and store into _downloadedData. Once the session is +/// completed, URLSession:task:didCompleteWithError will be called and the completion handler will +/// be called with the downloaded data. +- (void)URLSession:(NSURLSession *)session + downloadTask:(NSURLSessionDownloadTask *)task + didFinishDownloadingToURL:(NSURL *)url { + if (!url.path) { + [_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession001 + message:@"Unable to read downloaded data from empty temp path"]; + _downloadedData = nil; + return; + } + + NSError *error; + _downloadedData = [NSData dataWithContentsOfFile:url.path options:0 error:&error]; + + if (error) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession002 + message:@"Cannot read the content of downloaded data" + context:error]; + _downloadedData = nil; + } +} + +#if TARGET_OS_IOS || TARGET_OS_TV +- (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeURLSession003 + message:@"Background session finished" + context:session.configuration.identifier]; + [self callSystemCompletionHandler:session.configuration.identifier]; +} +#endif + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + didCompleteWithError:(NSError *)error { + // Avoid any chance of recursive behavior leading to it being used repeatedly. + FIRNetworkURLSessionCompletionHandler handler = _completionHandler; + _completionHandler = nil; + + if (task.response) { + // The following assertion should always be true for HTTP requests, see https://goo.gl/gVLxT7. + NSAssert([task.response isKindOfClass:[NSHTTPURLResponse class]], @"URL response must be HTTP"); + + // The server responded so ignore the error created by the system. + error = nil; + } else if (!error) { + error = [[NSError alloc] + initWithDomain:kFIRNetworkErrorDomain + code:FIRErrorCodeNetworkInvalidResponse + userInfo:@{kFIRNetworkErrorContext : @"Network Error: Empty network response"}]; + } + + [self callCompletionHandler:handler + withResponse:(NSHTTPURLResponse *)task.response + data:_downloadedData + error:error]; + + // Remove the temp file to avoid trashing devices with lots of temp files. + [self removeTempItemAtURL:_uploadingFileURL]; + + // Try to clean up stale files again. + [self maybeRemoveTempFilesAtURL:_networkDirectoryURL + expiringTime:kFIRNetworkTempFolderExpireTime]; +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge + completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, + NSURLCredential *credential))completionHandler { + // The handling is modeled after GTMSessionFetcher. + if ([challenge.protectionSpace.authenticationMethod + isEqualToString:NSURLAuthenticationMethodServerTrust]) { + SecTrustRef serverTrust = challenge.protectionSpace.serverTrust; + if (serverTrust == NULL) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeURLSession004 + message:@"Received empty server trust for host. Host" + context:_request.URL]; + completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); + return; + } + NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust]; + if (!credential) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelWarning + messageCode:kFIRNetworkMessageCodeURLSession005 + message:@"Unable to verify server identity. Host" + context:_request.URL]; + completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); + return; + } + + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeURLSession006 + message:@"Received SSL challenge for host. Host" + context:_request.URL]; + + void (^callback)(BOOL) = ^(BOOL allow) { + if (allow) { + completionHandler(NSURLSessionAuthChallengeUseCredential, credential); + } else { + [self->_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeURLSession007 + message:@"Cancelling authentication challenge for host. Host" + context:self->_request.URL]; + completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); + } + }; + + // Retain the trust object to avoid a SecTrustEvaluate() crash on iOS 7. + CFRetain(serverTrust); + + // Evaluate the certificate chain. + // + // The delegate queue may be the main thread. Trust evaluation could cause some + // blocking network activity, so we must evaluate async, as documented at + // https://developer.apple.com/library/ios/technotes/tn2232/ + dispatch_queue_t evaluateBackgroundQueue = + dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + + dispatch_async(evaluateBackgroundQueue, ^{ + SecTrustResultType trustEval = kSecTrustResultInvalid; + BOOL shouldAllow; + OSStatus trustError; + + @synchronized([FIRNetworkURLSession class]) { + trustError = SecTrustEvaluate(serverTrust, &trustEval); + } + + if (trustError != errSecSuccess) { + [self->_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession008 + message:@"Cannot evaluate server trust. Error, host" + contexts:@[ @(trustError), self->_request.URL ]]; + shouldAllow = NO; + } else { + // Having a trust level "unspecified" by the user is the usual result, described at + // https://developer.apple.com/library/mac/qa/qa1360 + shouldAllow = + (trustEval == kSecTrustResultUnspecified || trustEval == kSecTrustResultProceed); + } + + // Call the call back with the permission. + callback(shouldAllow); + + CFRelease(serverTrust); + }); + return; + } + + // Default handling for other Auth Challenges. + completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); +} + +#pragma mark - Internal Methods + +/// Stores system completion handler with session ID as key. +- (void)addSystemCompletionHandler:(FIRNetworkSystemCompletionHandler)handler + forSession:(NSString *)identifier { + if (!handler) { + [_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession009 + message:@"Cannot store nil system completion handler in network"]; + return; + } + + if (!identifier.length) { + [_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession010 + message: + @"Cannot store system completion handler with empty network " + "session identifier"]; + return; + } + + FIRMutableDictionary *systemCompletionHandlers = + [[self class] sessionIDToSystemCompletionHandlerDictionary]; + if (systemCompletionHandlers[identifier]) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelWarning + messageCode:kFIRNetworkMessageCodeURLSession011 + message:@"Got multiple system handlers for a single session ID" + context:identifier]; + } + + systemCompletionHandlers[identifier] = handler; +} + +/// Calls the system provided completion handler with the session ID stored in the dictionary. +/// The handler will be removed from the dictionary after being called. +- (void)callSystemCompletionHandler:(NSString *)identifier { + FIRMutableDictionary *systemCompletionHandlers = + [[self class] sessionIDToSystemCompletionHandlerDictionary]; + FIRNetworkSystemCompletionHandler handler = [systemCompletionHandlers objectForKey:identifier]; + + if (handler) { + [systemCompletionHandlers removeObjectForKey:identifier]; + + dispatch_async(dispatch_get_main_queue(), ^{ + handler(); + }); + } +} + +/// Sets or updates the session ID of this session. +- (void)setSessionID:(NSString *)sessionID { + _sessionID = [sessionID copy]; +} + +/// Creates a background session configuration with the session ID using the supported method. +- (NSURLSessionConfiguration *)backgroundSessionConfigWithSessionID:(NSString *)sessionID { +#if (TARGET_OS_OSX && defined(MAC_OS_X_VERSION_10_10) && \ + MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10) || \ + TARGET_OS_TV || \ + (TARGET_OS_IOS && defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0) + + // iOS 8/10.10 builds require the new backgroundSessionConfiguration method name. + return [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:sessionID]; + +#elif (TARGET_OS_OSX && defined(MAC_OS_X_VERSION_10_10) && \ + MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10) || \ + (TARGET_OS_IOS && defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0) + + // Do a runtime check to avoid a deprecation warning about using + // +backgroundSessionConfiguration: on iOS 8. + if ([NSURLSessionConfiguration + respondsToSelector:@selector(backgroundSessionConfigurationWithIdentifier:)]) { + // Running on iOS 8+/OS X 10.10+. + return [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:sessionID]; + } else { + // Running on iOS 7/OS X 10.9. + return [NSURLSessionConfiguration backgroundSessionConfiguration:sessionID]; + } + +#else + // Building with an SDK earlier than iOS 8/OS X 10.10. + return [NSURLSessionConfiguration backgroundSessionConfiguration:sessionID]; +#endif +} + +- (void)maybeRemoveTempFilesAtURL:(NSURL *)folderURL expiringTime:(NSTimeInterval)staleTime { + if (!folderURL.absoluteString.length) { + return; + } + + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSError *error = nil; + + NSArray *properties = @[ NSURLCreationDateKey ]; + NSArray *directoryContent = + [fileManager contentsOfDirectoryAtURL:folderURL + includingPropertiesForKeys:properties + options:NSDirectoryEnumerationSkipsSubdirectoryDescendants + error:&error]; + if (error && error.code != NSFileReadNoSuchFileError) { + [_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeURLSession012 + message:@"Cannot get files from the temporary network folder. Error" + context:error]; + return; + } + + if (!directoryContent.count) { + return; + } + + NSTimeInterval now = [NSDate date].timeIntervalSince1970; + for (NSURL *tempFile in directoryContent) { + NSDate *creationDate; + BOOL getCreationDate = + [tempFile getResourceValue:&creationDate forKey:NSURLCreationDateKey error:NULL]; + if (!getCreationDate) { + continue; + } + NSTimeInterval creationTimeInterval = creationDate.timeIntervalSince1970; + if (fabs(now - creationTimeInterval) > staleTime) { + [self removeTempItemAtURL:tempFile]; + } + } +} + +/// Removes the temporary file written to disk for sending the request. It has to be cleaned up +/// after the session is done. +- (void)removeTempItemAtURL:(NSURL *)fileURL { + if (!fileURL.absoluteString.length) { + return; + } + + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSError *error = nil; + + if (![fileManager removeItemAtURL:fileURL error:&error] && error.code != NSFileNoSuchFileError) { + [_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession013 + message:@"Failed to remove temporary uploading data file. Error" + context:error.localizedDescription]; + } +} + +/// Gets the fetcher with the session ID. ++ (instancetype)fetcherWithSessionIdentifier:(NSString *)sessionIdentifier { + NSMapTable *sessionIdentifierToFetcherMap = [self sessionIDToFetcherMap]; + FIRNetworkURLSession *session = [sessionIdentifierToFetcherMap objectForKey:sessionIdentifier]; + if (!session && [sessionIdentifier hasPrefix:kFIRNetworkBackgroundSessionConfigIDPrefix]) { + session = [[FIRNetworkURLSession alloc] initWithNetworkLoggerDelegate:nil]; + [session setSessionID:sessionIdentifier]; + [sessionIdentifierToFetcherMap setObject:session forKey:sessionIdentifier]; + } + return session; +} + +/// Returns a map of the fetcher by session ID. Creates a map if it is not created. ++ (NSMapTable *)sessionIDToFetcherMap { + static NSMapTable *sessionIDToFetcherMap; + + static dispatch_once_t sessionMapOnceToken; + dispatch_once(&sessionMapOnceToken, ^{ + sessionIDToFetcherMap = [NSMapTable strongToWeakObjectsMapTable]; + }); + return sessionIDToFetcherMap; +} + +/// Returns a map of system provided completion handler by session ID. Creates a map if it is not +/// created. ++ (FIRMutableDictionary *)sessionIDToSystemCompletionHandlerDictionary { + static FIRMutableDictionary *systemCompletionHandlers; + + static dispatch_once_t systemCompletionHandlerOnceToken; + dispatch_once(&systemCompletionHandlerOnceToken, ^{ + systemCompletionHandlers = [[FIRMutableDictionary alloc] init]; + }); + return systemCompletionHandlers; +} + +- (NSURL *)temporaryFilePathWithSessionID:(NSString *)sessionID { + NSString *tempName = [NSString stringWithFormat:@"FIRUpload_temp_%@", sessionID]; + return [_networkDirectoryURL URLByAppendingPathComponent:tempName]; +} + +/// Makes sure that the directory to store temp files exists. If not, tries to create it and returns +/// YES. If there is anything wrong, returns NO. +- (BOOL)ensureTemporaryDirectoryExists { + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSError *error = nil; + + // Create a temporary directory if it does not exist or was deleted. + if ([_networkDirectoryURL checkResourceIsReachableAndReturnError:&error]) { + return YES; + } + + if (error && error.code != NSFileReadNoSuchFileError) { + [_loggerDelegate + firNetwork_logWithLevel:kFIRNetworkLogLevelWarning + messageCode:kFIRNetworkMessageCodeURLSession014 + message:@"Error while trying to access Network temp folder. Error" + context:error]; + } + + NSError *writeError = nil; + + [fileManager createDirectoryAtURL:_networkDirectoryURL + withIntermediateDirectories:YES + attributes:nil + error:&writeError]; + if (writeError) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession015 + message:@"Cannot create temporary directory. Error" + context:writeError]; + return NO; + } + + // Set the iCloud exclusion attribute on the Documents URL. + [self excludeFromBackupForURL:_networkDirectoryURL]; + + return YES; +} + +- (void)excludeFromBackupForURL:(NSURL *)url { + if (!url.path) { + return; + } + + // Set the iCloud exclusion attribute on the Documents URL. + NSError *preventBackupError = nil; + [url setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:&preventBackupError]; + if (preventBackupError) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession016 + message:@"Cannot exclude temporary folder from iTunes backup"]; + } +} + +- (void)URLSession:(NSURLSession *)session + task:(NSURLSessionTask *)task + willPerformHTTPRedirection:(NSHTTPURLResponse *)response + newRequest:(NSURLRequest *)request + completionHandler:(void (^)(NSURLRequest *))completionHandler { + NSArray *nonAllowedRedirectionCodes = @[ + @(kFIRNetworkHTTPStatusCodeFound), @(kFIRNetworkHTTPStatusCodeMovedPermanently), + @(kFIRNetworkHTTPStatusCodeMovedTemporarily), @(kFIRNetworkHTTPStatusCodeMultipleChoices) + ]; + + // Allow those not in the non allowed list to be followed. + if (![nonAllowedRedirectionCodes containsObject:@(response.statusCode)]) { + completionHandler(request); + return; + } + + // Do not allow redirection if the response code is in the non-allowed list. + NSURLRequest *newRequest = request; + + if (response) { + newRequest = nil; + } + + completionHandler(newRequest); +} + +#pragma mark - Helper Methods + +- (void)callCompletionHandler:(FIRNetworkURLSessionCompletionHandler)handler + withResponse:(NSHTTPURLResponse *)response + data:(NSData *)data + error:(NSError *)error { + if (error) { + [_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeURLSession017 + message:@"Encounter network error. Code, error" + contexts:@[ @(error.code), error ]]; + } + + if (handler) { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(response, data, self->_sessionID, error); + }); + } +} + +- (void)populateSessionConfig:(NSURLSessionConfiguration *)sessionConfig + withRequest:(NSURLRequest *)request { + sessionConfig.HTTPAdditionalHeaders = request.allHTTPHeaderFields; + sessionConfig.timeoutIntervalForRequest = request.timeoutInterval; + sessionConfig.timeoutIntervalForResource = request.timeoutInterval; + sessionConfig.requestCachePolicy = request.cachePolicy; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIROptions.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIROptions.m new file mode 100644 index 0000000..7c26623 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIROptions.m @@ -0,0 +1,445 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "Private/FIRAppInternal.h" +#import "Private/FIRBundleUtil.h" +#import "Private/FIRErrors.h" +#import "Private/FIRLogger.h" +#import "Private/FIROptionsInternal.h" + +// Keys for the strings in the plist file. +NSString *const kFIRAPIKey = @"API_KEY"; +NSString *const kFIRTrackingID = @"TRACKING_ID"; +NSString *const kFIRGoogleAppID = @"GOOGLE_APP_ID"; +NSString *const kFIRClientID = @"CLIENT_ID"; +NSString *const kFIRGCMSenderID = @"GCM_SENDER_ID"; +NSString *const kFIRAndroidClientID = @"ANDROID_CLIENT_ID"; +NSString *const kFIRDatabaseURL = @"DATABASE_URL"; +NSString *const kFIRStorageBucket = @"STORAGE_BUCKET"; +// The key to locate the expected bundle identifier in the plist file. +NSString *const kFIRBundleID = @"BUNDLE_ID"; +// The key to locate the project identifier in the plist file. +NSString *const kFIRProjectID = @"PROJECT_ID"; + +NSString *const kFIRIsMeasurementEnabled = @"IS_MEASUREMENT_ENABLED"; +NSString *const kFIRIsAnalyticsCollectionEnabled = @"FIREBASE_ANALYTICS_COLLECTION_ENABLED"; +NSString *const kFIRIsAnalyticsCollectionDeactivated = @"FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED"; + +NSString *const kFIRIsAnalyticsEnabled = @"IS_ANALYTICS_ENABLED"; +NSString *const kFIRIsSignInEnabled = @"IS_SIGNIN_ENABLED"; + +// Library version ID. +NSString *const kFIRLibraryVersionID = + @"5" // Major version (one or more digits) + @"00" // Minor version (exactly 2 digits) + @"04" // Build number (exactly 2 digits) + @"000"; // Fixed "000" +// Plist file name. +NSString *const kServiceInfoFileName = @"GoogleService-Info"; +// Plist file type. +NSString *const kServiceInfoFileType = @"plist"; + +// Exception raised from attempting to modify a FIROptions after it's been copied to a FIRApp. +NSString *const kFIRExceptionBadModification = + @"Attempted to modify options after it's set on FIRApp. Please modify all properties before " + @"initializing FIRApp."; + +@interface FIROptions () + +/** + * This property maintains the actual configuration key-value pairs. + */ +@property(nonatomic, readwrite) NSMutableDictionary *optionsDictionary; + +/** + * Calls `analyticsOptionsDictionaryWithInfoDictionary:` using [NSBundle mainBundle].infoDictionary. + * It combines analytics options from both the infoDictionary and the GoogleService-Info.plist. + * Values which are present in the main plist override values from the GoogleService-Info.plist. + */ +@property(nonatomic, readonly) NSDictionary *analyticsOptionsDictionary; + +/** + * Combination of analytics options from both the infoDictionary and the GoogleService-Info.plist. + * Values which are present in the infoDictionary override values from the GoogleService-Info.plist. + */ +- (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary; + +/** + * Throw exception if editing is locked when attempting to modify an option. + */ +- (void)checkEditingLocked; + +@end + +@implementation FIROptions { + /// Backing variable for self.analyticsOptionsDictionary. + NSDictionary *_analyticsOptionsDictionary; + dispatch_once_t _createAnalyticsOptionsDictionaryOnce; +} + +static FIROptions *sDefaultOptions = nil; +static NSDictionary *sDefaultOptionsDictionary = nil; + +#pragma mark - Public only for internal class methods + ++ (FIROptions *)defaultOptions { + if (sDefaultOptions != nil) { + return sDefaultOptions; + } + + NSDictionary *defaultOptionsDictionary = [self defaultOptionsDictionary]; + if (defaultOptionsDictionary == nil) { + return nil; + } + + sDefaultOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:defaultOptionsDictionary]; + return sDefaultOptions; +} + +#pragma mark - Private class methods + ++ (void)initialize { + // Report FirebaseCore version for useragent string + NSRange major = NSMakeRange(0, 1); + NSRange minor = NSMakeRange(1, 2); + NSRange patch = NSMakeRange(3, 2); + [FIRApp + registerLibrary:@"fire-ios" + withVersion:[NSString stringWithFormat:@"%@.%d.%d", + [kFIRLibraryVersionID substringWithRange:major], + [[kFIRLibraryVersionID substringWithRange:minor] + intValue], + [[kFIRLibraryVersionID substringWithRange:patch] + intValue]]]; + NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; + NSString *xcodeVersion = info[@"DTXcodeBuild"]; + NSString *sdkVersion = info[@"DTSDKBuild"]; + if (xcodeVersion) { + [FIRApp registerLibrary:@"xcode" withVersion:xcodeVersion]; + } + if (sdkVersion) { + [FIRApp registerLibrary:@"apple-sdk" withVersion:sdkVersion]; + } +} + ++ (NSDictionary *)defaultOptionsDictionary { + if (sDefaultOptionsDictionary != nil) { + return sDefaultOptionsDictionary; + } + NSString *plistFilePath = [FIROptions plistFilePathWithName:kServiceInfoFileName]; + if (plistFilePath == nil) { + return nil; + } + sDefaultOptionsDictionary = [NSDictionary dictionaryWithContentsOfFile:plistFilePath]; + if (sDefaultOptionsDictionary == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000011", + @"The configuration file is not a dictionary: " + @"'%@.%@'.", + kServiceInfoFileName, kServiceInfoFileType); + } + return sDefaultOptionsDictionary; +} + +// Returns the path of the plist file with a given file name. ++ (NSString *)plistFilePathWithName:(NSString *)fileName { + NSArray *bundles = [FIRBundleUtil relevantBundles]; + NSString *plistFilePath = + [FIRBundleUtil optionsDictionaryPathWithResourceName:fileName + andFileType:kServiceInfoFileType + inBundles:bundles]; + if (plistFilePath == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000012", @"Could not locate configuration file: '%@.%@'.", + fileName, kServiceInfoFileType); + } + return plistFilePath; +} + ++ (void)resetDefaultOptions { + sDefaultOptions = nil; + sDefaultOptionsDictionary = nil; +} + +#pragma mark - Private instance methods + +- (instancetype)initInternalWithOptionsDictionary:(NSDictionary *)optionsDictionary { + self = [super init]; + if (self) { + _optionsDictionary = [optionsDictionary mutableCopy]; + _usingOptionsFromDefaultPlist = YES; + } + return self; +} + +- (id)copyWithZone:(NSZone *)zone { + FIROptions *newOptions = [[[self class] allocWithZone:zone] init]; + if (newOptions) { + newOptions.optionsDictionary = self.optionsDictionary; + newOptions.deepLinkURLScheme = self.deepLinkURLScheme; + newOptions.editingLocked = self.isEditingLocked; + newOptions.usingOptionsFromDefaultPlist = self.usingOptionsFromDefaultPlist; + } + return newOptions; +} + +#pragma mark - Public instance methods + +- (instancetype)initWithContentsOfFile:(NSString *)plistPath { + self = [super init]; + if (self) { + if (plistPath == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000013", @"The plist file path is nil."); + return nil; + } + _optionsDictionary = [[NSDictionary dictionaryWithContentsOfFile:plistPath] mutableCopy]; + if (_optionsDictionary == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000014", + @"The configuration file at %@ does not exist or " + @"is not a well-formed plist file.", + plistPath); + return nil; + } + // TODO: Do we want to validate the dictionary here? It says we do that already in + // the public header. + } + return self; +} + +- (instancetype)initWithGoogleAppID:(NSString *)googleAppID GCMSenderID:(NSString *)GCMSenderID { + self = [super init]; + if (self) { + NSMutableDictionary *mutableOptionsDict = [NSMutableDictionary dictionary]; + [mutableOptionsDict setValue:googleAppID forKey:kFIRGoogleAppID]; + [mutableOptionsDict setValue:GCMSenderID forKey:kFIRGCMSenderID]; + [mutableOptionsDict setValue:[[NSBundle mainBundle] bundleIdentifier] forKey:kFIRBundleID]; + self.optionsDictionary = mutableOptionsDict; + } + return self; +} + +- (NSString *)APIKey { + return self.optionsDictionary[kFIRAPIKey]; +} + +- (void)checkEditingLocked { + if (self.isEditingLocked) { + [NSException raise:kFirebaseCoreErrorDomain format:kFIRExceptionBadModification]; + } +} + +- (void)setAPIKey:(NSString *)APIKey { + [self checkEditingLocked]; + _optionsDictionary[kFIRAPIKey] = [APIKey copy]; +} + +- (NSString *)clientID { + return self.optionsDictionary[kFIRClientID]; +} + +- (void)setClientID:(NSString *)clientID { + [self checkEditingLocked]; + _optionsDictionary[kFIRClientID] = [clientID copy]; +} + +- (NSString *)trackingID { + return self.optionsDictionary[kFIRTrackingID]; +} + +- (void)setTrackingID:(NSString *)trackingID { + [self checkEditingLocked]; + _optionsDictionary[kFIRTrackingID] = [trackingID copy]; +} + +- (NSString *)GCMSenderID { + return self.optionsDictionary[kFIRGCMSenderID]; +} + +- (void)setGCMSenderID:(NSString *)GCMSenderID { + [self checkEditingLocked]; + _optionsDictionary[kFIRGCMSenderID] = [GCMSenderID copy]; +} + +- (NSString *)projectID { + return self.optionsDictionary[kFIRProjectID]; +} + +- (void)setProjectID:(NSString *)projectID { + [self checkEditingLocked]; + _optionsDictionary[kFIRProjectID] = [projectID copy]; +} + +- (NSString *)androidClientID { + return self.optionsDictionary[kFIRAndroidClientID]; +} + +- (void)setAndroidClientID:(NSString *)androidClientID { + [self checkEditingLocked]; + _optionsDictionary[kFIRAndroidClientID] = [androidClientID copy]; +} + +- (NSString *)googleAppID { + return self.optionsDictionary[kFIRGoogleAppID]; +} + +- (void)setGoogleAppID:(NSString *)googleAppID { + [self checkEditingLocked]; + _optionsDictionary[kFIRGoogleAppID] = [googleAppID copy]; +} + +- (NSString *)libraryVersionID { + return kFIRLibraryVersionID; +} + +- (void)setLibraryVersionID:(NSString *)libraryVersionID { + _optionsDictionary[kFIRLibraryVersionID] = [libraryVersionID copy]; +} + +- (NSString *)databaseURL { + return self.optionsDictionary[kFIRDatabaseURL]; +} + +- (void)setDatabaseURL:(NSString *)databaseURL { + [self checkEditingLocked]; + + _optionsDictionary[kFIRDatabaseURL] = [databaseURL copy]; +} + +- (NSString *)storageBucket { + return self.optionsDictionary[kFIRStorageBucket]; +} + +- (void)setStorageBucket:(NSString *)storageBucket { + [self checkEditingLocked]; + _optionsDictionary[kFIRStorageBucket] = [storageBucket copy]; +} + +- (void)setDeepLinkURLScheme:(NSString *)deepLinkURLScheme { + [self checkEditingLocked]; + _deepLinkURLScheme = [deepLinkURLScheme copy]; +} + +- (NSString *)bundleID { + return self.optionsDictionary[kFIRBundleID]; +} + +- (void)setBundleID:(NSString *)bundleID { + [self checkEditingLocked]; + _optionsDictionary[kFIRBundleID] = [bundleID copy]; +} + +#pragma mark - Internal instance methods + +- (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary { + dispatch_once(&_createAnalyticsOptionsDictionaryOnce, ^{ + NSMutableDictionary *tempAnalyticsOptions = [[NSMutableDictionary alloc] init]; + NSArray *measurementKeys = @[ + kFIRIsMeasurementEnabled, kFIRIsAnalyticsCollectionEnabled, + kFIRIsAnalyticsCollectionDeactivated + ]; + for (NSString *key in measurementKeys) { + id value = infoDictionary[key] ?: self.optionsDictionary[key] ?: nil; + if (!value) { + continue; + } + tempAnalyticsOptions[key] = value; + } + self->_analyticsOptionsDictionary = tempAnalyticsOptions; + }); + return _analyticsOptionsDictionary; +} + +- (NSDictionary *)analyticsOptionsDictionary { + return [self analyticsOptionsDictionaryWithInfoDictionary:[NSBundle mainBundle].infoDictionary]; +} + +/** + * Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in + * GoogleService-Info.plist. This uses the old plist flag IS_MEASUREMENT_ENABLED, which should still + * be supported. + */ +- (BOOL)isMeasurementEnabled { + if (self.isAnalyticsCollectionDeactivated) { + return NO; + } + NSNumber *value = self.analyticsOptionsDictionary[kFIRIsMeasurementEnabled]; + if (value == nil) { + // TODO: This could probably be cleaned up since FIROptions shouldn't know about FIRApp or have + // to check if it's the default app. The FIROptions instance can't be modified after + // `+configure` is called, so it's not a good place to copy it either in case the flag is + // changed at runtime. + + // If no values are set for Analytics, fall back to the global collection switch in FIRApp. + // Analytics only supports the default FIRApp, so check that first. + if (![FIRApp isDefaultAppConfigured]) { + return NO; + } + + // Fall back to the default app's collection switch when the key is not in the dictionary. + return [FIRApp defaultApp].automaticDataCollectionEnabled; + } + return [value boolValue]; +} + +- (BOOL)isAnalyticsCollectionExpicitlySet { + // If it's de-activated, it classifies as explicity set. If not, it's not a good enough indication + // that the developer wants FirebaseAnalytics enabled so continue checking. + if (self.isAnalyticsCollectionDeactivated) { + return YES; + } + + // Check if the current Analytics flag is set. + id collectionEnabledObject = self.analyticsOptionsDictionary[kFIRIsAnalyticsCollectionEnabled]; + if (collectionEnabledObject && [collectionEnabledObject isKindOfClass:[NSNumber class]]) { + // It doesn't matter what the value is, it's explicitly set. + return YES; + } + + // Check if the old measurement flag is set. + id measurementEnabledObject = self.analyticsOptionsDictionary[kFIRIsMeasurementEnabled]; + if (measurementEnabledObject && [measurementEnabledObject isKindOfClass:[NSNumber class]]) { + // It doesn't matter what the value is, it's explicitly set. + return YES; + } + + // No flags are set to explicitly enable or disable FirebaseAnalytics. + return NO; +} + +- (BOOL)isAnalyticsCollectionEnabled { + if (self.isAnalyticsCollectionDeactivated) { + return NO; + } + NSNumber *value = self.analyticsOptionsDictionary[kFIRIsAnalyticsCollectionEnabled]; + if (value == nil) { + return self.isMeasurementEnabled; // Fall back to older plist flag. + } + return [value boolValue]; +} + +- (BOOL)isAnalyticsCollectionDeactivated { + NSNumber *value = self.analyticsOptionsDictionary[kFIRIsAnalyticsCollectionDeactivated]; + if (value == nil) { + return NO; // Analytics Collection is not deactivated when the key is not in the dictionary. + } + return [value boolValue]; +} + +- (BOOL)isAnalyticsEnabled { + return [self.optionsDictionary[kFIRIsAnalyticsEnabled] boolValue]; +} + +- (BOOL)isSignInEnabled { + return [self.optionsDictionary[kFIRIsSignInEnabled] boolValue]; +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRReachabilityChecker.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRReachabilityChecker.m new file mode 100644 index 0000000..cac87ff --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRReachabilityChecker.m @@ -0,0 +1,256 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +#import "Private/FIRReachabilityChecker+Internal.h" +#import "Private/FIRReachabilityChecker.h" + +#import "Private/FIRLogger.h" +#import "Private/FIRNetwork.h" +#import "Private/FIRNetworkMessageCode.h" + +static void ReachabilityCallback(SCNetworkReachabilityRef reachability, + SCNetworkReachabilityFlags flags, + void *info); + +static const struct FIRReachabilityApi kFIRDefaultReachabilityApi = { + SCNetworkReachabilityCreateWithName, + SCNetworkReachabilitySetCallback, + SCNetworkReachabilityScheduleWithRunLoop, + SCNetworkReachabilityUnscheduleFromRunLoop, + CFRelease, +}; + +static NSString *const kFIRReachabilityUnknownStatus = @"Unknown"; +static NSString *const kFIRReachabilityConnectedStatus = @"Connected"; +static NSString *const kFIRReachabilityDisconnectedStatus = @"Disconnected"; + +@interface FIRReachabilityChecker () + +@property(nonatomic, assign) const struct FIRReachabilityApi *reachabilityApi; +@property(nonatomic, assign) FIRReachabilityStatus reachabilityStatus; +@property(nonatomic, copy) NSString *host; +@property(nonatomic, assign) SCNetworkReachabilityRef reachability; + +@end + +@implementation FIRReachabilityChecker + +@synthesize reachabilityApi = reachabilityApi_; +@synthesize reachability = reachability_; + +- (const struct FIRReachabilityApi *)reachabilityApi { + return reachabilityApi_; +} + +- (void)setReachabilityApi:(const struct FIRReachabilityApi *)reachabilityApi { + if (reachability_) { + NSString *message = + @"Cannot change reachability API while reachability is running. " + @"Call stop first."; + [loggerDelegate_ firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeReachabilityChecker000 + message:message]; + return; + } + reachabilityApi_ = reachabilityApi; +} + +@synthesize reachabilityStatus = reachabilityStatus_; +@synthesize host = host_; +@synthesize reachabilityDelegate = reachabilityDelegate_; +@synthesize loggerDelegate = loggerDelegate_; + +- (BOOL)isActive { + return reachability_ != nil; +} + +- (void)setReachabilityDelegate:(id)reachabilityDelegate { + if (reachabilityDelegate && + (![(NSObject *)reachabilityDelegate conformsToProtocol:@protocol(FIRReachabilityDelegate)])) { + FIRLogError(kFIRLoggerCore, + [NSString stringWithFormat:@"I-NET%06ld", + (long)kFIRNetworkMessageCodeReachabilityChecker005], + @"Reachability delegate doesn't conform to Reachability protocol."); + return; + } + reachabilityDelegate_ = reachabilityDelegate; +} + +- (void)setLoggerDelegate:(id)loggerDelegate { + if (loggerDelegate && + (![(NSObject *)loggerDelegate conformsToProtocol:@protocol(FIRNetworkLoggerDelegate)])) { + FIRLogError(kFIRLoggerCore, + [NSString stringWithFormat:@"I-NET%06ld", + (long)kFIRNetworkMessageCodeReachabilityChecker006], + @"Reachability delegate doesn't conform to Logger protocol."); + return; + } + loggerDelegate_ = loggerDelegate; +} + +- (instancetype)initWithReachabilityDelegate:(id)reachabilityDelegate + loggerDelegate:(id)loggerDelegate + withHost:(NSString *)host { + self = [super init]; + + [self setLoggerDelegate:loggerDelegate]; + + if (!host || !host.length) { + [loggerDelegate_ firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeReachabilityChecker001 + message:@"Invalid host specified"]; + return nil; + } + if (self) { + [self setReachabilityDelegate:reachabilityDelegate]; + reachabilityApi_ = &kFIRDefaultReachabilityApi; + reachabilityStatus_ = kFIRReachabilityUnknown; + host_ = [host copy]; + reachability_ = nil; + } + return self; +} + +- (void)dealloc { + reachabilityDelegate_ = nil; + loggerDelegate_ = nil; + [self stop]; +} + +- (BOOL)start { + if (!reachability_) { + reachability_ = reachabilityApi_->createWithNameFn(kCFAllocatorDefault, [host_ UTF8String]); + if (!reachability_) { + return NO; + } + SCNetworkReachabilityContext context = { + 0, /* version */ + (__bridge void *)(self), /* info (passed as last parameter to reachability callback) */ + NULL, /* retain */ + NULL, /* release */ + NULL /* copyDescription */ + }; + if (!reachabilityApi_->setCallbackFn(reachability_, ReachabilityCallback, &context) || + !reachabilityApi_->scheduleWithRunLoopFn(reachability_, CFRunLoopGetMain(), + kCFRunLoopCommonModes)) { + reachabilityApi_->releaseFn(reachability_); + reachability_ = nil; + [loggerDelegate_ firNetwork_logWithLevel:kFIRNetworkLogLevelError + messageCode:kFIRNetworkMessageCodeReachabilityChecker002 + message:@"Failed to start reachability handle"]; + return NO; + } + } + [loggerDelegate_ firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeReachabilityChecker003 + message:@"Monitoring the network status"]; + return YES; +} + +- (void)stop { + if (reachability_) { + reachabilityStatus_ = kFIRReachabilityUnknown; + reachabilityApi_->unscheduleFromRunLoopFn(reachability_, CFRunLoopGetMain(), + kCFRunLoopCommonModes); + reachabilityApi_->releaseFn(reachability_); + reachability_ = nil; + } +} + +- (FIRReachabilityStatus)statusForFlags:(SCNetworkReachabilityFlags)flags { + FIRReachabilityStatus status = kFIRReachabilityNotReachable; + // If the Reachable flag is not set, we definitely don't have connectivity. + if (flags & kSCNetworkReachabilityFlagsReachable) { + // Reachable flag is set. Check further flags. + if (!(flags & kSCNetworkReachabilityFlagsConnectionRequired)) { +// Connection required flag is not set, so we have connectivity. +#if TARGET_OS_IOS || TARGET_OS_TV + status = (flags & kSCNetworkReachabilityFlagsIsWWAN) ? kFIRReachabilityViaCellular + : kFIRReachabilityViaWifi; +#elif TARGET_OS_OSX + status = kFIRReachabilityViaWifi; +#endif + } else if ((flags & (kSCNetworkReachabilityFlagsConnectionOnDemand | + kSCNetworkReachabilityFlagsConnectionOnTraffic)) && + !(flags & kSCNetworkReachabilityFlagsInterventionRequired)) { +// If the connection on demand or connection on traffic flag is set, and user intervention +// is not required, we have connectivity. +#if TARGET_OS_IOS || TARGET_OS_TV + status = (flags & kSCNetworkReachabilityFlagsIsWWAN) ? kFIRReachabilityViaCellular + : kFIRReachabilityViaWifi; +#elif TARGET_OS_OSX + status = kFIRReachabilityViaWifi; +#endif + } + } + return status; +} + +- (void)reachabilityFlagsChanged:(SCNetworkReachabilityFlags)flags { + FIRReachabilityStatus status = [self statusForFlags:flags]; + if (reachabilityStatus_ != status) { + NSString *reachabilityStatusString; + if (status == kFIRReachabilityUnknown) { + reachabilityStatusString = kFIRReachabilityUnknownStatus; + } else { + reachabilityStatusString = (status == kFIRReachabilityNotReachable) + ? kFIRReachabilityDisconnectedStatus + : kFIRReachabilityConnectedStatus; + } + [loggerDelegate_ firNetwork_logWithLevel:kFIRNetworkLogLevelDebug + messageCode:kFIRNetworkMessageCodeReachabilityChecker004 + message:@"Network status has changed. Code, status" + contexts:@[ @(status), reachabilityStatusString ]]; + reachabilityStatus_ = status; + [reachabilityDelegate_ reachability:self statusChanged:reachabilityStatus_]; + } +} + +@end + +static void ReachabilityCallback(SCNetworkReachabilityRef reachability, + SCNetworkReachabilityFlags flags, + void *info) { + FIRReachabilityChecker *checker = (__bridge FIRReachabilityChecker *)info; + [checker reachabilityFlagsChanged:flags]; +} + +// This function used to be at the top of the file, but it was moved here +// as a workaround for a suspected compiler bug. When compiled in Release mode +// and run on an iOS device with WiFi disabled, the reachability code crashed +// when calling SCNetworkReachabilityScheduleWithRunLoop, or shortly thereafter. +// After unsuccessfully trying to diagnose the cause of the crash, it was +// discovered that moving this function to the end of the file magically fixed +// the crash. If you are going to edit this file, exercise caution and make sure +// to test thoroughly with an iOS device under various network conditions. +const NSString *FIRReachabilityStatusString(FIRReachabilityStatus status) { + switch (status) { + case kFIRReachabilityUnknown: + return @"Reachability Unknown"; + + case kFIRReachabilityNotReachable: + return @"Not reachable"; + + case kFIRReachabilityViaWifi: + return @"Reachable via Wifi"; + + case kFIRReachabilityViaCellular: + return @"Reachable via Cellular Data"; + + default: + return [NSString stringWithFormat:@"Invalid reachability status %d", (int)status]; + } +} diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRVersion.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRVersion.m new file mode 100644 index 0000000..97cd1bc --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/FIRVersion.m @@ -0,0 +1,33 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef Firebase_VERSION +#error "Firebase_VERSION is not defined: add -DFirebase_VERSION=... to the build invocation" +#endif + +#ifndef FIRCore_VERSION +#error "FIRCore_VERSION is not defined: add -DFIRCore_VERSION=... to the build invocation" +#endif + +// The following two macros supply the incantation so that the C +// preprocessor does not try to parse the version as a floating +// point number. See +// https://www.guyrutenberg.com/2008/12/20/expanding-macros-into-string-constants-in-c/ +#define STR(x) STR_EXPAND(x) +#define STR_EXPAND(x) #x + +const unsigned char *const FIRVersionString = (const unsigned char *const)STR(Firebase_VERSION); +const unsigned char *const FIRCoreVersionString = (const unsigned char *const)STR(FIRCore_VERSION); diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAnalyticsConfiguration+Internal.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAnalyticsConfiguration+Internal.h new file mode 100644 index 0000000..be624b4 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAnalyticsConfiguration+Internal.h @@ -0,0 +1,49 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIRAnalyticsConfiguration.h" + +/// Values stored in analyticsEnabledState. Never alter these constants since they must match with +/// values persisted to disk. +typedef NS_ENUM(int64_t, FIRAnalyticsEnabledState) { + // 0 is the default value for keys not found stored in persisted config, so it cannot represent + // kFIRAnalyticsEnabledStateSetNo. It must represent kFIRAnalyticsEnabledStateNotSet. + kFIRAnalyticsEnabledStateNotSet = 0, + kFIRAnalyticsEnabledStateSetYes = 1, + kFIRAnalyticsEnabledStateSetNo = 2, +}; + +/// The user defaults key for the persisted measurementEnabledState value. FIRAPersistedConfig reads +/// measurementEnabledState using this same key. +static NSString *const kFIRAPersistedConfigMeasurementEnabledStateKey = + @"/google/measurement/measurement_enabled_state"; + +static NSString *const kFIRAnalyticsConfigurationSetEnabledNotification = + @"FIRAnalyticsConfigurationSetEnabledNotification"; +static NSString *const kFIRAnalyticsConfigurationSetMinimumSessionIntervalNotification = + @"FIRAnalyticsConfigurationSetMinimumSessionIntervalNotification"; +static NSString *const kFIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification = + @"FIRAnalyticsConfigurationSetSessionTimeoutIntervalNotification"; + +@interface FIRAnalyticsConfiguration (Internal) + +/// Sets whether analytics collection is enabled for this app on this device, and a flag to persist +/// the value or not. The setting should not be persisted if being set by the global data collection +/// flag. +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled + persistSetting:(BOOL)shouldPersist; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAppAssociationRegistration.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAppAssociationRegistration.h new file mode 100644 index 0000000..a1f8c41 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAppAssociationRegistration.h @@ -0,0 +1,48 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** @class FIRAppAssociationRegistration + @brief Manages object associations as a singleton-dependent: At most one object is + registered for any given host/key pair, and the object shall be created on-the-fly when + asked for. + */ +@interface FIRAppAssociationRegistration : NSObject + +/** @fn registeredObjectWithHost:key:creationBlock: + @brief Retrieves the registered object with a particular host and key. + @param host The host object. + @param key The key to specify the registered object on the host. + @param creationBlock The block to return the object to be registered if not already. + The block is executed immediately before this method returns if it is executed at all. + It can also be executed multiple times across different method invocations if previous + execution of the block returns @c nil. + @return The registered object for the host/key pair, or @c nil if no object is registered + and @c creationBlock returns @c nil. + @remarks The method is thread-safe but non-reentrant in the sense that attempting to call this + method again within the @c creationBlock with the same host/key pair raises an exception. + The registered object is retained by the host. + */ ++ (nullable ObjectType)registeredObjectWithHost:(id)host + key:(NSString *)key + creationBlock:(ObjectType _Nullable (^)(void))creationBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAppInternal.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAppInternal.h new file mode 100644 index 0000000..66979eb --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRAppInternal.h @@ -0,0 +1,214 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIRApp.h" +#import "FIRErrors.h" + +/** + * The internal interface to FIRApp. This is meant for first-party integrators, who need to receive + * FIRApp notifications, log info about the success or failure of their configuration, and access + * other internal functionality of FIRApp. + * + * TODO(b/28296561): Restructure this header. + */ +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, FIRConfigType) { + FIRConfigTypeCore = 1, + FIRConfigTypeSDK = 2, +}; + +/** + * Names of services provided by Firebase. + */ +extern NSString *const kFIRServiceAdMob; +extern NSString *const kFIRServiceAuth; +extern NSString *const kFIRServiceAuthUI; +extern NSString *const kFIRServiceCrash; +extern NSString *const kFIRServiceDatabase; +extern NSString *const kFIRServiceDynamicLinks; +extern NSString *const kFIRServiceInstanceID; +extern NSString *const kFIRServiceInvites; +extern NSString *const kFIRServiceMessaging; +extern NSString *const kFIRServiceMeasurement; +extern NSString *const kFIRServiceRemoteConfig; +extern NSString *const kFIRServiceStorage; + +/** + * Names of services provided by the Google pod, but logged by the Firebase pod. + */ +extern NSString *const kGGLServiceAnalytics; +extern NSString *const kGGLServiceSignIn; + +extern NSString *const kFIRDefaultAppName; +extern NSString *const kFIRAppReadyToConfigureSDKNotification; +extern NSString *const kFIRAppDeleteNotification; +extern NSString *const kFIRAppIsDefaultAppKey; +extern NSString *const kFIRAppNameKey; +extern NSString *const kFIRGoogleAppIDKey; + +/** + * The format string for the User Defaults key used for storing the data collection enabled flag. + * This includes formatting to append the Firebase App's name. + */ +extern NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat; + +/** + * The plist key used for storing the data collection enabled flag. + */ +extern NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey; + +/** + * A notification fired containing diagnostic information when SDK errors occur. + */ +extern NSString *const kFIRAppDiagnosticsNotification; + +/** @var FIRAuthStateDidChangeInternalNotification + @brief The name of the @c NSNotificationCenter notification which is posted when the auth state + changes (e.g. a new token has been produced, a user logs in or out). The object parameter of + the notification is a dictionary possibly containing the key: + @c FIRAuthStateDidChangeInternalNotificationTokenKey (the new access token.) If it does not + contain this key it indicates a sign-out event took place. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotification; + +/** @var FIRAuthStateDidChangeInternalNotificationTokenKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the new access token. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey; + +/** @var FIRAuthStateDidChangeInternalNotificationAppKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the FIRApp associated with the auth instance. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationAppKey; + +/** @var FIRAuthStateDidChangeInternalNotificationUIDKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the new user's UID (or nil if there is no longer a user signed in). + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey; + +/** @typedef FIRTokenCallback + @brief The type of block which gets called when a token is ready. + */ +typedef void (^FIRTokenCallback)(NSString *_Nullable token, NSError *_Nullable error); + +/** @typedef FIRAppGetTokenImplementation + @brief The type of block which can provide an implementation for the @c getTokenWithCallback: + method. + @param forceRefresh Forces the token to be refreshed. + @param callback The block which should be invoked when the async call completes. + */ +typedef void (^FIRAppGetTokenImplementation)(BOOL forceRefresh, FIRTokenCallback callback); + +/** @typedef FIRAppGetUID + @brief The type of block which can provide an implementation for the @c getUID method. + */ +typedef NSString *_Nullable (^FIRAppGetUIDImplementation)(void); + +@interface FIRApp () + +/** @property getTokenImplementation + @brief Gets or sets the block to use for the implementation of + @c getTokenForcingRefresh:withCallback: + */ +@property(nonatomic, copy) FIRAppGetTokenImplementation getTokenImplementation; + +/** @property getUIDImplementation + @brief Gets or sets the block to use for the implementation of @c getUID. + */ +@property(nonatomic, copy) FIRAppGetUIDImplementation getUIDImplementation; + +/** + * Creates an error for failing to configure a subspec service. This method is called by each + * FIRApp notification listener. + */ ++ (NSError *)errorForSubspecConfigurationFailureWithDomain:(NSString *)domain + errorCode:(FIRErrorCode)code + service:(NSString *)service + reason:(NSString *)reason; +/** + * Checks if the default app is configured without trying to configure it. + */ ++ (BOOL)isDefaultAppConfigured; + +/** + * Registers a given third-party library with the given version number to be reported for + * analyitcs. + * + * @param library Name of the library + * @param version Version of the library + */ +// clang-format off ++ (void)registerLibrary:(NSString *)library + withVersion:(NSString *)version NS_SWIFT_NAME(registerLibrary(_:version:)); +// clang-format on + +/** + * A concatenated string representing all the third-party libraries and version numbers. + */ ++ (NSString *)firebaseUserAgent; + +/** + * Used by each SDK to send logs about SDK configuration status to Clearcut. + */ +- (void)sendLogsWithServiceName:(NSString *)serviceName + version:(NSString *)version + error:(NSError *)error; + +/** + * Can be used by the unit tests in eack SDK to reset FIRApp. This method is thread unsafe. + */ ++ (void)resetApps; + +/** + * Can be used by the unit tests in each SDK to set customized options. + */ +- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options; + +/** @fn getTokenForcingRefresh:withCallback: + @brief Retrieves the Firebase authentication token, possibly refreshing it. + @param forceRefresh Forces a token refresh. Useful if the token becomes invalid for some reason + other than an expiration. + @param callback The block to invoke when the token is available. + */ +- (void)getTokenForcingRefresh:(BOOL)forceRefresh withCallback:(FIRTokenCallback)callback; + +/** + * Expose the UID of the current user for Firestore. + */ +- (nullable NSString *)getUID; + +/** + * WARNING: THIS SETTING DOES NOT WORK YET. IT WILL BE MOVED TO THE PUBLIC HEADER ONCE ALL SDKS + * CONFORM TO THIS PREFERENCE. DO NOT RELY ON IT. + * + * Gets or sets whether automatic data collection is enabled for all products. Defaults to `YES` + * unless `FirebaseAutomaticDataCollectionEnabled` is set to `NO` in your app's Info.plist. This + * value is persisted across runs of the app so that it can be set once when users have consented to + * collection. + */ +@property(nonatomic, readwrite, getter=isAutomaticDataCollectionEnabled) + BOOL automaticDataCollectionEnabled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRBundleUtil.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRBundleUtil.h new file mode 100644 index 0000000..c458a2c --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRBundleUtil.h @@ -0,0 +1,52 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/** + * This class provides utilities for accessing resources in bundles. + */ +@interface FIRBundleUtil : NSObject + +/** + * Finds all relevant bundles, starting with [NSBundle mainBundle]. + */ ++ (NSArray *)relevantBundles; + +/** + * Reads the options dictionary from one of the provided bundles. + * + * @param resourceName The resource name, e.g. @"GoogleService-Info". + * @param fileType The file type (extension), e.g. @"plist". + * @param bundles The bundles to expect, in priority order. See also + * +[FIRBundleUtil relevantBundles]. + */ ++ (NSString *)optionsDictionaryPathWithResourceName:(NSString *)resourceName + andFileType:(NSString *)fileType + inBundles:(NSArray *)bundles; + +/** + * Finds URL schemes defined in all relevant bundles, starting with those from + * [NSBundle mainBundle]. + */ ++ (NSArray *)relevantURLSchemes; + +/** + * Checks if the bundle identifier exists in the given bundles. + */ ++ (BOOL)hasBundleIdentifier:(NSString *)bundleIdentifier inBundles:(NSArray *)bundles; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRErrorCode.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRErrorCode.h new file mode 100644 index 0000000..01d3c56 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRErrorCode.h @@ -0,0 +1,55 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Error codes in Firebase error domain. */ +typedef NS_ENUM(NSInteger, FIRErrorCode) { + /** + * Unknown error. + */ + FIRErrorCodeUnknown = 0, + /** + * Loading data from the GoogleService-Info.plist file failed. This is a fatal error and should + * not be ignored. Further calls to the API will fail and/or possibly cause crashes. + */ + FIRErrorCodeInvalidPlistFile = -100, + + /** + * Validating the Google App ID format failed. + */ + FIRErrorCodeInvalidAppID = -101, + + /** + * Error code for failing to configure a specific service. + */ + FIRErrorCodeAdMobFailed = -110, + FIRErrorCodeAppInviteFailed = -112, + FIRErrorCodeCloudMessagingFailed = -113, + FIRErrorCodeConfigFailed = -114, + FIRErrorCodeDatabaseFailed = -115, + FIRErrorCodeCrashReportingFailed = -118, + FIRErrorCodeDurableDeepLinkFailed = -119, + FIRErrorCodeAuthFailed = -120, + FIRErrorCodeInstanceIDFailed = -121, + FIRErrorCodeStorageFailed = -123, + + /** + * Error codes returned by Dynamic Links + */ + FIRErrorCodeDynamicLinksStrongMatchNotAvailable = -124, + FIRErrorCodeDynamicLinksManualRetrievalNotEnabled = -125, + FIRErrorCodeDynamicLinksPendingLinkOnlyAvailableAtFirstLaunch = -126, + FIRErrorCodeDynamicLinksPendingLinkRetrievalAlreadyRunning = -127, +}; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRErrors.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRErrors.h new file mode 100644 index 0000000..cf69252 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRErrors.h @@ -0,0 +1,33 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#include "FIRErrorCode.h" + +extern NSString *const kFirebaseErrorDomain; +extern NSString *const kFirebaseAdMobErrorDomain; +extern NSString *const kFirebaseAppInviteErrorDomain; +extern NSString *const kFirebaseAuthErrorDomain; +extern NSString *const kFirebaseCloudMessagingErrorDomain; +extern NSString *const kFirebaseConfigErrorDomain; +extern NSString *const kFirebaseCoreErrorDomain; +extern NSString *const kFirebaseCrashReportingErrorDomain; +extern NSString *const kFirebaseDatabaseErrorDomain; +extern NSString *const kFirebaseDurableDeepLinkErrorDomain; +extern NSString *const kFirebaseInstanceIDErrorDomain; +extern NSString *const kFirebasePerfErrorDomain; +extern NSString *const kFirebaseStorageErrorDomain; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRLogger.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRLogger.h new file mode 100644 index 0000000..a538199 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRLogger.h @@ -0,0 +1,159 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRLoggerLevel.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * The Firebase services used in Firebase logger. + */ +typedef NSString *const FIRLoggerService; + +extern FIRLoggerService kFIRLoggerABTesting; +extern FIRLoggerService kFIRLoggerAdMob; +extern FIRLoggerService kFIRLoggerAnalytics; +extern FIRLoggerService kFIRLoggerAuth; +extern FIRLoggerService kFIRLoggerCore; +extern FIRLoggerService kFIRLoggerCrash; +extern FIRLoggerService kFIRLoggerDatabase; +extern FIRLoggerService kFIRLoggerDynamicLinks; +extern FIRLoggerService kFIRLoggerFirestore; +extern FIRLoggerService kFIRLoggerInstanceID; +extern FIRLoggerService kFIRLoggerInvites; +extern FIRLoggerService kFIRLoggerMLKit; +extern FIRLoggerService kFIRLoggerMessaging; +extern FIRLoggerService kFIRLoggerPerf; +extern FIRLoggerService kFIRLoggerRemoteConfig; +extern FIRLoggerService kFIRLoggerStorage; +extern FIRLoggerService kFIRLoggerSwizzler; + +/** + * The key used to store the logger's error count. + */ +extern NSString *const kFIRLoggerErrorCountKey; + +/** + * The key used to store the logger's warning count. + */ +extern NSString *const kFIRLoggerWarningCountKey; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/** + * Enables or disables Analytics debug mode. + * If set to YES, the logging level for Analytics will be set to FIRLoggerLevelDebug. + * Enabling the debug mode has no effect if the app is running from App Store. + * (required) analytics debug mode flag. + */ +void FIRSetAnalyticsDebugMode(BOOL analyticsDebugMode); + +/** + * Changes the default logging level of FIRLoggerLevelNotice to a user-specified level. + * The default level cannot be set above FIRLoggerLevelNotice if the app is running from App Store. + * (required) log level (one of the FIRLoggerLevel enum values). + */ +void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel); + +/** + * Checks if the specified logger level is loggable given the current settings. + * (required) log level (one of the FIRLoggerLevel enum values). + * (required) whether or not this function is called from the Analytics component. + */ +BOOL FIRIsLoggableLevel(FIRLoggerLevel loggerLevel, BOOL analyticsComponent); + +/** + * Logs a message to the Xcode console and the device log. If running from AppStore, will + * not log any messages with a level higher than FIRLoggerLevelNotice to avoid log spamming. + * (required) log level (one of the FIRLoggerLevel enum values). + * (required) service name of type FIRLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ +extern void FIRLogBasic(FIRLoggerLevel level, + FIRLoggerService service, + NSString *messageCode, + NSString *message, +// On 64-bit simulators, va_list is not a pointer, so cannot be marked nullable +// See: http://stackoverflow.com/q/29095469 +#if __LP64__ && TARGET_OS_SIMULATOR || TARGET_OS_OSX + va_list args_ptr +#else + va_list _Nullable args_ptr +#endif +); + +/** + * The following functions accept the following parameters in order: + * (required) service name of type FIRLoggerService. + * (required) message code starting from "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * See go/firebase-log-proposal for details. + * (required) message string which can be a format string. + * (optional) the list of arguments to substitute into the format string. + * Example usage: + * FIRLogError(kFIRLoggerCore, @"I-COR000001", @"Configuration of %@ failed.", app.name); + */ +extern void FIRLogError(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogWarning(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogNotice(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogInfo(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogDebug(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +@interface FIRLoggerWrapper : NSObject + +/** + * Objective-C wrapper for FIRLogBasic to allow weak linking to FIRLogger + * (required) log level (one of the FIRLoggerLevel enum values). + * (required) service name of type FIRLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ + ++ (void)logWithLevel:(FIRLoggerLevel)level + withService:(FIRLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRMutableDictionary.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRMutableDictionary.h new file mode 100644 index 0000000..6829dbc --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRMutableDictionary.h @@ -0,0 +1,46 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/// A mutable dictionary that provides atomic accessor and mutators. +@interface FIRMutableDictionary : NSObject + +/// Returns an object given a key in the dictionary or nil if not found. +- (id)objectForKey:(id)key; + +/// Updates the object given its key or adds it to the dictionary if it is not in the dictionary. +- (void)setObject:(id)object forKey:(id)key; + +/// Removes the object given its session ID from the dictionary. +- (void)removeObjectForKey:(id)key; + +/// Removes all objects. +- (void)removeAllObjects; + +/// Returns the number of current objects in the dictionary. +- (NSUInteger)count; + +/// Returns an object given a key in the dictionary or nil if not found. +- (id)objectForKeyedSubscript:(id)key; + +/// Updates the object given its key or adds it to the dictionary if it is not in the dictionary. +- (void)setObject:(id)obj forKeyedSubscript:(id)key; + +/// Returns the immutable dictionary. +- (NSDictionary *)dictionary; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetwork.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetwork.h new file mode 100644 index 0000000..32be35a --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetwork.h @@ -0,0 +1,87 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRNetworkConstants.h" +#import "FIRNetworkLoggerProtocol.h" +#import "FIRNetworkURLSession.h" + +/// Delegate protocol for FIRNetwork events. +@protocol FIRNetworkReachabilityDelegate + +/// Tells the delegate to handle events when the network reachability changes to connected or not +/// connected. +- (void)reachabilityDidChange; + +@end + +/// The Network component that provides network status and handles network requests and responses. +/// This is not thread safe. +/// +/// NOTE: +/// User must add FIRAnalytics handleEventsForBackgroundURLSessionID:completionHandler to the +/// AppDelegate application:handleEventsForBackgroundURLSession:completionHandler: +@interface FIRNetwork : NSObject + +/// Indicates if network connectivity is available. +@property(nonatomic, readonly, getter=isNetworkConnected) BOOL networkConnected; + +/// Indicates if there are any uploads in progress. +@property(nonatomic, readonly, getter=hasUploadInProgress) BOOL uploadInProgress; + +/// An optional delegate that can be used in the event when network reachability changes. +@property(nonatomic, weak) id reachabilityDelegate; + +/// An optional delegate that can be used to log messages, warnings or errors that occur in the +/// network operations. +@property(nonatomic, weak) id loggerDelegate; + +/// Indicates whether the logger should display debug messages. +@property(nonatomic, assign) BOOL isDebugModeEnabled; + +/// The time interval in seconds for the network request to timeout. +@property(nonatomic, assign) NSTimeInterval timeoutInterval; + +/// Initializes with the default reachability host. +- (instancetype)init; + +/// Initializes with a custom reachability host. +- (instancetype)initWithReachabilityHost:(NSString *)reachabilityHost; + +/// Handles events when background session with the given ID has finished. ++ (void)handleEventsForBackgroundURLSessionID:(NSString *)sessionID + completionHandler:(FIRNetworkSystemCompletionHandler)completionHandler; + +/// Compresses and sends a POST request with the provided data to the URL. The session will be +/// background session if usingBackgroundSession is YES. Otherwise, the POST session is default +/// session. Returns a session ID or nil if an error occurs. +- (NSString *)postURL:(NSURL *)url + payload:(NSData *)payload + queue:(dispatch_queue_t)queue + usingBackgroundSession:(BOOL)usingBackgroundSession + completionHandler:(FIRNetworkCompletionHandler)handler; + +/// Sends a GET request with the provided data to the URL. The session will be background session +/// if usingBackgroundSession is YES. Otherwise, the GET session is default session. Returns a +/// session ID or nil if an error occurs. +- (NSString *)getURL:(NSURL *)url + headers:(NSDictionary *)headers + queue:(dispatch_queue_t)queue + usingBackgroundSession:(BOOL)usingBackgroundSession + completionHandler:(FIRNetworkCompletionHandler)handler; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkConstants.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkConstants.h new file mode 100644 index 0000000..d318581 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkConstants.h @@ -0,0 +1,75 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/// Error codes in Firebase Network error domain. +/// Note: these error codes should never change. It would make it harder to decode the errors if +/// we inadvertently altered any of these codes in a future SDK version. +typedef NS_ENUM(NSInteger, FIRNetworkErrorCode) { + /// Unknown error. + FIRNetworkErrorCodeUnknown = 0, + /// Error occurs when the request URL is invalid. + FIRErrorCodeNetworkInvalidURL = 1, + /// Error occurs when request cannot be constructed. + FIRErrorCodeNetworkRequestCreation = 2, + /// Error occurs when payload cannot be compressed. + FIRErrorCodeNetworkPayloadCompression = 3, + /// Error occurs when session task cannot be created. + FIRErrorCodeNetworkSessionTaskCreation = 4, + /// Error occurs when there is no response. + FIRErrorCodeNetworkInvalidResponse = 5 +}; + +#pragma mark - Network constants + +/// The prefix of the ID of the background session. +extern NSString *const kFIRNetworkBackgroundSessionConfigIDPrefix; + +/// The sub directory to store the files of data that is being uploaded in the background. +extern NSString *const kFIRNetworkApplicationSupportSubdirectory; + +/// Name of the temporary directory that stores files for background uploading. +extern NSString *const kFIRNetworkTempDirectoryName; + +/// The period when the temporary uploading file can stay. +extern const NSTimeInterval kFIRNetworkTempFolderExpireTime; + +/// The default network request timeout interval. +extern const NSTimeInterval kFIRNetworkTimeOutInterval; + +/// The host to check the reachability of the network. +extern NSString *const kFIRNetworkReachabilityHost; + +/// The key to get the error context of the UserInfo. +extern NSString *const kFIRNetworkErrorContext; + +#pragma mark - Network Status Code + +extern const int kFIRNetworkHTTPStatusOK; +extern const int kFIRNetworkHTTPStatusNoContent; +extern const int kFIRNetworkHTTPStatusCodeMultipleChoices; +extern const int kFIRNetworkHTTPStatusCodeMovedPermanently; +extern const int kFIRNetworkHTTPStatusCodeFound; +extern const int kFIRNetworkHTTPStatusCodeNotModified; +extern const int kFIRNetworkHTTPStatusCodeMovedTemporarily; +extern const int kFIRNetworkHTTPStatusCodeNotFound; +extern const int kFIRNetworkHTTPStatusCodeCannotAcceptTraffic; +extern const int kFIRNetworkHTTPStatusCodeUnavailable; + +#pragma mark - Error Domain + +extern NSString *const kFIRNetworkErrorDomain; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkLoggerProtocol.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkLoggerProtocol.h new file mode 100644 index 0000000..add70fc --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkLoggerProtocol.h @@ -0,0 +1,50 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRLoggerLevel.h" +#import "FIRNetworkMessageCode.h" + +/// The log levels used by FIRNetworkLogger. +typedef NS_ENUM(NSInteger, FIRNetworkLogLevel) { + kFIRNetworkLogLevelError = FIRLoggerLevelError, + kFIRNetworkLogLevelWarning = FIRLoggerLevelWarning, + kFIRNetworkLogLevelInfo = FIRLoggerLevelInfo, + kFIRNetworkLogLevelDebug = FIRLoggerLevelDebug, +}; + +@protocol FIRNetworkLoggerDelegate + +@required +/// Tells the delegate to log a message with an array of contexts and the log level. +- (void)firNetwork_logWithLevel:(FIRNetworkLogLevel)logLevel + messageCode:(FIRNetworkMessageCode)messageCode + message:(NSString *)message + contexts:(NSArray *)contexts; + +/// Tells the delegate to log a message with a context and the log level. +- (void)firNetwork_logWithLevel:(FIRNetworkLogLevel)logLevel + messageCode:(FIRNetworkMessageCode)messageCode + message:(NSString *)message + context:(id)context; + +/// Tells the delegate to log a message with the log level. +- (void)firNetwork_logWithLevel:(FIRNetworkLogLevel)logLevel + messageCode:(FIRNetworkMessageCode)messageCode + message:(NSString *)message; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkMessageCode.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkMessageCode.h new file mode 100644 index 0000000..30f562f --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkMessageCode.h @@ -0,0 +1,52 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Make sure these codes do not overlap with any contained in the FIRAMessageCode enum. +typedef NS_ENUM(NSInteger, FIRNetworkMessageCode) { + // FIRNetwork.m + kFIRNetworkMessageCodeNetwork000 = 900000, // I-NET900000 + kFIRNetworkMessageCodeNetwork001 = 900001, // I-NET900001 + kFIRNetworkMessageCodeNetwork002 = 900002, // I-NET900002 + kFIRNetworkMessageCodeNetwork003 = 900003, // I-NET900003 + // FIRNetworkURLSession.m + kFIRNetworkMessageCodeURLSession000 = 901000, // I-NET901000 + kFIRNetworkMessageCodeURLSession001 = 901001, // I-NET901001 + kFIRNetworkMessageCodeURLSession002 = 901002, // I-NET901002 + kFIRNetworkMessageCodeURLSession003 = 901003, // I-NET901003 + kFIRNetworkMessageCodeURLSession004 = 901004, // I-NET901004 + kFIRNetworkMessageCodeURLSession005 = 901005, // I-NET901005 + kFIRNetworkMessageCodeURLSession006 = 901006, // I-NET901006 + kFIRNetworkMessageCodeURLSession007 = 901007, // I-NET901007 + kFIRNetworkMessageCodeURLSession008 = 901008, // I-NET901008 + kFIRNetworkMessageCodeURLSession009 = 901009, // I-NET901009 + kFIRNetworkMessageCodeURLSession010 = 901010, // I-NET901010 + kFIRNetworkMessageCodeURLSession011 = 901011, // I-NET901011 + kFIRNetworkMessageCodeURLSession012 = 901012, // I-NET901012 + kFIRNetworkMessageCodeURLSession013 = 901013, // I-NET901013 + kFIRNetworkMessageCodeURLSession014 = 901014, // I-NET901014 + kFIRNetworkMessageCodeURLSession015 = 901015, // I-NET901015 + kFIRNetworkMessageCodeURLSession016 = 901016, // I-NET901016 + kFIRNetworkMessageCodeURLSession017 = 901017, // I-NET901017 + kFIRNetworkMessageCodeURLSession018 = 901018, // I-NET901018 + // FIRReachabilityChecker.m + kFIRNetworkMessageCodeReachabilityChecker000 = 902000, // I-NET902000 + kFIRNetworkMessageCodeReachabilityChecker001 = 902001, // I-NET902001 + kFIRNetworkMessageCodeReachabilityChecker002 = 902002, // I-NET902002 + kFIRNetworkMessageCodeReachabilityChecker003 = 902003, // I-NET902003 + kFIRNetworkMessageCodeReachabilityChecker004 = 902004, // I-NET902004 + kFIRNetworkMessageCodeReachabilityChecker005 = 902005, // I-NET902005 + kFIRNetworkMessageCodeReachabilityChecker006 = 902006, // I-NET902006 +}; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkURLSession.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkURLSession.h new file mode 100644 index 0000000..a51b8a9 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRNetworkURLSession.h @@ -0,0 +1,60 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRNetworkLoggerProtocol.h" + +typedef void (^FIRNetworkCompletionHandler)(NSHTTPURLResponse *response, + NSData *data, + NSError *error); +typedef void (^FIRNetworkURLSessionCompletionHandler)(NSHTTPURLResponse *response, + NSData *data, + NSString *sessionID, + NSError *error); +typedef void (^FIRNetworkSystemCompletionHandler)(void); + +/// The protocol that uses NSURLSession for iOS >= 7.0 to handle requests and responses. +@interface FIRNetworkURLSession + : NSObject + +/// Indicates whether the background network is enabled. Default value is NO. +@property(nonatomic, getter=isBackgroundNetworkEnabled) BOOL backgroundNetworkEnabled; + +/// The logger delegate to log message, errors or warnings that occur during the network operations. +@property(nonatomic, weak) id loggerDelegate; + +/// Calls the system provided completion handler after the background session is finished. ++ (void)handleEventsForBackgroundURLSessionID:(NSString *)sessionID + completionHandler:(FIRNetworkSystemCompletionHandler)completionHandler; + +/// Initializes with logger delegate. +- (instancetype)initWithNetworkLoggerDelegate:(id)networkLoggerDelegate + NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +/// Sends an asynchronous POST request and calls the provided completion handler when the request +/// completes or when errors occur, and returns an ID of the session/connection. +- (NSString *)sessionIDFromAsyncPOSTRequest:(NSURLRequest *)request + completionHandler:(FIRNetworkURLSessionCompletionHandler)handler; + +/// Sends an asynchronous GET request and calls the provided completion handler when the request +/// completes or when errors occur, and returns an ID of the session. +- (NSString *)sessionIDFromAsyncGETRequest:(NSURLRequest *)request + completionHandler:(FIRNetworkURLSessionCompletionHandler)handler; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIROptionsInternal.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIROptionsInternal.h new file mode 100644 index 0000000..7bb40fc --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIROptionsInternal.h @@ -0,0 +1,114 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIROptions.h" + +/** + * Keys for the strings in the plist file. + */ +extern NSString *const kFIRAPIKey; +extern NSString *const kFIRTrackingID; +extern NSString *const kFIRGoogleAppID; +extern NSString *const kFIRClientID; +extern NSString *const kFIRGCMSenderID; +extern NSString *const kFIRAndroidClientID; +extern NSString *const kFIRDatabaseURL; +extern NSString *const kFIRStorageBucket; +extern NSString *const kFIRBundleID; +extern NSString *const kFIRProjectID; + +/** + * Keys for the plist file name + */ +extern NSString *const kServiceInfoFileName; + +extern NSString *const kServiceInfoFileType; + +/** + * This header file exposes the initialization of FIROptions to internal use. + */ +@interface FIROptions () + +/** + * resetDefaultOptions and initInternalWithOptionsDictionary: are exposed only for unit tests. + */ ++ (void)resetDefaultOptions; + +/** + * Initializes the options with dictionary. The above strings are the keys of the dictionary. + * This is the designated initializer. + */ +- (instancetype)initInternalWithOptionsDictionary:(NSDictionary *)serviceInfoDictionary; + +/** + * defaultOptions and defaultOptionsDictionary are exposed in order to be used in FIRApp and + * other first party services. + */ ++ (FIROptions *)defaultOptions; + ++ (NSDictionary *)defaultOptionsDictionary; + +/** + * Indicates whether or not Analytics collection was explicitly enabled via a plist flag or at + * runtime. + */ +@property(nonatomic, readonly) BOOL isAnalyticsCollectionExpicitlySet; + +/** + * Whether or not Analytics Collection was enabled. Analytics Collection is enabled unless + * explicitly disabled in GoogleService-Info.plist. + */ +@property(nonatomic, readonly) BOOL isAnalyticsCollectionEnabled; + +/** + * Whether or not Analytics Collection was completely disabled. If YES, then + * isAnalyticsCollectionEnabled will be NO. + */ +@property(nonatomic, readonly) BOOL isAnalyticsCollectionDeactivated; + +/** + * The version ID of the client library, e.g. @"1100000". + */ +@property(nonatomic, readonly, copy) NSString *libraryVersionID; + +/** + * The flag indicating whether this object was constructed with the values in the default plist + * file. + */ +@property(nonatomic) BOOL usingOptionsFromDefaultPlist; + +/** + * Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in + * GoogleService-Info.plist. + */ +@property(nonatomic, readonly) BOOL isMeasurementEnabled; + +/** + * Whether or not Analytics was enabled in the developer console. + */ +@property(nonatomic, readonly) BOOL isAnalyticsEnabled; + +/** + * Whether or not SignIn was enabled in the developer console. + */ +@property(nonatomic, readonly) BOOL isSignInEnabled; + +/** + * Whether or not editing is locked. This should occur after FIROptions has been set on a FIRApp. + */ +@property(nonatomic, getter=isEditingLocked) BOOL editingLocked; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRReachabilityChecker+Internal.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRReachabilityChecker+Internal.h new file mode 100644 index 0000000..f82d103 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRReachabilityChecker+Internal.h @@ -0,0 +1,47 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIRReachabilityChecker.h" + +typedef SCNetworkReachabilityRef (*FIRReachabilityCreateWithNameFn)(CFAllocatorRef allocator, + const char *host); + +typedef Boolean (*FIRReachabilitySetCallbackFn)(SCNetworkReachabilityRef target, + SCNetworkReachabilityCallBack callback, + SCNetworkReachabilityContext *context); +typedef Boolean (*FIRReachabilityScheduleWithRunLoopFn)(SCNetworkReachabilityRef target, + CFRunLoopRef runLoop, + CFStringRef runLoopMode); +typedef Boolean (*FIRReachabilityUnscheduleFromRunLoopFn)(SCNetworkReachabilityRef target, + CFRunLoopRef runLoop, + CFStringRef runLoopMode); + +typedef void (*FIRReachabilityReleaseFn)(CFTypeRef cf); + +struct FIRReachabilityApi { + FIRReachabilityCreateWithNameFn createWithNameFn; + FIRReachabilitySetCallbackFn setCallbackFn; + FIRReachabilityScheduleWithRunLoopFn scheduleWithRunLoopFn; + FIRReachabilityUnscheduleFromRunLoopFn unscheduleFromRunLoopFn; + FIRReachabilityReleaseFn releaseFn; +}; + +@interface FIRReachabilityChecker (Internal) + +- (const struct FIRReachabilityApi *)reachabilityApi; +- (void)setReachabilityApi:(const struct FIRReachabilityApi *)reachabilityApi; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRReachabilityChecker.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRReachabilityChecker.h new file mode 100644 index 0000000..3a6a531 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRReachabilityChecker.h @@ -0,0 +1,83 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +/// Reachability Status +typedef enum { + kFIRReachabilityUnknown, ///< Have not yet checked or been notified whether host is reachable. + kFIRReachabilityNotReachable, ///< Host is not reachable. + kFIRReachabilityViaWifi, ///< Host is reachable via Wifi. + kFIRReachabilityViaCellular, ///< Host is reachable via cellular. +} FIRReachabilityStatus; + +const NSString *FIRReachabilityStatusString(FIRReachabilityStatus status); + +@class FIRReachabilityChecker; +@protocol FIRNetworkLoggerDelegate; + +/// Google Analytics iOS Reachability Checker. +@protocol FIRReachabilityDelegate +@required +/// Called when network status has changed. +- (void)reachability:(FIRReachabilityChecker *)reachability + statusChanged:(FIRReachabilityStatus)status; +@end + +/// Google Analytics iOS Network Status Checker. +@interface FIRReachabilityChecker : NSObject + +/// The last known reachability status, or FIRReachabilityStatusUnknown if the +/// checker is not active. +@property(nonatomic, readonly) FIRReachabilityStatus reachabilityStatus; +/// The host to which reachability status is to be checked. +@property(nonatomic, copy, readonly) NSString *host; +/// The delegate to be notified of reachability status changes. +@property(nonatomic, weak) id reachabilityDelegate; +/// The delegate to be notified to log messages. +@property(nonatomic, weak) id loggerDelegate; +/// `YES` if the reachability checker is active, `NO` otherwise. +@property(nonatomic, readonly) BOOL isActive; + +/// Initialize the reachability checker. Note that you must call start to begin checking for and +/// receiving notifications about network status changes. +/// +/// @param reachabilityDelegate The delegate to be notified when reachability status to host +/// changes. +/// +/// @param loggerDelegate The delegate to send log messages to. +/// +/// @param host The name of the host. +/// +- (instancetype)initWithReachabilityDelegate:(id)reachabilityDelegate + loggerDelegate:(id)loggerDelegate + withHost:(NSString *)host; + +- (instancetype)init NS_UNAVAILABLE; + +/// Start checking for reachability to the specified host. This has no effect if the status +/// checker is already checking for connectivity. +/// +/// @return `YES` if initiating status checking was successful or the status checking has already +/// been initiated, `NO` otherwise. +- (BOOL)start; + +/// Stop checking for reachability to the specified host. This has no effect if the status +/// checker is not checking for connectivity. +- (void)stop; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRVersion.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRVersion.h new file mode 100644 index 0000000..cec0994 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Private/FIRVersion.h @@ -0,0 +1,23 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/** The version of the Firebase SDK. */ +FOUNDATION_EXPORT const unsigned char *const FIRVersionString; + +/** The version of the FirebaseCore Component. */ +FOUNDATION_EXPORT const unsigned char *const FIRCoreVersionString; diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRAnalyticsConfiguration.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRAnalyticsConfiguration.h new file mode 100644 index 0000000..ca1d32c --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRAnalyticsConfiguration.h @@ -0,0 +1,52 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides configuration fields for Firebase Analytics. + */ +NS_SWIFT_NAME(AnalyticsConfiguration) +@interface FIRAnalyticsConfiguration : NSObject + +/** + * Returns the shared instance of FIRAnalyticsConfiguration. + */ ++ (FIRAnalyticsConfiguration *)sharedInstance NS_SWIFT_NAME(shared()); + +/** + * Sets the minimum engagement time in seconds required to start a new session. The default value + * is 10 seconds. + */ +- (void)setMinimumSessionInterval:(NSTimeInterval)minimumSessionInterval; + +/** + * Sets the interval of inactivity in seconds that terminates the current session. The default + * value is 1800 seconds (30 minutes). + */ +- (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval; + +/** + * Sets whether analytics collection is enabled for this app on this device. This setting is + * persisted across app sessions. By default it is enabled. + */ +- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h new file mode 100644 index 0000000..fb18b75 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h @@ -0,0 +1,118 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FIROptions; + +NS_ASSUME_NONNULL_BEGIN + +/** A block that takes a BOOL and has no return value. */ +typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback); + +/** + * The entry point of Firebase SDKs. + * + * Initialize and configure FIRApp using +[FIRApp configure] + * or other customized ways as shown below. + * + * The logging system has two modes: default mode and debug mode. In default mode, only logs with + * log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent + * to device. The log levels that Firebase uses are consistent with the ASL log levels. + * + * Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this + * argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, + * further executions of the application will also be in debug mode. In order to return to default + * mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled. + * + * It is also possible to change the default logging level in code by calling setLoggerLevel: on + * the FIRConfiguration interface. + */ +NS_SWIFT_NAME(FirebaseApp) +@interface FIRApp : NSObject + +/** + * Configures a default Firebase app. Raises an exception if any configuration step fails. The + * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched + * and before using Firebase services. This method is thread safe and contains synchronous file I/O + * (reading GoogleService-Info.plist from disk). + */ ++ (void)configure; + +/** + * Configures the default Firebase app with the provided options. The default app is named + * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread + * safe. + * + * @param options The Firebase application options used to configure the service. + */ ++ (void)configureWithOptions:(FIROptions *)options NS_SWIFT_NAME(configure(options:)); + +/** + * Configures a Firebase app with the given name and options. Raises an exception if any + * configuration step fails. This method is thread safe. + * + * @param name The application's name given by the developer. The name should should only contain + Letters, Numbers and Underscore. + * @param options The Firebase application options used to configure the services. + */ +// clang-format off ++ (void)configureWithName:(NSString *)name + options:(FIROptions *)options NS_SWIFT_NAME(configure(name:options:)); +// clang-format on + +/** + * Returns the default app, or nil if the default app does not exist. + */ ++ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app()); + +/** + * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. + * This method is thread safe. + */ ++ (nullable FIRApp *)appNamed:(NSString *)name NS_SWIFT_NAME(app(name:)); + +/** + * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This + * method is thread safe. + */ +@property(class, readonly, nullable) NSDictionary *allApps; + +/** + * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for + * future use. This method is thread safe. + */ +- (void)deleteApp:(FIRAppVoidBoolCallback)completion; + +/** + * FIRApp instances should not be initialized directly. Call +[FIRApp configure], + * +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly. + */ +- (instancetype)init NS_UNAVAILABLE; + +/** + * Gets the name of this app. + */ +@property(nonatomic, copy, readonly) NSString *name; + +/** + * Gets a copy of the options for this app. These are non-modifiable. + */ +@property(nonatomic, copy, readonly) FIROptions *options; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRConfiguration.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRConfiguration.h new file mode 100644 index 0000000..95bba5e --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRConfiguration.h @@ -0,0 +1,50 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRAnalyticsConfiguration.h" +#import "FIRLoggerLevel.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * This interface provides global level properties that the developer can tweak, and the singleton + * of the Firebase Analytics configuration class. + */ +NS_SWIFT_NAME(FirebaseConfiguration) +@interface FIRConfiguration : NSObject + +/** Returns the shared configuration object. */ +@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance NS_SWIFT_NAME(shared); + +/** The configuration class for Firebase Analytics. */ +@property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration; + +/** + * Sets the logging level for internal Firebase logging. Firebase will only log messages + * that are logged at or below loggerLevel. The messages are logged both to the Xcode + * console and to the device's log. Note that if an app is running from AppStore, it will + * never log above FIRLoggerLevelNotice even if loggerLevel is set to a higher (more verbose) + * setting. + * + * @param loggerLevel The maximum logging level. The default level is set to FIRLoggerLevelNotice. + */ +- (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRLoggerLevel.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRLoggerLevel.h new file mode 100644 index 0000000..8b6579f --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIRLoggerLevel.h @@ -0,0 +1,35 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The log levels used by internal logging. + */ +typedef NS_ENUM(NSInteger, FIRLoggerLevel) { + /** Error level, matches ASL_LEVEL_ERR. */ + FIRLoggerLevelError = 3, + /** Warning level, matches ASL_LEVEL_WARNING. */ + FIRLoggerLevelWarning = 4, + /** Notice level, matches ASL_LEVEL_NOTICE. */ + FIRLoggerLevelNotice = 5, + /** Info level, matches ASL_LEVEL_NOTICE. */ + FIRLoggerLevelInfo = 6, + /** Debug level, matches ASL_LEVEL_DEBUG. */ + FIRLoggerLevelDebug = 7, + /** Minimum log level. */ + FIRLoggerLevelMin = FIRLoggerLevelError, + /** Maximum log level. */ + FIRLoggerLevelMax = FIRLoggerLevelDebug +} NS_SWIFT_NAME(FirebaseLoggerLevel); diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIROptions.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIROptions.h new file mode 100644 index 0000000..87a01dd --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FIROptions.h @@ -0,0 +1,116 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class provides constant fields of Google APIs. + */ +NS_SWIFT_NAME(FirebaseOptions) +@interface FIROptions : NSObject + +/** + * Returns the default options. The first time this is called it synchronously reads + * GoogleService-Info.plist from disk. + */ ++ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions()); + +/** + * An iOS API key used for authenticating requests from your app, e.g. + * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. + */ +@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey); + +/** + * The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set + * manually or in a plist. + */ +@property(nonatomic, copy) NSString *bundleID; + +/** + * The OAuth2 client ID for iOS application used to authenticate Google users, for example + * @"12345.apps.googleusercontent.com", used for signing in with Google. + */ +@property(nonatomic, copy, nullable) NSString *clientID; + +/** + * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. + */ +@property(nonatomic, copy, nullable) NSString *trackingID; + +/** + * The Project Number from the Google Developer's console, for example @"012345678901", used to + * configure Google Cloud Messaging. + */ +@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID); + +/** + * The Project ID from the Firebase console, for example @"abc-xyz-123". + */ +@property(nonatomic, copy, nullable) NSString *projectID; + +/** + * The Android client ID used in Google AppInvite when an iOS app has its Android version, for + * example @"12345.apps.googleusercontent.com". + */ +@property(nonatomic, copy, nullable) NSString *androidClientID; + +/** + * The Google App ID that is used to uniquely identify an instance of an app. + */ +@property(nonatomic, copy) NSString *googleAppID; + +/** + * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". + */ +@property(nonatomic, copy, nullable) NSString *databaseURL; + +/** + * The URL scheme used to set up Durable Deep Link service. + */ +@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; + +/** + * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". + */ +@property(nonatomic, copy, nullable) NSString *storageBucket; + +/** + * Initializes a customized instance of FIROptions from the file at the given plist file path. This + * will read the file synchronously from disk. + * For example, + * NSString *filePath = + * [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; + * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; + * Returns nil if the plist file does not exist or is invalid. + */ +- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath; + +/** + * Initializes a customized instance of FIROptions with required fields. Use the mutable properties + * to modify fields for configuring specific services. + */ +// clang-format off +- (instancetype)initWithGoogleAppID:(NSString *)googleAppID + GCMSenderID:(NSString *)GCMSenderID + NS_SWIFT_NAME(init(googleAppID:gcmSenderID:)); +// clang-format on + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FirebaseCore.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FirebaseCore.h new file mode 100644 index 0000000..fa26f69 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/Public/FirebaseCore.h @@ -0,0 +1,21 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIRAnalyticsConfiguration.h" +#import "FIRApp.h" +#import "FIRConfiguration.h" +#import "FIRLoggerLevel.h" +#import "FIROptions.h" diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/third_party/FIRAppEnvironmentUtil.h b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/third_party/FIRAppEnvironmentUtil.h new file mode 100644 index 0000000..09ee504 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/third_party/FIRAppEnvironmentUtil.h @@ -0,0 +1,43 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@interface FIRAppEnvironmentUtil : NSObject + +/// Indicates whether the app is from Apple Store or not. Returns NO if the app is on simulator, +/// development environment or sideloaded. ++ (BOOL)isFromAppStore; + +/// Indicates whether the app is a Testflight app. Returns YES if the app has sandbox receipt. +/// Returns NO otherwise. ++ (BOOL)isAppStoreReceiptSandbox; + +/// Indicates whether the app is on simulator or not at runtime depending on the device +/// architecture. ++ (BOOL)isSimulator; + +/// The current device model. Returns an empty string if device model cannot be retrieved. ++ (NSString *)deviceModel; + +/// The current operating system version. Returns an empty string if the system version cannot be +/// retrieved. ++ (NSString *)systemVersion; + +/// Indicates whether it is running inside an extension or an app. ++ (BOOL)isAppExtension; + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/third_party/FIRAppEnvironmentUtil.m b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/third_party/FIRAppEnvironmentUtil.m new file mode 100644 index 0000000..be4e971 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/Firebase/Core/third_party/FIRAppEnvironmentUtil.m @@ -0,0 +1,239 @@ +// Copyright 2017 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +#import "FIRAppEnvironmentUtil.h" + +#import +#import +#import + +/// The encryption info struct and constants are missing from the iPhoneSimulator SDK, but not from +/// the iPhoneOS or Mac OS X SDKs. Since one doesn't ever ship a Simulator binary, we'll just +/// provide the definitions here. +#if TARGET_OS_SIMULATOR && !defined(LC_ENCRYPTION_INFO) +#define LC_ENCRYPTION_INFO 0x21 +struct encryption_info_command { + uint32_t cmd; + uint32_t cmdsize; + uint32_t cryptoff; + uint32_t cryptsize; + uint32_t cryptid; +}; +#endif + +@implementation FIRAppEnvironmentUtil + +/// A key for the Info.plist to enable or disable checking if the App Store is running in a sandbox. +/// This will affect your data integrity when using Firebase Analytics, as it will disable some +/// necessary checks. +static NSString *const kFIRAppStoreReceiptURLCheckEnabledKey = + @"FirebaseAppStoreReceiptURLCheckEnabled"; + +/// The file name of the sandbox receipt. This is available on iOS >= 8.0 +static NSString *const kFIRAIdentitySandboxReceiptFileName = @"sandboxReceipt"; + +/// The following copyright from Landon J. Fuller applies to the isAppEncrypted function. +/// +/// Copyright (c) 2017 Landon J. Fuller +/// All rights reserved. +/// +/// Permission is hereby granted, free of charge, to any person obtaining a copy of this software +/// and associated documentation files (the "Software"), to deal in the Software without +/// restriction, including without limitation the rights to use, copy, modify, merge, publish, +/// distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the +/// Software is furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in all copies or +/// substantial portions of the Software. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +/// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +/// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +/// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/// +/// Comment from iPhone Dev Wiki +/// Crack Prevention: +/// App Store binaries are signed by both their developer and Apple. This encrypts the binary so +/// that decryption keys are needed in order to make the binary readable. When iOS executes the +/// binary, the decryption keys are used to decrypt the binary into a readable state where it is +/// then loaded into memory and executed. iOS can tell the encryption status of a binary via the +/// cryptid structure member of LC_ENCRYPTION_INFO MachO load command. If cryptid is a non-zero +/// value then the binary is encrypted. +/// +/// 'Cracking' works by letting the kernel decrypt the binary then siphoning the decrypted data into +/// a new binary file, resigning, and repackaging. This will only work on jailbroken devices as +/// codesignature validation has been removed. Resigning takes place because while the codesignature +/// doesn't have to be valid thanks to the jailbreak, it does have to be in place unless you have +/// AppSync or similar to disable codesignature checks. +/// +/// More information at Landon Fuller's blog +static BOOL isAppEncrypted() { + const struct mach_header *executableHeader = NULL; + for (uint32_t i = 0; i < _dyld_image_count(); i++) { + const struct mach_header *header = _dyld_get_image_header(i); + if (header && header->filetype == MH_EXECUTE) { + executableHeader = header; + break; + } + } + + if (!executableHeader) { + return NO; + } + + BOOL is64bit = (executableHeader->magic == MH_MAGIC_64); + uintptr_t cursor = (uintptr_t)executableHeader + + (is64bit ? sizeof(struct mach_header_64) : sizeof(struct mach_header)); + const struct segment_command *segmentCommand = NULL; + uint32_t i = 0; + + while (i++ < executableHeader->ncmds) { + segmentCommand = (struct segment_command *)cursor; + + if (!segmentCommand) { + continue; + } + + if ((!is64bit && segmentCommand->cmd == LC_ENCRYPTION_INFO) || + (is64bit && segmentCommand->cmd == LC_ENCRYPTION_INFO_64)) { + if (is64bit) { + struct encryption_info_command_64 *cryptCmd = + (struct encryption_info_command_64 *)segmentCommand; + return cryptCmd && cryptCmd->cryptid != 0; + } else { + struct encryption_info_command *cryptCmd = (struct encryption_info_command *)segmentCommand; + return cryptCmd && cryptCmd->cryptid != 0; + } + } + cursor += segmentCommand->cmdsize; + } + + return NO; +} + ++ (BOOL)isFromAppStore { + static dispatch_once_t isEncryptedOnce; + static BOOL isEncrypted = NO; + + dispatch_once(&isEncryptedOnce, ^{ + isEncrypted = isAppEncrypted(); + }); + + if ([FIRAppEnvironmentUtil isSimulator]) { + return NO; + } + + // If an app contain the sandboxReceipt file, it means its coming from TestFlight + // This must be checked before the SCInfo Folder check below since TestFlight apps may + // also have an SCInfo folder. + if ([FIRAppEnvironmentUtil isAppStoreReceiptSandbox]) { + return NO; + } + + if ([FIRAppEnvironmentUtil hasSCInfoFolder]) { + // When iTunes downloads a .ipa, it also gets a customized .sinf file which is added to the + // main SC_Info directory. + return YES; + } + + // For iOS >= 8.0, iTunesMetadata.plist is moved outside of the sandbox. Any attempt to read + // the iTunesMetadata.plist outside of the sandbox will be rejected by Apple. + // If the app does not contain the embedded.mobileprovision which is stripped out by Apple when + // the app is submitted to store, then it is highly likely that it is from Apple Store. + return isEncrypted && ![FIRAppEnvironmentUtil hasEmbeddedMobileProvision]; +} + ++ (BOOL)isAppStoreReceiptSandbox { + // Since checking the App Store's receipt URL can be memory intensive, check the option in the + // Info.plist if developers opted out of this check. + id enableSandboxCheck = + [[NSBundle mainBundle] objectForInfoDictionaryKey:kFIRAppStoreReceiptURLCheckEnabledKey]; + if (enableSandboxCheck && [enableSandboxCheck isKindOfClass:[NSNumber class]] && + ![enableSandboxCheck boolValue]) { + return NO; + } + + NSURL *appStoreReceiptURL = [NSBundle mainBundle].appStoreReceiptURL; + NSString *appStoreReceiptFileName = appStoreReceiptURL.lastPathComponent; + return [appStoreReceiptFileName isEqualToString:kFIRAIdentitySandboxReceiptFileName]; +} + ++ (BOOL)hasEmbeddedMobileProvision { +#if TARGET_OS_IOS || TARGET_OS_TV + return [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"].length > 0; +#elif TARGET_OS_OSX + return NO; +#endif +} + ++ (BOOL)isSimulator { +#if TARGET_OS_IOS || TARGET_OS_TV + NSString *platform = [FIRAppEnvironmentUtil deviceModel]; + return [platform isEqual:@"x86_64"] || [platform isEqual:@"i386"]; +#elif TARGET_OS_OSX + return NO; +#endif +} + ++ (NSString *)deviceModel { + static dispatch_once_t once; + static NSString *deviceModel; + + dispatch_once(&once, ^{ + struct utsname systemInfo; + if (uname(&systemInfo) == 0) { + deviceModel = [NSString stringWithUTF8String:systemInfo.machine]; + } + }); + return deviceModel; +} + ++ (NSString *)systemVersion { + // Assemble the systemVersion, excluding the patch version if it's 0. + NSOperatingSystemVersion osVersion = [NSProcessInfo processInfo].operatingSystemVersion; + NSMutableString *versionString = [[NSMutableString alloc] + initWithFormat:@"%ld.%ld", (long)osVersion.majorVersion, (long)osVersion.minorVersion]; + if (osVersion.patchVersion != 0) { + [versionString appendFormat:@".%ld", (long)osVersion.patchVersion]; + } + + return versionString; +} + ++ (BOOL)isAppExtension { +#if TARGET_OS_IOS || TARGET_OS_TV + // Documented by Apple + BOOL appExtension = [[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"]; + return appExtension; +#elif TARGET_OS_OSX + return NO; +#endif +} + +#pragma mark - Helper methods + ++ (BOOL)hasSCInfoFolder { +#if TARGET_OS_IOS || TARGET_OS_TV + NSString *bundlePath = [NSBundle mainBundle].bundlePath; + NSString *scInfoPath = [bundlePath stringByAppendingPathComponent:@"SC_Info"]; + return [[NSFileManager defaultManager] fileExistsAtPath:scInfoPath]; +#elif TARGET_OS_OSX + return NO; +#endif +} + +@end diff --git a/Verdnaturaventas/Pods/FirebaseCore/LICENSE b/Verdnaturaventas/Pods/FirebaseCore/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Verdnaturaventas/Pods/FirebaseCore/README.md b/Verdnaturaventas/Pods/FirebaseCore/README.md new file mode 100644 index 0000000..39db2f5 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseCore/README.md @@ -0,0 +1,198 @@ +# Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) + +This repository contains a subset of the Firebase iOS SDK source. It currently +includes FirebaseCore, FirebaseAuth, FirebaseDatabase, FirebaseFirestore, +FirebaseFunctions, FirebaseMessaging and FirebaseStorage. + +Firebase is an app development platform with tools to help you build, grow and +monetize your app. More information about Firebase can be found at +[https://firebase.google.com](https://firebase.google.com). + +## Installation + +See the three subsections for details about three different installation methods. +1. [Standard pod install](README.md#standard-pod-install) +1. [Installing from the GitHub repo](README.md#installing-from-github) +1. [Experimental Carthage](README.md#carthage-ios-only) + +### Standard pod install + +Go to +[https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup). + +### Installing from GitHub + +For releases starting with 5.0.0, the source for each release is also deployed +to CocoaPods master and available via standard +[CocoaPods Podfile syntax](https://guides.cocoapods.org/syntax/podfile.html#pod). + +These instructions can be used to access the Firebase repo at other branches, +tags, or commits. + +#### Background + +See +[the Podfile Syntax Reference](https://guides.cocoapods.org/syntax/podfile.html#pod) +for instructions and options about overriding pod source locations. + +#### Step-by-step Source Pod Installation Instructions + +For iOS, copy a subset of the following lines to your Podfile: + +``` +pod 'Firebase' # To enable Firebase module, with `@import Firebase` support +pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseAuth', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseDatabase', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseFunctions', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseMessaging', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseStorage', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +``` + +For macOS and tvOS, copy a subset of the following: + +``` +pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseAuth', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseDatabase', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +pod 'FirebaseStorage', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :tag => '5.0.0' +``` + +1. Make sure you have at least CocoaPods version 1.4.0 - `pod --version`. +1. Delete pods for any components you don't need, except `FirebaseCore` must always be included. +1. Update the tags to the latest Firebase release. See the +[release notes](https://firebase.google.com/support/release-notes/ios). +1. Run `pod update`. + +#### Examples + +To access FirebaseMessaging via a checked out version of the firebase-ios-sdk repo do: + +``` +pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk' +pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk' +``` +To access via a branch: +``` +pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master' +pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master' +``` + +### Carthage (iOS only) + +An experimental Carthage distribution is now available. See +[Carthage](Carthage.md). + +## Development + +Follow the subsequent instructions to develop, debug, unit test, run integration +tests, and try out reference samples: + +``` +$ git clone git@github.com:firebase/firebase-ios-sdk.git +$ cd firebase-ios-sdk/Example +$ pod update +$ open Firebase.xcworkspace +``` + +Firestore and Functions have self contained Xcode projects. See +[Firestore/README.md](Firestore/README.md) and +[Functions/README.md](Functions/README.md). + +### Running Unit Tests + +Select a scheme and press Command-u to build a component and run its unit tests. + +### Running Sample Apps +In order to run the sample apps and integration tests, you'll need valid +`GoogleService-Info.plist` files for those samples. The Firebase Xcode project contains dummy plist +files without real values, but can be replaced with real plist files. To get your own +`GoogleService-Info.plist` files: + +1. Go to the [Firebase Console](https://console.firebase.google.com/) +2. Create a new Firebase project, if you don't already have one +3. For each sample app you want to test, create a new Firebase app with the sample app's bundle +identifier (e.g. `com.google.Database-Example`) +4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file +(e.g. in [Example/Database/App/](Example/Database/App/)); + +Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require +special Apple capabilities, and you will have to change the sample app to use a unique bundle +identifier that you can control in your own Apple Developer account. + +## Specific Component Instructions +See the sections below for any special instructions for those components. + +### Firebase Auth + +If you're doing specific Firebase Auth development, see +[AuthSamples/README.md](AuthSamples/README.md) for instructions about +building and running the FirebaseAuth pod along with various samples and tests. + +### Firebase Database + +To run the Database Integration tests, make your database authentication rules +[public](https://firebase.google.com/docs/database/security/quickstart). + +### Firebase Storage + +To run the Storage Integration tests, follow the instructions in +[FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m). + +#### Push Notifications + +Push notifications can only be delivered to specially provisioned App IDs in the developer portal. +In order to actually test receiving push notifications, you will need to: + +1. Change the bundle identifier of the sample app to something you own in your Apple Developer +account, and enable that App ID for push notifications. +2. You'll also need to +[upload your APNs Provider Authentication Key or certificate to the Firebase Console](https://firebase.google.com/docs/cloud-messaging/ios/certs) +at **Project Settings > Cloud Messaging > [Your Firebase App]**. +3. Ensure your iOS device is added to your Apple Developer portal as a test device. + +#### iOS Simulator + +The iOS Simulator cannot register for remote notifications, and will not receive push notifications. +In order to receive push notifications, you'll have to follow the steps above and run the app on a +physical device. + +## Community Supported Efforts + +We've seen an amazing amount of interest and contributions to improve the Firebase SDKs, and we are +very grateful! We'd like to empower as many developers as we can to be able to use Firebase and +participate in the Firebase community. + +### macOS and tvOS +FirebaseAuth, FirebaseCore, FirebaseDatabase and FirebaseStorage now compile, run unit tests, and +work on macOS and tvOS, thanks to contributions from the community. There are a few tweaks needed, +like ensuring iOS-only, macOS-only, or tvOS-only code is correctly guarded with checks for +`TARGET_OS_IOS`, `TARGET_OS_OSX` and `TARGET_OS_TV`. + +For tvOS, checkout the [Sample](Example/tvOSSample). + +Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is +actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there +may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter +this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). + +For installation instructions, see [above](README.md#step-by-step-source-pod-installation-instructions). + +## Roadmap + +See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source +plans and directions. + +## Contributing + +See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase +iOS SDK. + +## License + +The contents of this repository is licensed under the +[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). + +Your use of Firebase is governed by the +[Terms of Service for Firebase Services](https://firebase.google.com/terms/). diff --git a/Verdnaturaventas/Pods/FirebaseInstanceID/CHANGELOG.md b/Verdnaturaventas/Pods/FirebaseInstanceID/CHANGELOG.md new file mode 100755 index 0000000..816c910 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseInstanceID/CHANGELOG.md @@ -0,0 +1,116 @@ +# 2018-06-19 -- v3.1.1 +- Ensure the checkin and tokens are refreshed if firebase project changed. +- Fixed an issue that checkin should be turned off when FCM's autoInitEnabled flag is off. + +# 2018-06-12 -- v3.1.0 +- Added a new API to fetch InstanceID and Token with a completion handler. The completion handler returns a FIRInstanceIDResult with a instanceID and a token properties. +- Deprecated the token method. +- Added support to log a new customized label provided by developer. + +# 2018-05-08 -- v3.0.0 +- Removed deprecated method `setAPNSToken:type` defined in FIRInstanceID, please use `setAPNSToken:type` defined in FIRMessaging instead. +- Removed deprecated enum `FIRInstanceIDAPNSTokenType` defined in FIRInstanceID, please use `FIRMessagingAPNSTokenType` defined in FIRMessaging instead. +- Fixed an issue that FCM scheduled messages were not tracked successfully. + +# 2018-03-06 -- v2.0.10 +- Improved documentation on InstanceID usage for GDPR. +- Improved the keypair handling during GCM to FCM migration. If you are migrating from GCM to FCM, we encourage you to update to this version and above. + +# 2018-02-06 -- v2.0.9 +- Improved support for language targeting for FCM service. Server updates happen more efficiently when language changes. +- Improved support for FCM token auto generation enable/disable functions. + +# 2017-12-11 -- v2.0.8 +- Fixed a crash caused by a reflection call during logging. +- Updating server with the latest parameters and deprecating old ones. + +# 2017-11-27 -- v2.0.7 +- Improve identity reset process, ensuring all information is reset during Identity deletion. + +# 2017-11-06 -- v2.0.6 +- Make token refresh weekly. +- Fixed a crash when performing token operation. + +# 2017-10-11 -- v2.0.5 +- Improved support for working in shared Keychain environments. + +# 2017-09-26 -- v2.0.4 +- Fixed an issue where the FCM token was not associating correctly with an APNs + device token, depending on when the APNs device token was made available. +- Fixed an issue where FCM tokens for different Sender IDs were not associating + correctly with an APNs device token. +- Fixed an issue that was preventing the FCM direct channel from being + established on the first start after 24 hours of being opened. + +# 2017-09-13 -- v2.0.3 +- Fixed a race condition where a token was not being generated on first start, + if Firebase Messaging was included and the app did not register for remote + notifications. + +# 2017-08-25 -- v2.0.2 +- Fixed a startup performance regression, removing a call which was blocking the + main thread. + +# 2017-08-07 -- v2.0.1 +- Fixed issues with token and app identifier being inaccessible when the device + is locked. +- Fixed a crash if bundle identifier is nil, which is possible in some testing + environments. +- Fixed a small memory leak fetching a new token. +- Moved to a new and simplified token storage system. +- Moved to a new queuing system for token fetches and deletes. +- Simplified logic and code around configuration and logging. +- Added clarification about the 'apns_sandbox' parameter, in header comments. + +# 2017-05-08 -- v2.0.0 +- Introduced an improved interface for Swift 3 developers +- Deprecated some methods and properties after moving their logic to the + Firebase Cloud Messaging SDK +- Fixed an intermittent stability issue when a debug build of an app was + replaced with a release build of the same version +- Removed swizzling logic that was sometimes resulting in developers receiving + a validation notice about enabling push notification capabilities, even though + they weren't using push notifications +- Fixed a notification that would sometimes fire twice in quick succession + during the first run of an app + +# 2017-03-31 -- v1.0.10 + +- Improvements to token-fetching logic +- Fixed some warnings in Instance ID +- Improved error messages if Instance ID couldn't be initialized properly +- Improvements to console logging + +# 2017-01-31 -- v1.0.9 + +- Removed an error being mistakenly logged to the console. + +# 2016-07-06 -- v1.0.8 + +- Don't store InstanceID plists in Documents folder. + +# 2016-06-19 -- v1.0.7 + +- Fix remote-notifications warning on app submission. + +# 2016-05-16 -- v1.0.6 + +- Fix CocoaPod linter issues for InstanceID pod. + +# 2016-05-13 -- v1.0.5 + +- Fix Authorization errors for InstanceID tokens. + +# 2016-05-11 -- v1.0.4 + +- Reduce wait for InstanceID token during parallel requests. + +# 2016-04-18 -- v1.0.3 + +- Change flag to disable swizzling to *FirebaseAppDelegateProxyEnabled*. +- Fix incessant Keychain errors while accessing InstanceID. +- Fix max retries for fetching IID token. + +# 2016-04-18 -- v1.0.2 + +- Register for remote notifications on iOS8+ in the SDK itself. diff --git a/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID new file mode 100755 index 0000000..1cfa487 Binary files /dev/null and b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID differ diff --git a/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h new file mode 100755 index 0000000..97777e1 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h @@ -0,0 +1,304 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@class FIRInstanceIDResult; +/** + * @memberof FIRInstanceID + * + * The scope to be used when fetching/deleting a token for Firebase Messaging. + */ +FOUNDATION_EXPORT NSString *const kFIRInstanceIDScopeFirebaseMessaging + NS_SWIFT_NAME(InstanceIDScopeFirebaseMessaging); + +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Called when the system determines that tokens need to be refreshed. + * This method is also called if Instance ID has been reset in which + * case, tokens and FCM topic subscriptions also need to be refreshed. + * + * Instance ID service will throttle the refresh event across all devices + * to control the rate of token updates on application servers. + */ +FOUNDATION_EXPORT const NSNotificationName kFIRInstanceIDTokenRefreshNotification + NS_SWIFT_NAME(InstanceIDTokenRefresh); +#else +/** + * Called when the system determines that tokens need to be refreshed. + * This method is also called if Instance ID has been reset in which + * case, tokens and FCM topic subscriptions also need to be refreshed. + * + * Instance ID service will throttle the refresh event across all devices + * to control the rate of token updates on application servers. + */ +FOUNDATION_EXPORT NSString *const kFIRInstanceIDTokenRefreshNotification + NS_SWIFT_NAME(InstanceIDTokenRefreshNotification); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the InstanceID token returns. If + * the call fails we return the appropriate `error code` as described below. + * + * @param token The valid token as returned by InstanceID backend. + * + * @param error The error describing why generating a new token + * failed. See the error codes below for a more detailed + * description. + */ +typedef void (^FIRInstanceIDTokenHandler)(NSString *__nullable token, NSError *__nullable error) + NS_SWIFT_NAME(InstanceIDTokenHandler); + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the InstanceID `deleteToken` returns. If + * the call fails we return the appropriate `error code` as described below + * + * @param error The error describing why deleting the token failed. + * See the error codes below for a more detailed description. + */ +typedef void (^FIRInstanceIDDeleteTokenHandler)(NSError *error) + NS_SWIFT_NAME(InstanceIDDeleteTokenHandler); + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the app identity is created. If the + * identity wasn't created for some reason we return the appropriate error code. + * + * @param identity A valid identity for the app instance, nil if there was an error + * while creating an identity. + * @param error The error if fetching the identity fails else nil. + */ +typedef void (^FIRInstanceIDHandler)(NSString *__nullable identity, NSError *__nullable error) + NS_SWIFT_NAME(InstanceIDHandler); + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the app identity and all the tokens associated + * with it are deleted. Returns a valid error object in case of failure else nil. + * + * @param error The error if deleting the identity and all the tokens associated with + * it fails else nil. + */ +typedef void (^FIRInstanceIDDeleteHandler)(NSError *__nullable error) + NS_SWIFT_NAME(InstanceIDDeleteHandler); + +/** + * @related FIRInstanceID + * + * The completion handler invoked when the app identity and token are fetched. If the + * identity wasn't created for some reason we return the appropriate error code. + * + * @param result The result containing an identity for the app instance and a valid token, + * nil if there was an error while creating the result. + * @param error The error if fetching the identity or token fails else nil. + */ +typedef void (^FIRInstanceIDResultHandler)(FIRInstanceIDResult *__nullable result, + NSError *__nullable error) + NS_SWIFT_NAME(InstanceIDResultHandler); + +/** + * Public errors produced by InstanceID. + */ +typedef NS_ENUM(NSUInteger, FIRInstanceIDError) { + // Http related errors. + + /// Unknown error. + FIRInstanceIDErrorUnknown = 0, + + /// Auth Error -- GCM couldn't validate request from this client. + FIRInstanceIDErrorAuthentication = 1, + + /// NoAccess -- InstanceID service cannot be accessed. + FIRInstanceIDErrorNoAccess = 2, + + /// Timeout -- Request to InstanceID backend timed out. + FIRInstanceIDErrorTimeout = 3, + + /// Network -- No network available to reach the servers. + FIRInstanceIDErrorNetwork = 4, + + /// OperationInProgress -- Another similar operation in progress, + /// bailing this one. + FIRInstanceIDErrorOperationInProgress = 5, + + /// InvalidRequest -- Some parameters of the request were invalid. + FIRInstanceIDErrorInvalidRequest = 7, +} NS_SWIFT_NAME(InstanceIDError); + +/** + * A class contains the results of InstanceID and token query. + */ +NS_SWIFT_NAME(InstanceIDResult) +@interface FIRInstanceIDResult : NSObject + +/** + * An instanceID uniquely identifies the app instance. + */ +@property(nonatomic, readonly, copy) NSString *instanceID; + +/* + * Returns a Firebase Messaging scoped token for the firebase app. + */ +@property(nonatomic, readonly, copy) NSString *token; + +@end + +/** + * Instance ID provides a unique identifier for each app instance and a mechanism + * to authenticate and authorize actions (for example, sending an FCM message). + * + * Once an InstanceID is generated, the library periodically sends information about the + * application and the device where it's running to the Firebase backend. To stop this. see + * `[FIRInstanceID deleteIDWithHandler:]`. + * + * Instance ID is long lived but, may be reset if the device is not used for + * a long time or the Instance ID service detects a problem. + * If Instance ID is reset, the app will be notified via + * `kFIRInstanceIDTokenRefreshNotification`. + * + * If the Instance ID has become invalid, the app can request a new one and + * send it to the app server. + * To prove ownership of Instance ID and to allow servers to access data or + * services associated with the app, call + * `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. + */ +NS_SWIFT_NAME(InstanceID) +@interface FIRInstanceID : NSObject + +/** + * FIRInstanceID. + * + * @return A shared instance of FIRInstanceID. + */ ++ (instancetype)instanceID NS_SWIFT_NAME(instanceID()); + +/** + * Unavailable. Use +instanceID instead. + */ +- (instancetype)init __attribute__((unavailable("Use +instanceID instead."))); + +#pragma mark - Tokens + +/** + * Returns a result of app instance identifier InstanceID and a Firebase Messaging scoped token. + * param handler The callback handler invoked when an app instanceID and a default token + * are generated and returned. If instanceID and token fetching fail for some + * reason the callback is invoked with nil `result` and the appropriate error. + */ +- (void)instanceIDWithHandler:(FIRInstanceIDResultHandler)handler; + +/** + * Returns a Firebase Messaging scoped token for the firebase app. + * + * @return Returns the stored token if the device has registered with Firebase Messaging, otherwise + * returns nil. + */ +- (nullable NSString *)token __deprecated_msg("Use instanceIDWithHandler: instead."); + +/** + * Returns a token that authorizes an Entity (example: cloud service) to perform + * an action on behalf of the application identified by Instance ID. + * + * This is similar to an OAuth2 token except, it applies to the + * application instance instead of a user. + * + * This is an asynchronous call. If the token fetching fails for some reason + * we invoke the completion callback with nil `token` and the appropriate + * error. + * + * This generates an Instance ID if it does not exist yet, which starts periodically sending + * information to the Firebase backend (see `[FIRInstanceID getIDWithHandler:]`). + * + * Note, you can only have one `token` or `deleteToken` call for a given + * authorizedEntity and scope at any point of time. Making another such call with the + * same authorizedEntity and scope before the last one finishes will result in an + * error with code `OperationInProgress`. + * + * @see FIRInstanceID deleteTokenWithAuthorizedEntity:scope:handler: + * + * @param authorizedEntity Entity authorized by the token. + * @param scope Action authorized for authorizedEntity. + * @param options The extra options to be sent with your token request. The + * value for the `apns_token` should be the NSData object + * passed to the UIApplicationDelegate's + * `didRegisterForRemoteNotificationsWithDeviceToken` method. + * The value for `apns_sandbox` should be a boolean (or an + * NSNumber representing a BOOL in Objective C) set to true if + * your app is a debug build, which means that the APNs + * device token is for the sandbox environment. It should be + * set to false otherwise. If the `apns_sandbox` key is not + * provided, an automatically-detected value shall be used. + * @param handler The callback handler which is invoked when the token is + * successfully fetched. In case of success a valid `token` and + * `nil` error are returned. In case of any error the `token` + * is nil and a valid `error` is returned. The valid error + * codes have been documented above. + */ +- (void)tokenWithAuthorizedEntity:(NSString *)authorizedEntity + scope:(NSString *)scope + options:(nullable NSDictionary *)options + handler:(FIRInstanceIDTokenHandler)handler; + +/** + * Revokes access to a scope (action) for an entity previously + * authorized by `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. + * + * This is an asynchronous call. Call this on the main thread since InstanceID lib + * is not thread safe. In case token deletion fails for some reason we invoke the + * `handler` callback passed in with the appropriate error code. + * + * Note, you can only have one `token` or `deleteToken` call for a given + * authorizedEntity and scope at a point of time. Making another such call with the + * same authorizedEntity and scope before the last one finishes will result in an error + * with code `OperationInProgress`. + * + * @param authorizedEntity Entity that must no longer have access. + * @param scope Action that entity is no longer authorized to perform. + * @param handler The handler that is invoked once the unsubscribe call ends. + * In case of error an appropriate error object is returned + * else error is nil. + */ +- (void)deleteTokenWithAuthorizedEntity:(NSString *)authorizedEntity + scope:(NSString *)scope + handler:(FIRInstanceIDDeleteTokenHandler)handler; + +#pragma mark - Identity + +/** + * Asynchronously fetch a stable identifier that uniquely identifies the app + * instance. If the identifier has been revoked or has expired, this method will + * return a new identifier. + * + * Once an InstanceID is generated, the library periodically sends information about the + * application and the device where it's running to the Firebase backend. To stop this. see + * `[FIRInstanceID deleteIDWithHandler:]`. + * + * @param handler The handler to invoke once the identifier has been fetched. + * In case of error an appropriate error object is returned else + * a valid identifier is returned and a valid identifier for the + * application instance. + */ +- (void)getIDWithHandler:(FIRInstanceIDHandler)handler NS_SWIFT_NAME(getID(handler:)); + +/** + * Resets Instance ID and revokes all tokens. + * + * This method also triggers a request to fetch a new Instance ID and Firebase Messaging scope + * token. Please listen to kFIRInstanceIDTokenRefreshNotification when the new ID and token are + * ready. + * + * This stops the periodic sending of data to the Firebase backend that began when the Instance ID + * was generated. No more data is sent until another library calls Instance ID internally again + * (like FCM, RemoteConfig or Analytics) or user explicitly calls Instance ID APIs to get an + * Instance ID and token again. + */ +- (void)deleteIDWithHandler:(FIRInstanceIDDeleteHandler)handler NS_SWIFT_NAME(deleteID(handler:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h new file mode 100755 index 0000000..053ec2b --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h @@ -0,0 +1 @@ +#import "FIRInstanceID.h" diff --git a/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap new file mode 100755 index 0000000..6ab7f1b --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap @@ -0,0 +1,7 @@ +framework module FirebaseInstanceID { + umbrella header "FirebaseInstanceID.h" + export * + module * { export *} + link "z" + link framework "Security" + link framework "SystemConfiguration"} diff --git a/Verdnaturaventas/Pods/FirebaseInstanceID/README.md b/Verdnaturaventas/Pods/FirebaseInstanceID/README.md new file mode 100755 index 0000000..25fe219 --- /dev/null +++ b/Verdnaturaventas/Pods/FirebaseInstanceID/README.md @@ -0,0 +1,10 @@ +# InstanceID SDK for iOS + +Instance ID provides a unique ID per instance of your apps and also provides a +mechanism to authenticate and authorize actions, like sending messages via +Firebase Cloud Messaging (FCM). + + +Please visit [our developer +site](https://developers.google.com/instance-id/) for integration instructions, +documentation, support information, and terms of service. diff --git a/Verdnaturaventas/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.h b/Verdnaturaventas/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.h new file mode 100644 index 0000000..dceadc4 --- /dev/null +++ b/Verdnaturaventas/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.h @@ -0,0 +1,199 @@ +// +// GTMNSData+zlib.h +// +// Copyright 2007-2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import +#import "GTMDefines.h" + +/// Helpers for dealing w/ zlib inflate/deflate calls. +@interface NSData (GTMZLibAdditions) + +// NOTE: For 64bit, none of these apis handle input sizes >32bits, they will +// return nil when given such data. To handle data of that size you really +// should be streaming it rather then doing it all in memory. + +#pragma mark Gzip Compression + +/// Return an autoreleased NSData w/ the result of gzipping the bytes. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length; ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of gzipping the payload of |data|. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByGzippingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of gzipping the bytes using |level| compression level. +// +// |level| can be 1-9, any other values will be clipped to that range. ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of gzipping the payload of |data| using |level| compression level. ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error; + +#pragma mark Zlib "Stream" Compression + +// NOTE: deflate is *NOT* gzip. deflate is a "zlib" stream. pick which one +// you really want to create. (the inflate api will handle either) + +/// Return an autoreleased NSData w/ the result of deflating the bytes. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of deflating the payload of |data|. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of deflating the bytes using |level| compression level. +// +// |level| can be 1-9, any other values will be clipped to that range. ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of deflating the payload of |data| using |level| compression level. ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error; + +#pragma mark Uncompress of Gzip or Zlib + +/// Return an autoreleased NSData w/ the result of decompressing the bytes. +// +// The bytes to decompress can be zlib or gzip payloads. ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of decompressing the payload of |data|. +// +// The data to decompress can be zlib or gzip payloads. ++ (NSData *)gtm_dataByInflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByInflatingData:(NSData *)data + error:(NSError **)error; + +#pragma mark "Raw" Compression Support + +// NOTE: raw deflate is *NOT* gzip or deflate. it does not include a header +// of any form and should only be used within streams here an external crc/etc. +// is done to validate the data. The RawInflate apis can be used on data +// processed like this. + +/// Return an autoreleased NSData w/ the result of *raw* deflating the bytes. +// +// Uses the default compression level. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* deflating the payload of |data|. +// +// Uses the default compression level. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* deflating the bytes using |level| compression level. +// +// |level| can be 1-9, any other values will be clipped to that range. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* deflating the payload of |data| using |level| compression level. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* decompressing the bytes. +// +// The data to decompress, it should *not* have any header (zlib nor gzip). ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* decompressing the payload of |data|. +// +// The data to decompress, it should *not* have any header (zlib nor gzip). ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data + error:(NSError **)error; + +@end + +FOUNDATION_EXPORT NSString *const GTMNSDataZlibErrorDomain; +FOUNDATION_EXPORT NSString *const GTMNSDataZlibErrorKey; // NSNumber +FOUNDATION_EXPORT NSString *const GTMNSDataZlibRemainingBytesKey; // NSNumber + +typedef NS_ENUM(NSInteger, GTMNSDataZlibError) { + GTMNSDataZlibErrorGreaterThan32BitsToCompress = 1024, + // An internal zlib error. + // GTMNSDataZlibErrorKey will contain the error value. + // NSLocalizedDescriptionKey may contain an error string from zlib. + // Look in zlib.h for list of errors. + GTMNSDataZlibErrorInternal, + // There was left over data in the buffer that was not used. + // GTMNSDataZlibRemainingBytesKey will contain number of remaining bytes. + GTMNSDataZlibErrorDataRemaining +}; diff --git a/Verdnaturaventas/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.m b/Verdnaturaventas/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.m new file mode 100644 index 0000000..bf74b2d --- /dev/null +++ b/Verdnaturaventas/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.m @@ -0,0 +1,531 @@ +// +// GTMNSData+zlib.m +// +// Copyright 2007-2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import "GTMNSData+zlib.h" +#import +#import "GTMDefines.h" + +#define kChunkSize 1024 + +NSString *const GTMNSDataZlibErrorDomain = @"com.google.GTMNSDataZlibErrorDomain"; +NSString *const GTMNSDataZlibErrorKey = @"GTMNSDataZlibErrorKey"; +NSString *const GTMNSDataZlibRemainingBytesKey = @"GTMNSDataZlibRemainingBytesKey"; + +typedef enum { + CompressionModeZlib, + CompressionModeGzip, + CompressionModeRaw, +} CompressionMode; + +@interface NSData (GTMZlibAdditionsPrivate) ++ (NSData *)gtm_dataByCompressingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + mode:(CompressionMode)mode + error:(NSError **)error; ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + isRawData:(BOOL)isRawData + error:(NSError **)error; +@end + +@implementation NSData (GTMZlibAdditionsPrivate) + ++ (NSData *)gtm_dataByCompressingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + mode:(CompressionMode)mode + error:(NSError **)error { + if (!bytes || !length) { + return nil; + } + +#if defined(__LP64__) && __LP64__ + // Don't support > 32bit length for 64 bit, see note in header. + if (length > UINT_MAX) { + if (error) { + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorGreaterThan32BitsToCompress + userInfo:nil]; + } + return nil; + } +#endif + + if (level == Z_DEFAULT_COMPRESSION) { + // the default value is actually outside the range, so we have to let it + // through specifically. + } else if (level < Z_BEST_SPEED) { + level = Z_BEST_SPEED; + } else if (level > Z_BEST_COMPRESSION) { + level = Z_BEST_COMPRESSION; + } + + z_stream strm; + bzero(&strm, sizeof(z_stream)); + + int memLevel = 8; // the default + int windowBits = 15; // the default + switch (mode) { + case CompressionModeZlib: + // nothing to do + break; + + case CompressionModeGzip: + windowBits += 16; // enable gzip header instead of zlib header + break; + + case CompressionModeRaw: + windowBits *= -1; // Negative to mean no header. + break; + } + int retCode; + if ((retCode = deflateInit2(&strm, level, Z_DEFLATED, windowBits, + memLevel, Z_DEFAULT_STRATEGY)) != Z_OK) { + // COV_NF_START - no real way to force this in a unittest (we guard all args) + if (error) { + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + return nil; + // COV_NF_END + } + + // hint the size at 1/4 the input size + NSMutableData *result = [NSMutableData dataWithCapacity:(length/4)]; + unsigned char output[kChunkSize]; + + // setup the input + strm.avail_in = (unsigned int)length; + strm.next_in = (unsigned char*)bytes; + + // loop to collect the data + do { + // update what we're passing in + strm.avail_out = kChunkSize; + strm.next_out = output; + retCode = deflate(&strm, Z_FINISH); + if ((retCode != Z_OK) && (retCode != Z_STREAM_END)) { + // COV_NF_START - no real way to force this in a unittest + // (in inflate, we can feed bogus/truncated data to test, but an error + // here would be some internal issue w/in zlib, and there isn't any real + // way to test it) + if (error) { + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + deflateEnd(&strm); + return nil; + // COV_NF_END + } + // collect what we got + unsigned gotBack = kChunkSize - strm.avail_out; + if (gotBack > 0) { + [result appendBytes:output length:gotBack]; + } + + } while (retCode == Z_OK); + + // if the loop exits, we used all input and the stream ended + _GTMDevAssert(strm.avail_in == 0, + @"thought we finished deflate w/o using all input, %u bytes left", + strm.avail_in); + _GTMDevAssert(retCode == Z_STREAM_END, + @"thought we finished deflate w/o getting a result of stream end, code %d", + retCode); + + // clean up + deflateEnd(&strm); + + return result; +} // gtm_dataByCompressingBytes:length:compressionLevel:useGzip: + ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + isRawData:(BOOL)isRawData + error:(NSError **)error { + if (!bytes || !length) { + return nil; + } + +#if defined(__LP64__) && __LP64__ + // Don't support > 32bit length for 64 bit, see note in header. + if (length > UINT_MAX) { + return nil; + } +#endif + + z_stream strm; + bzero(&strm, sizeof(z_stream)); + + // setup the input + strm.avail_in = (unsigned int)length; + strm.next_in = (unsigned char*)bytes; + + int windowBits = 15; // 15 to enable any window size + if (isRawData) { + windowBits *= -1; // make it negative to signal no header. + } else { + windowBits += 32; // and +32 to enable zlib or gzip header detection. + } + + int retCode; + if ((retCode = inflateInit2(&strm, windowBits)) != Z_OK) { + // COV_NF_START - no real way to force this in a unittest (we guard all args) + if (error) { + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + return nil; + // COV_NF_END + } + + // hint the size at 4x the input size + NSMutableData *result = [NSMutableData dataWithCapacity:(length*4)]; + unsigned char output[kChunkSize]; + + // loop to collect the data + do { + // update what we're passing in + strm.avail_out = kChunkSize; + strm.next_out = output; + retCode = inflate(&strm, Z_NO_FLUSH); + if ((retCode != Z_OK) && (retCode != Z_STREAM_END)) { + if (error) { + NSMutableDictionary *userInfo = + [NSMutableDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + if (strm.msg) { + NSString *message = [NSString stringWithUTF8String:strm.msg]; + if (message) { + [userInfo setObject:message forKey:NSLocalizedDescriptionKey]; + } + } + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + inflateEnd(&strm); + return nil; + } + // collect what we got + unsigned gotBack = kChunkSize - strm.avail_out; + if (gotBack > 0) { + [result appendBytes:output length:gotBack]; + } + + } while (retCode == Z_OK); + + // make sure there wasn't more data tacked onto the end of a valid compressed + // stream. + if (strm.avail_in != 0) { + if (error) { + NSDictionary *userInfo = + [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedInt:strm.avail_in] + forKey:GTMNSDataZlibRemainingBytesKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorDataRemaining + userInfo:userInfo]; + } + result = nil; + } + // the only way out of the loop was by hitting the end of the stream + _GTMDevAssert(retCode == Z_STREAM_END, + @"thought we finished inflate w/o getting a result of stream end, code %d", + retCode); + + // clean up + inflateEnd(&strm); + + return result; +} // gtm_dataByInflatingBytes:length:windowBits: + +@end + + +@implementation NSData (GTMZLibAdditions) + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByGzippingBytes:bytes length:length error:NULL]; +} // gtm_dataByGzippingBytes:length: + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingBytes:length:error: + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data { + return [self gtm_dataByGzippingData:data error:NULL]; +} // gtm_dataByGzippingData: + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingData:error: + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level { + return [self gtm_dataByGzippingBytes:bytes + length:length + compressionLevel:level + error:NULL]; +} // gtm_dataByGzippingBytes:length:level: + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:level + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingBytes:length:level:error + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level { + return [self gtm_dataByGzippingData:data + compressionLevel:level + error:NULL]; +} // gtm_dataByGzippingData:level: + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:level + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingData:level:error + +#pragma mark - + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByDeflatingBytes:bytes + length:length + error:NULL]; +} // gtm_dataByDeflatingBytes:length: + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingBytes:length:error + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data { + return [self gtm_dataByDeflatingData:data error:NULL]; +} // gtm_dataByDeflatingData: + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingData: + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level { + return [self gtm_dataByDeflatingBytes:bytes + length:length + compressionLevel:level + error:NULL]; +} // gtm_dataByDeflatingBytes:length:level: + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:level + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingBytes:length:level:error: + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level { + return [self gtm_dataByDeflatingData:data + compressionLevel:level + error:NULL]; +} // gtm_dataByDeflatingData:level: + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:level + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingData:level:error: + +#pragma mark - + ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByInflatingBytes:bytes + length:length + error:NULL]; +} // gtm_dataByInflatingBytes:length: + ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error { + return [self gtm_dataByInflatingBytes:bytes + length:length + isRawData:NO + error:error]; +} // gtm_dataByInflatingBytes:length:error: + ++ (NSData *)gtm_dataByInflatingData:(NSData *)data { + return [self gtm_dataByInflatingData:data error:NULL]; +} // gtm_dataByInflatingData: + ++ (NSData *)gtm_dataByInflatingData:(NSData *)data + error:(NSError **)error { + return [self gtm_dataByInflatingBytes:[data bytes] + length:[data length] + isRawData:NO + error:error]; +} // gtm_dataByInflatingData: + +#pragma mark - + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:NULL]; +} // gtm_dataByRawDeflatingBytes:length: + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingBytes:length:error: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data { + return [self gtm_dataByRawDeflatingData:data error:NULL]; +} // gtm_dataByRawDeflatingData: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingData:error: + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level { + return [self gtm_dataByRawDeflatingBytes:bytes + length:length + compressionLevel:level + error:NULL]; +} // gtm_dataByRawDeflatingBytes:length:compressionLevel: + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:level + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingBytes:length:compressionLevel:error: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level { + return [self gtm_dataByRawDeflatingData:data + compressionLevel:level + error:NULL]; +} // gtm_dataByRawDeflatingData:compressionLevel: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:level + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingData:compressionLevel:error: + ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByInflatingBytes:bytes + length:length + error:NULL]; +} // gtm_dataByRawInflatingBytes:length: + ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error{ + return [self gtm_dataByInflatingBytes:bytes + length:length + isRawData:YES + error:error]; +} // gtm_dataByRawInflatingBytes:length:error: + ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data { + return [self gtm_dataByRawInflatingData:data + error:NULL]; +} // gtm_dataByRawInflatingData: + ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data + error:(NSError **)error { + return [self gtm_dataByInflatingBytes:[data bytes] + length:[data length] + isRawData:YES + error:error]; +} // gtm_dataByRawInflatingData:error: + +@end diff --git a/Verdnaturaventas/Pods/GoogleToolboxForMac/GTMDefines.h b/Verdnaturaventas/Pods/GoogleToolboxForMac/GTMDefines.h new file mode 100644 index 0000000..7feb1cb --- /dev/null +++ b/Verdnaturaventas/Pods/GoogleToolboxForMac/GTMDefines.h @@ -0,0 +1,398 @@ +// +// GTMDefines.h +// +// Copyright 2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +// ============================================================================ + +#include +#include + +#ifdef __OBJC__ +#include +#endif // __OBJC__ + +#if TARGET_OS_IPHONE +#include +#endif // TARGET_OS_IPHONE + +// ---------------------------------------------------------------------------- +// CPP symbols that can be overridden in a prefix to control how the toolbox +// is compiled. +// ---------------------------------------------------------------------------- + + +// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and +// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens +// when a validation fails. If you implement your own validators, you may want +// to control their internals using the same macros for consistency. +#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT + #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0 +#endif + +// Ensure __has_feature and __has_extension are safe to use. +// See http://clang-analyzer.llvm.org/annotations.html +#ifndef __has_feature // Optional. + #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif + +#ifndef __has_extension + #define __has_extension __has_feature // Compatibility with pre-3.0 compilers. +#endif + +// Give ourselves a consistent way to do inlines. Apple's macros even use +// a few different actual definitions, so we're based off of the foundation +// one. +#if !defined(GTM_INLINE) + #if (defined (__GNUC__) && (__GNUC__ == 4)) || defined (__clang__) + #define GTM_INLINE static __inline__ __attribute__((always_inline)) + #else + #define GTM_INLINE static __inline__ + #endif +#endif + +// Give ourselves a consistent way of doing externs that links up nicely +// when mixing objc and objc++ +#if !defined (GTM_EXTERN) + #if defined __cplusplus + #define GTM_EXTERN extern "C" + #define GTM_EXTERN_C_BEGIN extern "C" { + #define GTM_EXTERN_C_END } + #else + #define GTM_EXTERN extern + #define GTM_EXTERN_C_BEGIN + #define GTM_EXTERN_C_END + #endif +#endif + +// Give ourselves a consistent way of exporting things if we have visibility +// set to hidden. +#if !defined (GTM_EXPORT) + #define GTM_EXPORT __attribute__((visibility("default"))) +#endif + +// Give ourselves a consistent way of declaring something as unused. This +// doesn't use __unused because that is only supported in gcc 4.2 and greater. +#if !defined (GTM_UNUSED) +#define GTM_UNUSED(x) ((void)(x)) +#endif + +// _GTMDevLog & _GTMDevAssert +// +// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for +// developer level errors. This implementation simply macros to NSLog/NSAssert. +// It is not intended to be a general logging/reporting system. +// +// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert +// for a little more background on the usage of these macros. +// +// _GTMDevLog log some error/problem in debug builds +// _GTMDevAssert assert if condition isn't met w/in a method/function +// in all builds. +// +// To replace this system, just provide different macro definitions in your +// prefix header. Remember, any implementation you provide *must* be thread +// safe since this could be called by anything in what ever situtation it has +// been placed in. +// + +// Ignore the "Macro name is a reserved identifier" warning in this section +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" + +// We only define the simple macros if nothing else has defined this. +#ifndef _GTMDevLog + +#ifdef DEBUG + #define _GTMDevLog(...) NSLog(__VA_ARGS__) +#else + #define _GTMDevLog(...) do { } while (0) +#endif + +#endif // _GTMDevLog + +#ifndef _GTMDevAssert +// we directly invoke the NSAssert handler so we can pass on the varargs +// (NSAssert doesn't have a macro we can use that takes varargs) +#if !defined(NS_BLOCK_ASSERTIONS) + #define _GTMDevAssert(condition, ...) \ + do { \ + if (!(condition)) { \ + [[NSAssertionHandler currentHandler] \ + handleFailureInFunction:(NSString *) \ + [NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ + file:(NSString *)[NSString stringWithUTF8String:__FILE__] \ + lineNumber:__LINE__ \ + description:__VA_ARGS__]; \ + } \ + } while(0) +#else // !defined(NS_BLOCK_ASSERTIONS) + #define _GTMDevAssert(condition, ...) do { } while (0) +#endif // !defined(NS_BLOCK_ASSERTIONS) + +#endif // _GTMDevAssert + +// _GTMCompileAssert +// +// Note: Software for current compilers should just use _Static_assert directly +// instead of this macro. +// +// _GTMCompileAssert is an assert that is meant to fire at compile time if you +// want to check things at compile instead of runtime. For example if you +// want to check that a wchar is 4 bytes instead of 2 you would use +// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X) +// Note that the second "arg" is not in quotes, and must be a valid processor +// symbol in it's own right (no spaces, punctuation etc). + +// Wrapping this in an #ifndef allows external groups to define their own +// compile time assert scheme. +#ifndef _GTMCompileAssert + #if __has_feature(c_static_assert) || __has_extension(c_static_assert) + #define _GTMCompileAssert(test, msg) _Static_assert((test), #msg) + #else + // Pre-Xcode 7 support. + // + // We got this technique from here: + // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html + #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg + #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg) + #define _GTMCompileAssert(test, msg) \ + typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] + #endif // __has_feature(c_static_assert) || __has_extension(c_static_assert) +#endif // _GTMCompileAssert + +#pragma clang diagnostic pop + +// ---------------------------------------------------------------------------- +// CPP symbols defined based on the project settings so the GTM code has +// simple things to test against w/o scattering the knowledge of project +// setting through all the code. +// ---------------------------------------------------------------------------- + +// Provide a single constant CPP symbol that all of GTM uses for ifdefing +// iPhone code. +#if TARGET_OS_IPHONE // iPhone SDK + // For iPhone specific stuff + #define GTM_IPHONE_SDK 1 + #if TARGET_IPHONE_SIMULATOR + #define GTM_IPHONE_DEVICE 0 + #define GTM_IPHONE_SIMULATOR 1 + #else + #define GTM_IPHONE_DEVICE 1 + #define GTM_IPHONE_SIMULATOR 0 + #endif // TARGET_IPHONE_SIMULATOR + // By default, GTM has provided it's own unittesting support, define this + // to use the support provided by Xcode, especially for the Xcode4 support + // for unittesting. + #ifndef GTM_USING_XCTEST + #define GTM_USING_XCTEST 0 + #endif + #define GTM_MACOS_SDK 0 +#else + // For MacOS specific stuff + #define GTM_MACOS_SDK 1 + #define GTM_IPHONE_SDK 0 + #define GTM_IPHONE_SIMULATOR 0 + #define GTM_IPHONE_DEVICE 0 + #ifndef GTM_USING_XCTEST + #define GTM_USING_XCTEST 0 + #endif +#endif + +// Some of our own availability macros +#if GTM_MACOS_SDK +#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE +#define GTM_AVAILABLE_ONLY_ON_MACOS +#else +#define GTM_AVAILABLE_ONLY_ON_IPHONE +#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE +#endif + +// GC was dropped by Apple, define the old constant incase anyone still keys +// off of it. +#ifndef GTM_SUPPORT_GC + #define GTM_SUPPORT_GC 0 +#endif + +// Some support for advanced clang static analysis functionality +#ifndef NS_RETURNS_RETAINED + #if __has_feature(attribute_ns_returns_retained) + #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) + #else + #define NS_RETURNS_RETAINED + #endif +#endif + +#ifndef NS_RETURNS_NOT_RETAINED + #if __has_feature(attribute_ns_returns_not_retained) + #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) + #else + #define NS_RETURNS_NOT_RETAINED + #endif +#endif + +#ifndef CF_RETURNS_RETAINED + #if __has_feature(attribute_cf_returns_retained) + #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) + #else + #define CF_RETURNS_RETAINED + #endif +#endif + +#ifndef CF_RETURNS_NOT_RETAINED + #if __has_feature(attribute_cf_returns_not_retained) + #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) + #else + #define CF_RETURNS_NOT_RETAINED + #endif +#endif + +#ifndef NS_CONSUMED + #if __has_feature(attribute_ns_consumed) + #define NS_CONSUMED __attribute__((ns_consumed)) + #else + #define NS_CONSUMED + #endif +#endif + +#ifndef CF_CONSUMED + #if __has_feature(attribute_cf_consumed) + #define CF_CONSUMED __attribute__((cf_consumed)) + #else + #define CF_CONSUMED + #endif +#endif + +#ifndef NS_CONSUMES_SELF + #if __has_feature(attribute_ns_consumes_self) + #define NS_CONSUMES_SELF __attribute__((ns_consumes_self)) + #else + #define NS_CONSUMES_SELF + #endif +#endif + +#ifndef GTM_NONNULL + #if defined(__has_attribute) + #if __has_attribute(nonnull) + #define GTM_NONNULL(x) __attribute__((nonnull x)) + #else + #define GTM_NONNULL(x) + #endif + #else + #define GTM_NONNULL(x) + #endif +#endif + +// Invalidates the initializer from which it's called. +#ifndef GTMInvalidateInitializer + #if __has_feature(objc_arc) + #define GTMInvalidateInitializer() \ + do { \ + [self class]; /* Avoid warning of dead store to |self|. */ \ + _GTMDevAssert(NO, @"Invalid initializer."); \ + return nil; \ + } while (0) + #else + #define GTMInvalidateInitializer() \ + do { \ + [self release]; \ + _GTMDevAssert(NO, @"Invalid initializer."); \ + return nil; \ + } while (0) + #endif +#endif + +#ifndef GTMCFAutorelease + // GTMCFAutorelease returns an id. In contrast, Apple's CFAutorelease returns + // a CFTypeRef. + #if __has_feature(objc_arc) + #define GTMCFAutorelease(x) CFBridgingRelease(x) + #else + #define GTMCFAutorelease(x) ([(id)x autorelease]) + #endif +#endif + +#ifdef __OBJC__ + + +// Macro to allow you to create NSStrings out of other macros. +// #define FOO foo +// NSString *fooString = GTM_NSSTRINGIFY(FOO); +#if !defined (GTM_NSSTRINGIFY) + #define GTM_NSSTRINGIFY_INNER(x) @#x + #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x) +#endif + +// Macro to allow fast enumeration when building for 10.5 or later, and +// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration +// does keys, so pick the right thing, nothing is done on the FastEnumeration +// side to be sure you're getting what you wanted. +#ifndef GTM_FOREACH_OBJECT + #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) + #define GTM_FOREACH_ENUMEREE(element, enumeration) \ + for (element in enumeration) + #define GTM_FOREACH_OBJECT(element, collection) \ + for (element in collection) + #define GTM_FOREACH_KEY(element, collection) \ + for (element in collection) + #else + #define GTM_FOREACH_ENUMEREE(element, enumeration) \ + for (NSEnumerator *_ ## element ## _enum = enumeration; \ + (element = [_ ## element ## _enum nextObject]) != nil; ) + #define GTM_FOREACH_OBJECT(element, collection) \ + GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator]) + #define GTM_FOREACH_KEY(element, collection) \ + GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator]) + #endif +#endif + +// ============================================================================ + +// GTM_SEL_STRING is for specifying selector (usually property) names to KVC +// or KVO methods. +// In debug it will generate warnings for undeclared selectors if +// -Wunknown-selector is turned on. +// In release it will have no runtime overhead. +#ifndef GTM_SEL_STRING + #ifdef DEBUG + #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName)) + #else + #define GTM_SEL_STRING(selName) @#selName + #endif // DEBUG +#endif // GTM_SEL_STRING + +#ifndef GTM_WEAK +#if __has_feature(objc_arc_weak) + // With ARC enabled, __weak means a reference that isn't implicitly + // retained. __weak objects are accessed through runtime functions, so + // they are zeroed out, but this requires OS X 10.7+. + // At clang r251041+, ARC-style zeroing weak references even work in + // non-ARC mode. + #define GTM_WEAK __weak + #elif __has_feature(objc_arc) + // ARC, but targeting 10.6 or older, where zeroing weak references don't + // exist. + #define GTM_WEAK __unsafe_unretained + #else + // With manual reference counting, __weak used to be silently ignored. + // clang r251041 gives it the ARC semantics instead. This means they + // now require a deployment target of 10.7, while some clients of GTM + // still target 10.6. In these cases, expand to __unsafe_unretained instead + #define GTM_WEAK + #endif +#endif + +#endif // __OBJC__ diff --git a/Verdnaturaventas/Pods/GoogleToolboxForMac/LICENSE b/Verdnaturaventas/Pods/GoogleToolboxForMac/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/Verdnaturaventas/Pods/GoogleToolboxForMac/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Verdnaturaventas/Pods/GoogleToolboxForMac/README.md b/Verdnaturaventas/Pods/GoogleToolboxForMac/README.md new file mode 100644 index 0000000..710560a --- /dev/null +++ b/Verdnaturaventas/Pods/GoogleToolboxForMac/README.md @@ -0,0 +1,15 @@ +# GTM: Google Toolbox for Mac # + +**Project site**
+**Discussion group** + +# Google Toolbox for Mac # + +A collection of source from different Google projects that may be of use to +developers working other iOS or OS X projects. + +If you find a problem/bug or want a new feature to be included in the Google +Toolbox for Mac, please join the +[discussion group](http://groups.google.com/group/google-toolbox-for-mac) +or submit an +[issue](https://github.com/google/google-toolbox-for-mac/issues). diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/CALayer+FSExtension.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/CALayer+FSExtension.h deleted file mode 120000 index dedb924..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/CALayer+FSExtension.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/CALayer+FSExtension.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendar+IBExtension.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendar+IBExtension.h deleted file mode 120000 index ff3538c..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendar+IBExtension.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendar+IBExtension.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendar.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendar.h deleted file mode 120000 index e3a47ad..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendar.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendar.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarAnimator.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarAnimator.h deleted file mode 120000 index 1294f28..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarAnimator.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarAnimator.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarAppearance.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarAppearance.h deleted file mode 120000 index e17cd29..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarAppearance.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarAppearance.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarCell.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarCell.h deleted file mode 120000 index 636d91d..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarCell.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarCell.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarCollectionView.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarCollectionView.h deleted file mode 120000 index d7f95ef..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarCollectionView.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarCollectionView.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarConstance.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarConstance.h deleted file mode 120000 index 2108f4f..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarConstance.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarConstance.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarDynamicHeader.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarDynamicHeader.h deleted file mode 120000 index 017e457..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarDynamicHeader.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarDynamicHeader.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarEventIndicator.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarEventIndicator.h deleted file mode 120000 index a723e74..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarEventIndicator.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarEventIndicator.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarFlowLayout.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarFlowLayout.h deleted file mode 120000 index 2282fd6..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarFlowLayout.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarFlowLayout.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarHeader.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarHeader.h deleted file mode 120000 index cbdffd1..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarHeader.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarHeader.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarStickyHeader.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarStickyHeader.h deleted file mode 120000 index 23771dd..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/FSCalendarStickyHeader.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/FSCalendarStickyHeader.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/NSDate+FSExtension.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/NSDate+FSExtension.h deleted file mode 120000 index 632e692..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/NSDate+FSExtension.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/NSDate+FSExtension.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/NSString+FSExtension.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/NSString+FSExtension.h deleted file mode 120000 index 53cfa66..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/NSString+FSExtension.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/NSString+FSExtension.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/UIView+FSExtension.h b/Verdnaturaventas/Pods/Headers/Private/FSCalendar/UIView+FSExtension.h deleted file mode 120000 index 5c16760..0000000 --- a/Verdnaturaventas/Pods/Headers/Private/FSCalendar/UIView+FSExtension.h +++ /dev/null @@ -1 +0,0 @@ -../../../FSCalendar/FSCalendar/UIView+FSExtension.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Private/Firebase/Firebase.h b/Verdnaturaventas/Pods/Headers/Private/Firebase/Firebase.h new file mode 120000 index 0000000..07ac6eb --- /dev/null +++ b/Verdnaturaventas/Pods/Headers/Private/Firebase/Firebase.h @@ -0,0 +1 @@ +../../../Firebase/CoreOnly/Sources/Firebase.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Headers/Public/Firebase/Firebase.h b/Verdnaturaventas/Pods/Headers/Public/Firebase/Firebase.h new file mode 120000 index 0000000..07ac6eb --- /dev/null +++ b/Verdnaturaventas/Pods/Headers/Public/Firebase/Firebase.h @@ -0,0 +1 @@ +../../../Firebase/CoreOnly/Sources/Firebase.h \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Manifest.lock b/Verdnaturaventas/Pods/Manifest.lock index 135149a..f5592ed 100644 --- a/Verdnaturaventas/Pods/Manifest.lock +++ b/Verdnaturaventas/Pods/Manifest.lock @@ -1,10 +1,51 @@ PODS: - - FSCalendar (2.0.1) + - Firebase/Core (5.3.0): + - Firebase/CoreOnly + - FirebaseAnalytics (= 5.0.1) + - Firebase/CoreOnly (5.3.0): + - FirebaseCore (= 5.0.4) + - FirebaseAnalytics (5.0.1): + - FirebaseCore (~> 5.0) + - FirebaseInstanceID (~> 3.0) + - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" + - nanopb (~> 0.3) + - FirebaseCore (5.0.4): + - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" + - FirebaseInstanceID (3.1.1): + - FirebaseCore (~> 5.0) + - FSCalendar (2.7.9) + - GoogleToolboxForMac/Defines (2.1.4) + - "GoogleToolboxForMac/NSData+zlib (2.1.4)": + - GoogleToolboxForMac/Defines (= 2.1.4) + - nanopb (0.3.8): + - nanopb/decode (= 0.3.8) + - nanopb/encode (= 0.3.8) + - nanopb/decode (0.3.8) + - nanopb/encode (0.3.8) DEPENDENCIES: + - Firebase/Core - FSCalendar -SPEC CHECKSUMS: - FSCalendar: 18117308f5876a8f6f0fe572085d543580c2c5e5 +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Firebase + - FirebaseAnalytics + - FirebaseCore + - FirebaseInstanceID + - FSCalendar + - GoogleToolboxForMac + - nanopb -COCOAPODS: 0.39.0 +SPEC CHECKSUMS: + Firebase: 68afeeb05461db02d7c9e3215cda28068670f4aa + FirebaseAnalytics: b3628aea54c50464c32c393fb2ea032566e7ecc2 + FirebaseCore: 62f1b792a49bb9e8b4073f24606d2c93ffc352f0 + FirebaseInstanceID: f3f0657372592ecdfdfe2cac604a5a75758376a6 + FSCalendar: a04b09f16f811bc92e82f3cf852a15225233b9d5 + GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f + nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3 + +PODFILE CHECKSUM: 0645cd0766eb63ba97b1572c6e02dd27818977f2 + +COCOAPODS: 1.5.3 diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/project.pbxproj b/Verdnaturaventas/Pods/Pods.xcodeproj/project.pbxproj index edb7bbc..b129edb 100644 --- a/Verdnaturaventas/Pods/Pods.xcodeproj/project.pbxproj +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/project.pbxproj @@ -7,305 +7,799 @@ objects = { /* Begin PBXBuildFile section */ - 078D4DF75013A50AAFBCC75467214CFB /* NSString+FSExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 57A5F764D689F517AF0A280881C6A35E /* NSString+FSExtension.m */; }; - 082C46A244A1077339875D1132DF9874 /* FSCalendarAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 1524B94489B35EDB0193D2795F7AC857 /* FSCalendarAppearance.m */; }; - 0E44012DD097816D61C9AF7B4D509469 /* FSCalendarHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 01C90B5BA1ED973CF81DA8D2E5651F43 /* FSCalendarHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 11F20D807E923A4DBE6CDFDA9A73C229 /* FSCalendarCollectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = C960DB8A2528D516D3A13FCCA82C3B66 /* FSCalendarCollectionView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 21209814564B699E013C0579D7617C88 /* FSCalendarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D0AC9847ACFE1E70FCA1815B8B6D61 /* FSCalendarCell.m */; }; - 215F145235E6770BB3B93DD87D011579 /* Pods-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2FCE1C00460CF74F457E0093A676A834 /* FSCalendarConstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 66A12E4D5C211678B2448F9E984899B4 /* FSCalendarConstance.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 30D2A77C4197DF77DEAF13D41D97FAB1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91413329813FA6FE5A78842159E69621 /* Foundation.framework */; }; - 39582F80068C0DEF708DEE01B8C053F7 /* NSDate+FSExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 004D1A969174AF6C5B848624330800BB /* NSDate+FSExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3B202C12728218C238D98AEE659FF7D1 /* FSCalendarHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD502FEBD83BB7C9A99531C9B8FF7AA /* FSCalendarHeader.m */; }; - 3CBF88CA2DE4F67B82C36AE6290DCC90 /* FSCalendarStickyHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FDBB92A380E152AD7BD7095E586CAA2 /* FSCalendarStickyHeader.m */; }; - 42E18A7773D704188DAE03B594B0B690 /* UIView+FSExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 6026ABDBA74287306D2C9518D545B324 /* UIView+FSExtension.m */; }; - 4814EE71271BC074621A5ABB07525ACF /* FSCalendar+IBExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9EA616D8F785AFE57E49EB2EBB9199 /* FSCalendar+IBExtension.m */; }; - 4960C49802C172EF3469FEC6DCBC1318 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9DE615671731BF3AEFB3CB1F984FA8F /* UIKit.framework */; }; - 51D1AC1D010EA99E078E75C69C6D2111 /* FSCalendarEventIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = B17FE42DA526E38B1BAD0E640FAC0E67 /* FSCalendarEventIndicator.m */; }; - 5C88EB02C6D789D20C6298CF77049112 /* FSCalendar+IBExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A73BF15FC5F8D84C8C1E89BC5012F8B /* FSCalendar+IBExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6983260381111B42F335961452EEE2B0 /* FSCalendarFlowLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B0AF2A7CE74D14448B0D5942BDFBA33 /* FSCalendarFlowLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6C92086C1DC08BB2A45B0A66F839CA48 /* FSCalendarFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = FF20F0CC674B99CCEC0A85786BDCDB05 /* FSCalendarFlowLayout.m */; }; - 6ECD11C96CBDCA50F0331F3FBDAECE64 /* FSCalendar.m in Sources */ = {isa = PBXBuildFile; fileRef = 98CD1A2A02AB1888D0D56BE327D56429 /* FSCalendar.m */; }; - 785778BB36B2F9B21FAE5E476E1B6E2E /* FSCalendarAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = F9180C6EAEB7510676867403C29B059D /* FSCalendarAnimator.m */; }; - 7A779B7652F894A80FBCAF67E3E960FA /* FSCalendar-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C87C1A5FB3D8DA8F4AD70BDA9D7B44A /* FSCalendar-dummy.m */; }; - 7E1B58C9322E8E27C3376E330C124FC7 /* CALayer+FSExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = F0D56D8E51D040808E96D623109D9677 /* CALayer+FSExtension.m */; }; - 7FE3ECFE7843570AAFAD9216E3546026 /* FSCalendarStickyHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE96FA9099CE5E9A94A75A3F757BB9E /* FSCalendarStickyHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9522DA78F08119D9EAFA3E30698BDE41 /* FSCalendarCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B49CDF768CA3F6526D472C8C650B8FAC /* FSCalendarCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9EFD5A3145CC48882E4B6F6A71EE1505 /* NSDate+FSExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B885DB0B763A1DCD70285647F631796 /* NSDate+FSExtension.m */; }; - B08294E2247DE35943C7180A647EE72D /* NSString+FSExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BB28774480DA728F69EFCE55C620818 /* NSString+FSExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B4C6C827EDB0DF9F605FF4C2FA3626E0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E642B1A057ADA2ABEF90BE2417F349C1 /* QuartzCore.framework */; }; - C17B63D63425ED26125A32CC2E15B2A6 /* UIView+FSExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C016456080B824C14A47832D1EC2588 /* UIView+FSExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C60C0BAB1840ED78E320BF832EB7D90F /* CALayer+FSExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 973C6ACFE44EE61AC3EB163842687499 /* CALayer+FSExtension.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CEBADA794147C66483B0C205EDED2F4B /* FSCalendarDynamicHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = D49228A8363C97A98756ABE725AC608C /* FSCalendarDynamicHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D4B2E79A7850584715A743A46D4EFA14 /* FSCalendarConstance.m in Sources */ = {isa = PBXBuildFile; fileRef = 6C6E65A2E80A14F0FB803523C77B30C5 /* FSCalendarConstance.m */; }; - D603EE78D5DBF389EC429A33757BFF5C /* FSCalendarAppearance.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A3A667EB647318A5CB7F633A9A7EE3 /* FSCalendarAppearance.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DB0D7D2A2EDB8D6D5C18B850CB779F7B /* FSCalendarCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CB0C45B63CC86C4C0837D6C3D9095F1 /* FSCalendarCollectionView.m */; }; - DE0A4E10ED1E104BF1DEF81453A6EBC8 /* FSCalendar-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AF45E441F8C6E244BCFEA866579B5C5F /* FSCalendar-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DF12D28003AF7562B560123341B2D2DB /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */; }; - E20A253E8B32E3679DD1B13844709F26 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 91413329813FA6FE5A78842159E69621 /* Foundation.framework */; }; - E773A27D47BC2080FB249FBD4513AB1C /* FSCalendarAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = C0D8BCC3685C44CA28E320CCFDFC5896 /* FSCalendarAnimator.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F7317B2BAF77EC9AF9422499C1D467AA /* FSCalendarEventIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A612F8B03967A88706A41DBBCB40C2F /* FSCalendarEventIndicator.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F7944D091AD240B80D98066395A99B95 /* FSCalendar.h in Headers */ = {isa = PBXBuildFile; fileRef = CC1E62AB45C7FE4D10390474B2FDE645 /* FSCalendar.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 05F97FB862DED24F1B1905C862373C6F /* FIRBundleUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 842CD672C2EAE297C23973D7B5F32307 /* FIRBundleUtil.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0A7AF0E9B853211DE831CAAD4C21F11C /* FSCalendarConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = BA79099C1ECFDA2A20EDE6264282DD78 /* FSCalendarConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0ABF3961C14F4E2D012936D83C5C724A /* FIRErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = F6713C7E904A605DF5DD72B573ADB624 /* FIRErrors.m */; }; + 0DD46AF65FABE6D2BDE4501F807046A6 /* FSCalendarAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 1231E04D35D83CD24B35D7ABA3401361 /* FSCalendarAppearance.m */; }; + 1F19C59101F5F9B66F8730F9EF625A1F /* FIRAppAssociationRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = 93BDF26A34993084DD9B50D710869DC1 /* FIRAppAssociationRegistration.m */; }; + 1FD11A578D78250D186EADB1DE6732F7 /* FIRBundleUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A9AB5695C46F1AF8DC19791DC83BB6C5 /* FIRBundleUtil.m */; }; + 243E3FBB25AD6B55CDF6971E0D22DA4F /* FSCalendarConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = B2E9D578908FECC2CD1BEEA7664D8B1A /* FSCalendarConstants.m */; }; + 29FEADDF2086FDEA7D5BA87DD23B08C6 /* pb_decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BFE5FB319B0197040F045ED09B00EF0 /* pb_decode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2FAFE7A2E5F7C163B3F9A55000557F72 /* FIRNetworkURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FD23E19551D986E4B633D3B23728E /* FIRNetworkURLSession.m */; }; + 381AED7B43FE7EAD4E6C7A48FE4CB740 /* FIRLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 79D39BB0E7D3E67A42B8807AC45C4C63 /* FIRLogger.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 3883B72198499726B04F847CA9D1F627 /* GTMDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C21F30C8858370CD91AD817377EACA9 /* GTMDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 392F2CF142BAA751AC1BB61D8B757D98 /* pb.h in Headers */ = {isa = PBXBuildFile; fileRef = D7BBD78AEDC3716F12FD340CD362B8A0 /* pb.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3A50F5C8ECED9627F2EBD97F61BD376D /* pb_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 2167BB4023599A48A8D2C42C99E73FA5 /* pb_common.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc -fno-objc-arc"; }; }; + 3BD66D6656842D316A18D8F595045BF0 /* FIRConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D99ED9BED2A718CFBBC0654CB8F5844 /* FIRConfiguration.m */; }; + 3D87E3A862C9B32F401A6F6F561B5046 /* FIRReachabilityChecker+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = AF90194A983E221C629D557491DEE066 /* FIRReachabilityChecker+Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 41D10CE405433B469CBE8C40B42865E1 /* GoogleToolboxForMac-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5565484A5722CC345FA6B4491CEB9C3A /* GoogleToolboxForMac-dummy.m */; }; + 468DFD90B6C4DA2F7CFA0C1C89F1B615 /* nanopb-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 19F80F063EA877989FDC6FC73B15AD6B /* nanopb-dummy.m */; }; + 49F1C59A34E52484FD2B6462CE8D7C91 /* FSCalendarDelegationProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7290D1C3511306640537A1B1547D7242 /* FSCalendarDelegationProxy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4E9E3F4C76FDD56538C1D94D6E004488 /* FIRAppEnvironmentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = B8595AEC88B58FF9D7151B75134AD320 /* FIRAppEnvironmentUtil.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4FB56F6CF1214292B65508F5374418AE /* GTMNSData+zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C2245E95A76F72FAE93EB3BDD83FFA9 /* GTMNSData+zlib.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5176D8C2F911883FC75A97525B5567CB /* FIRReachabilityChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 43F67D4116FF2D75B55B4834843815AD /* FIRReachabilityChecker.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 52F333DF6E858B07AEBCB2DBF2A99976 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */; }; + 54F580BF4588159D6A61F21D15591805 /* pb_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = BC051C11E19063609191FDCDEF12EA05 /* pb_decode.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc"; }; }; + 55D8D5D912CFD2F3584E4553C2EAD734 /* pb_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = E851EE177A5ECB157B09BD3F14079B64 /* pb_encode.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc"; }; }; + 55F4561E55A6CF264BEDB8FB18B5FA8C /* FSCalendarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B17E452EDBBDEC7FC1293754CC2800D /* FSCalendarCell.m */; }; + 57D4F36C483A487950FA1F143AE5DCBC /* FSCalendarDelegationFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 08AE4D641081764B7A37D4051DBB48ED /* FSCalendarDelegationFactory.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 58A4DA15799705E46B6A18BA48838897 /* FirebaseCore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = DE1104D7DA8059246D8C2695461A02B1 /* FirebaseCore-dummy.m */; }; + 5B46B9D656F626D2AB2033FE60A5FDF3 /* FIRNetworkLoggerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 72377A55B5CEE608F29965BD61AE2679 /* FIRNetworkLoggerProtocol.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5C62C27E2855390100E9519DE3095DDB /* FSCalendarHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D0AC04779E24679B434D3EFCB4A34E3 /* FSCalendarHeaderView.m */; }; + 5CE58FA585A19EE7F88D520FAE62DF11 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */; }; + 625F05F7702CA250DEB66A699766DA9E /* FSCalendar-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 6233E690F1E51D7E382E52716FFF0FB2 /* FSCalendar-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65736E1FDF516AE1EF4927AA623D5486 /* FIRAppAssociationRegistration.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B9E34D862280E14DC42AACDBDE6892 /* FIRAppAssociationRegistration.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 66737F48243D514269C499D65A7B4DBE /* FSCalendar.m in Sources */ = {isa = PBXBuildFile; fileRef = EDC409591B76A9F6D61587293BD29A4F /* FSCalendar.m */; }; + 712FF0C70B4C85F44AFB5CDDC1DD9018 /* FSCalendarDynamicHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 22772D8AEAA7A680859EF608403ABB26 /* FSCalendarDynamicHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7525390045039F998FF0DADC322488CB /* FIRAnalyticsConfiguration+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED79201E0C43D9461983DFB2DDC9ADD /* FIRAnalyticsConfiguration+Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 7E320930D1F4218F307C7FB786F0C514 /* FSCalendarCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = D1F1780DE9196972DC49E3D6F522FAC6 /* FSCalendarCollectionView.m */; }; + 7EF7379A0CC562D025B9F38F0B087CFF /* FIRLoggerLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C402C4F02A4DCD3990E69AC400F67A0 /* FIRLoggerLevel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 806BAA4E00218D70995697C4400BE7A0 /* pb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B1AC7DB2CCF7ADF56404D410C65870E /* pb_common.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 81F8C528AB6DF9D7494A12C136572C12 /* Pods-Verdnaturaventas-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D10F972E823193A9F3CB1849FF8C8878 /* Pods-Verdnaturaventas-dummy.m */; }; + 8632FCFA0471878FC95240290BE97458 /* FSCalendar-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 801D845191A0AA868BE6B0AAAF28AC82 /* FSCalendar-dummy.m */; }; + 8B595D1E703A57549BB98A1AF0F257DA /* FIRAppEnvironmentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 973E9EF1A434EE33F61AD7D3390C843C /* FIRAppEnvironmentUtil.m */; }; + 8E8E60E0406837DF7038528766C90AEA /* FSCalendarScopeHandle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BBABAE7A8B8AD6E27E5890C457AA49E /* FSCalendarScopeHandle.m */; }; + 8F0FFA270E768BC335C0AB4DDC229B9A /* FIRAnalyticsConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 29B39186DA8FD3698035EE44A0667012 /* FIRAnalyticsConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8F7003744526BA3547F59200EE4F4D16 /* FSCalendarWeekdayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 98D3B2136091E3E60C1F94FE96B6C4DA /* FSCalendarWeekdayView.m */; }; + 91693C90642539B4F411E794548A9E2A /* FSCalendarCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 3486C9585B99BC01FD7D1EBC03E64600 /* FSCalendarCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 96E021283F050BCADF9A9B668C77B203 /* FSCalendarExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = EF7DC8D3189B7EC2FFB59053F5C6DA5B /* FSCalendarExtensions.m */; }; + 9B3BB0BB63055112AE0B41146D80AA04 /* FIRNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 0520666223B1464C2A1042753A3B324A /* FIRNetwork.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 9BBD467B0D509C44DE0848E18CDF4BBA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */; }; + 9CF04404C01848D25E78B22A88BFF129 /* FSCalendar.h in Headers */ = {isa = PBXBuildFile; fileRef = 8F755C5EF0FC317859C76BAA2AC8C9BA /* FSCalendar.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A000A7A7023F7FB4CEDD1023EB87BF93 /* FSCalendarCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F8D36426AD3A6D2E0551AB4043062845 /* FSCalendarCollectionViewLayout.m */; }; + A1910C42D44099DC241B389D9BCC26C1 /* FIRConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BED05F813A972D49C1739E43C5EA7BF /* FIRConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3D1147CED9648BEDE2E47B8E8A44924 /* FSCalendar+Deprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = 210555D58B8A537EF18AAF0B643564F0 /* FSCalendar+Deprecated.m */; }; + AA978FCF3EF1D8D10DDE3BB4C6312A7B /* FSCalendarDelegationProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = DB0BBD28905311E92E801F16265BDB3A /* FSCalendarDelegationProxy.m */; }; + B65CB6EF3292BEB782D1C68597EB362F /* FIRReachabilityChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C174FFF3A79EF963F593DEAB1555D1E /* FIRReachabilityChecker.m */; }; + B7762CCB1BF67C5F8451AF095A678D42 /* GoogleToolboxForMac-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 55B30988B0FF0A345D59AA2878AFFD7A /* GoogleToolboxForMac-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BDA1ED05CBA5580B30785A431D5B231B /* FSCalendarTransitionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 840F2ABB3FEBC55A608A6AF9D7D807F3 /* FSCalendarTransitionCoordinator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C04AADE8E4A470C4074FCA8EE90CF4C2 /* FIROptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DDD939C31BE581CE59115BBEEE7AE04 /* FIROptions.m */; }; + C14BCC00F75331E60F28F82F7D3F9EA9 /* FIRVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = C536A358972E4C1FD3133470F60CF05C /* FIRVersion.m */; }; + C17D68C964954EF1C0BB3C314C2F452F /* FSCalendarWeekdayView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AD180C89A9A6A3C0078B34B03C67EA3 /* FSCalendarWeekdayView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C69663957B2EB4C7CF4D8192480AA8B4 /* FSCalendarExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1580AFAADCE1F810322FC0303485FB89 /* FSCalendarExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAAD8C8007C5868AEC3DEB72D6D1D74A /* FIRLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7A0D5A9D4BBF01363C647F7866651A /* FIRLogger.m */; }; + CDB052C277F6148BBAACB2C2C7C6321B /* FSCalendarTransitionCoordinator.m in Sources */ = {isa = PBXBuildFile; fileRef = 38CF1C6B2749C9294D9067CA226216DF /* FSCalendarTransitionCoordinator.m */; }; + CDB2195B09973FF1A90E093B2DA73FEE /* FirebaseCore-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 09A7B762CB60821CB42BC3F28718BAFA /* FirebaseCore-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CE8CABEF8DD52D0E6DCBF81798F6BC02 /* Pods-Verdnaturaventas-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CF77B1A38D0903FE3F389D418FE9ADC1 /* Pods-Verdnaturaventas-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CEE0F11B7D13AF6CDA079F544A127554 /* GTMNSData+zlib.m in Sources */ = {isa = PBXBuildFile; fileRef = 05B1B35EA6084639A69C79611DB5E11C /* GTMNSData+zlib.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + D4D85DCC77C00686249407005DBAA53E /* FIRMutableDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = C30687A940012403EFA730AEFE5CB3DD /* FIRMutableDictionary.h */; settings = {ATTRIBUTES = (Private, ); }; }; + D4F3BEEB43698475E5443150838E84ED /* FSCalendarStickyHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB860C9D1347C7CEC25B999446C2284 /* FSCalendarStickyHeader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DA625BE200A2E8AD3A51CB233D33B598 /* FIRNetworkURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F719F399EA40A8FF8E9E7A2C375A5 /* FIRNetworkURLSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; + DA7452CF7FB69698A73DD19CC863D03C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67251054416787A00C730B66D48AE88A /* SystemConfiguration.framework */; }; + DD4646CBC5149731A9BE6061106B0CC7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5CE9C7DB77BA04C8A1EE75BA4A06FC3 /* QuartzCore.framework */; }; + DFB4D54E24E9B7EBD4A66946569162E6 /* FIRNetworkConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A27996E36B2299E65F3EFF24C5ABB /* FIRNetworkConstants.m */; }; + E181395E73163EB702FCE9A21403D67B /* pb_encode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CBDEE7B3B2971DCCC4A60E26D1F3342 /* pb_encode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E1959EA54A2CBA1858855C530C844337 /* FIRNetworkConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = E8E73576DC8F24B3BB0BFD7203F2158A /* FIRNetworkConstants.h */; settings = {ATTRIBUTES = (Private, ); }; }; + E1B077BAFD8840CA3D96BB4545B7B255 /* FSCalendarScopeHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CFAE936A4D8B325AC001CD8C9323797 /* FSCalendarScopeHandle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E3B93CDF418A2678614DDAD9331C0C0D /* FSCalendarCollectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = C60DDCF431718A1AC18808427293538D /* FSCalendarCollectionView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E5A5D0A0FE946574D88719130B234B84 /* FIRErrorCode.h in Headers */ = {isa = PBXBuildFile; fileRef = DA049D4B28B0D335207CEC065EBECEB8 /* FIRErrorCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + E5D01D1436ED6AED3103E3ECA01F6C4E /* FIRMutableDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 39124FCC5BD6C20693C6EC17A9EDF327 /* FIRMutableDictionary.m */; }; + EBDEB68E8A470B9A82FA5AF8315E1CC4 /* FIRErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 25027CBBD521F1DF274E6C1AD1445200 /* FIRErrors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + ECABF181D9C27016DA9E9DE06E03F9E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */; }; + ECDED525D94D5EB2C6E2A2430C263091 /* FIRApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 792A46C182FE3E1B70856570FA8F5B91 /* FIRApp.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EE078A13105301767BE0ECAC1705A9B5 /* FSCalendarStickyHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 646DBF373747A9DB3C8D33ECEE53CD59 /* FSCalendarStickyHeader.m */; }; + EE2852BDCE8909B07AFEB2D585379DDE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DE76204366970D4EB7EAF45849855543 /* UIKit.framework */; }; + F14DE07709E12D0D1913F2590548B202 /* FIRNetworkMessageCode.h in Headers */ = {isa = PBXBuildFile; fileRef = D8A8C6F8F2321B7B8AA6145EAC8EA9B9 /* FIRNetworkMessageCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F1846A3430EB335BFBCE2B38CC28E5AF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */; }; + F48F32411C56B14902BD1CD937E74716 /* FIRAnalyticsConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C5725C1984ED3B4DCE4F12594399FA30 /* FIRAnalyticsConfiguration.m */; }; + F4D8DA24C4BF579C3BC481E2C376A988 /* FIRVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A28A77B48E76CA45E518DD41CFB31C6 /* FIRVersion.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F54E2CAED6EAE74D9E1F878E10FA30BD /* FSCalendarDelegationFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 85D39CA6311F1677048AABE053C61337 /* FSCalendarDelegationFactory.m */; }; + F6A1EC699E916996EF2B7B4C6137DB8D /* FSCalendarHeaderView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EF70F0D0A5F89B44B0EEBD4BC18D960 /* FSCalendarHeaderView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F6E4719DEDBA73D6404445A113521CA2 /* FIROptionsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A74570DBA78A1CAA6CD68D25B142DCCF /* FIROptionsInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F746795DC38AD2DB3D584A110174FED0 /* FSCalendarCalculator.h in Headers */ = {isa = PBXBuildFile; fileRef = EC8180B9358A93673B3BE2D71D1BF57B /* FSCalendarCalculator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F75DFB5A6E8642C4964CC3968A2DD0C8 /* FSCalendarCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 503F5823BA0EF2B1E9517FC3B891A28B /* FSCalendarCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F82C7DF4CBBE4EFF86EEB12C209720EB /* FIRNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = FE6D4BBAA0CF8EE1CE9CB849EA3C1AE7 /* FIRNetwork.m */; }; + F9D92BA503505CB48EF4ECF0DDF57686 /* nanopb-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B8CD1482927F2CCC8F7F93D7E38E796E /* nanopb-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FA5FD415B2981BB2D8F0DBEAC41F705B /* FIROptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 39B940DD75C0AD725937BF1DA689726C /* FIROptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FB11BD2C3420AB15D25927163B7B5883 /* FIRAppInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EF5D0BC81360F85CD1E27D7D5DE4E6B /* FIRAppInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + FD051B5A9F3E663081656EB261A724D2 /* FSCalendarAppearance.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DF0635C09FDC291CF29CE96ADB112EA /* FSCalendarAppearance.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FDF3FB90B18F1F4C211F38110EE750A3 /* FIRApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 41C2B48038707058A88ACA7E80CC537D /* FIRApp.m */; }; + FE57FA66A59CFE7BF9DEE193BA04EA63 /* FirebaseCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 8FBED9FC43B7A4EFC930CCA52887023B /* FirebaseCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FFBEAF63A28F6A7DD881E8256F9503B7 /* FSCalendarCalculator.m in Sources */ = {isa = PBXBuildFile; fileRef = C952D1691A1E66A934D45765CA9E9C0F /* FSCalendarCalculator.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 650DFB32E50AFECE1EBB68208751A584 /* PBXContainerItemProxy */ = { + 54D5E18D452A5EDA7693AB371ADF56BD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = B2619B2813D910DBC9FE9714E0788D55; + remoteGlobalIDString = F3535EDFA606E7F458C510BC81D8F03A; + remoteInfo = GoogleToolboxForMac; + }; + 5552687950E695ABAB4010B336A315FE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = C5A2DB7A84B7B78E359870D2E1B24AA7; remoteInfo = FSCalendar; }; + 69A95F1E64EF0A7B6FD9B88896B4B4D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = E4DD95323C54A78F879DAB0F1508B8E7; + remoteInfo = nanopb; + }; + B846B2E50217608C53A06EB228367E04 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = F3535EDFA606E7F458C510BC81D8F03A; + remoteInfo = GoogleToolboxForMac; + }; + F54CD0573B0DEBD4AE1E1319BC593FA2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1BC96BED8E82CC4984352C8705A764D8; + remoteInfo = FirebaseCore; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 004D1A969174AF6C5B848624330800BB /* NSDate+FSExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSDate+FSExtension.h"; path = "FSCalendar/NSDate+FSExtension.h"; sourceTree = ""; }; - 01C90B5BA1ED973CF81DA8D2E5651F43 /* FSCalendarHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarHeader.h; path = FSCalendar/FSCalendarHeader.h; sourceTree = ""; }; - 0A612F8B03967A88706A41DBBCB40C2F /* FSCalendarEventIndicator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarEventIndicator.h; path = FSCalendar/FSCalendarEventIndicator.h; sourceTree = ""; }; - 1524B94489B35EDB0193D2795F7AC857 /* FSCalendarAppearance.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarAppearance.m; path = FSCalendar/FSCalendarAppearance.m; sourceTree = ""; }; - 18D0AC9847ACFE1E70FCA1815B8B6D61 /* FSCalendarCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCell.m; path = FSCalendar/FSCalendarCell.m; sourceTree = ""; }; - 1BB28774480DA728F69EFCE55C620818 /* NSString+FSExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+FSExtension.h"; path = "FSCalendar/NSString+FSExtension.h"; sourceTree = ""; }; - 284826027086B1CAB0D7807EA166B824 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-umbrella.h"; sourceTree = ""; }; - 2CB0C45B63CC86C4C0837D6C3D9095F1 /* FSCalendarCollectionView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCollectionView.m; path = FSCalendar/FSCalendarCollectionView.m; sourceTree = ""; }; - 3B885DB0B763A1DCD70285647F631796 /* NSDate+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSDate+FSExtension.m"; path = "FSCalendar/NSDate+FSExtension.m"; sourceTree = ""; }; - 3CD502FEBD83BB7C9A99531C9B8FF7AA /* FSCalendarHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarHeader.m; path = FSCalendar/FSCalendarHeader.m; sourceTree = ""; }; - 4C016456080B824C14A47832D1EC2588 /* UIView+FSExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+FSExtension.h"; path = "FSCalendar/UIView+FSExtension.h"; sourceTree = ""; }; - 5265AB2CFE48EE9C37E365DF67299F47 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 57A5F764D689F517AF0A280881C6A35E /* NSString+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+FSExtension.m"; path = "FSCalendar/NSString+FSExtension.m"; sourceTree = ""; }; - 59A3A667EB647318A5CB7F633A9A7EE3 /* FSCalendarAppearance.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarAppearance.h; path = FSCalendar/FSCalendarAppearance.h; sourceTree = ""; }; - 5C32D283AFF9767FE04FB3D27A2D93D5 /* FSCalendar.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = FSCalendar.modulemap; sourceTree = ""; }; - 6026ABDBA74287306D2C9518D545B324 /* UIView+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+FSExtension.m"; path = "FSCalendar/UIView+FSExtension.m"; sourceTree = ""; }; - 66A12E4D5C211678B2448F9E984899B4 /* FSCalendarConstance.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarConstance.h; path = FSCalendar/FSCalendarConstance.h; sourceTree = ""; }; - 6C6E65A2E80A14F0FB803523C77B30C5 /* FSCalendarConstance.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarConstance.m; path = FSCalendar/FSCalendarConstance.m; sourceTree = ""; }; - 6C87C1A5FB3D8DA8F4AD70BDA9D7B44A /* FSCalendar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FSCalendar-dummy.m"; sourceTree = ""; }; - 79A9DEDC89FE8336BF5FEDAAF75BF7FC /* Pods.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Pods.modulemap; sourceTree = ""; }; - 7A73BF15FC5F8D84C8C1E89BC5012F8B /* FSCalendar+IBExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FSCalendar+IBExtension.h"; path = "FSCalendar/FSCalendar+IBExtension.h"; sourceTree = ""; }; - 87B213035BAC5F75386F62D3C75D2342 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = ""; }; - 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = ""; }; - 91413329813FA6FE5A78842159E69621 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 973C6ACFE44EE61AC3EB163842687499 /* CALayer+FSExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+FSExtension.h"; path = "FSCalendar/CALayer+FSExtension.h"; sourceTree = ""; }; - 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; - 98CD1A2A02AB1888D0D56BE327D56429 /* FSCalendar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendar.m; path = FSCalendar/FSCalendar.m; sourceTree = ""; }; - 9B0AF2A7CE74D14448B0D5942BDFBA33 /* FSCalendarFlowLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarFlowLayout.h; path = FSCalendar/FSCalendarFlowLayout.h; sourceTree = ""; }; - 9B61826B3D452DCC3B687F30A891F0D0 /* FSCalendar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSCalendar-prefix.pch"; sourceTree = ""; }; - 9D9EA616D8F785AFE57E49EB2EBB9199 /* FSCalendar+IBExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FSCalendar+IBExtension.m"; path = "FSCalendar/FSCalendar+IBExtension.m"; sourceTree = ""; }; - 9E3061880F7A3AACACCC69AB2DB69555 /* FSCalendar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FSCalendar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9FDBB92A380E152AD7BD7095E586CAA2 /* FSCalendarStickyHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarStickyHeader.m; path = FSCalendar/FSCalendarStickyHeader.m; sourceTree = ""; }; - AF45E441F8C6E244BCFEA866579B5C5F /* FSCalendar-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSCalendar-umbrella.h"; sourceTree = ""; }; - B17FE42DA526E38B1BAD0E640FAC0E67 /* FSCalendarEventIndicator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarEventIndicator.m; path = FSCalendar/FSCalendarEventIndicator.m; sourceTree = ""; }; - B49CDF768CA3F6526D472C8C650B8FAC /* FSCalendarCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCell.h; path = FSCalendar/FSCalendarCell.h; sourceTree = ""; }; - BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - C0D8BCC3685C44CA28E320CCFDFC5896 /* FSCalendarAnimator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarAnimator.h; path = FSCalendar/FSCalendarAnimator.h; sourceTree = ""; }; - C960DB8A2528D516D3A13FCCA82C3B66 /* FSCalendarCollectionView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCollectionView.h; path = FSCalendar/FSCalendarCollectionView.h; sourceTree = ""; }; - CBC0F7C552B739C909B650A0F42F7F38 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; - CC1E62AB45C7FE4D10390474B2FDE645 /* FSCalendar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendar.h; path = FSCalendar/FSCalendar.h; sourceTree = ""; }; - D0405803033A2A777B8E4DFA0C1800ED /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; - D49228A8363C97A98756ABE725AC608C /* FSCalendarDynamicHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarDynamicHeader.h; path = FSCalendar/FSCalendarDynamicHeader.h; sourceTree = ""; }; - D9DE615671731BF3AEFB3CB1F984FA8F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; - DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; - E642B1A057ADA2ABEF90BE2417F349C1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - E7F21354943D9F42A70697D5A5EF72E9 /* Pods-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-frameworks.sh"; sourceTree = ""; }; - E8446514FBAD26C0E18F24A5715AEF67 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EAE96FA9099CE5E9A94A75A3F757BB9E /* FSCalendarStickyHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarStickyHeader.h; path = FSCalendar/FSCalendarStickyHeader.h; sourceTree = ""; }; - F0D56D8E51D040808E96D623109D9677 /* CALayer+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+FSExtension.m"; path = "FSCalendar/CALayer+FSExtension.m"; sourceTree = ""; }; - F9180C6EAEB7510676867403C29B059D /* FSCalendarAnimator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarAnimator.m; path = FSCalendar/FSCalendarAnimator.m; sourceTree = ""; }; - F964C9BC17A31A59BCDAD81259391E99 /* FSCalendar.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FSCalendar.xcconfig; sourceTree = ""; }; - FF20F0CC674B99CCEC0A85786BDCDB05 /* FSCalendarFlowLayout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarFlowLayout.m; path = FSCalendar/FSCalendarFlowLayout.m; sourceTree = ""; }; + 0520666223B1464C2A1042753A3B324A /* FIRNetwork.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRNetwork.h; path = Firebase/Core/Private/FIRNetwork.h; sourceTree = ""; }; + 05B1B35EA6084639A69C79611DB5E11C /* GTMNSData+zlib.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "GTMNSData+zlib.m"; path = "Foundation/GTMNSData+zlib.m"; sourceTree = ""; }; + 05B39802DFBCA23AF93A18392E85549B /* FirebaseCoreDiagnostics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseCoreDiagnostics.framework; path = Frameworks/FirebaseCoreDiagnostics.framework; sourceTree = ""; }; + 08AE4D641081764B7A37D4051DBB48ED /* FSCalendarDelegationFactory.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarDelegationFactory.h; path = FSCalendar/FSCalendarDelegationFactory.h; sourceTree = ""; }; + 09A7B762CB60821CB42BC3F28718BAFA /* FirebaseCore-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FirebaseCore-umbrella.h"; sourceTree = ""; }; + 0CFAE936A4D8B325AC001CD8C9323797 /* FSCalendarScopeHandle.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarScopeHandle.h; path = FSCalendar/FSCalendarScopeHandle.h; sourceTree = ""; }; + 0EA766089CA20B31F9AAF9FFD698A906 /* Pods-Verdnaturaventas.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Verdnaturaventas.release.xcconfig"; sourceTree = ""; }; + 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 0F45A9E44F86576C7F0C54C3DC40B27A /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1231E04D35D83CD24B35D7ABA3401361 /* FSCalendarAppearance.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarAppearance.m; path = FSCalendar/FSCalendarAppearance.m; sourceTree = ""; }; + 139A27996E36B2299E65F3EFF24C5ABB /* FIRNetworkConstants.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRNetworkConstants.m; path = Firebase/Core/FIRNetworkConstants.m; sourceTree = ""; }; + 1580AFAADCE1F810322FC0303485FB89 /* FSCalendarExtensions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarExtensions.h; path = FSCalendar/FSCalendarExtensions.h; sourceTree = ""; }; + 1872B7A85540FA06824927D35B989DF5 /* Pods_Verdnaturaventas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Verdnaturaventas.framework; path = "Pods-Verdnaturaventas.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 19F80F063EA877989FDC6FC73B15AD6B /* nanopb-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "nanopb-dummy.m"; sourceTree = ""; }; + 1A28A77B48E76CA45E518DD41CFB31C6 /* FIRVersion.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRVersion.h; path = Firebase/Core/Private/FIRVersion.h; sourceTree = ""; }; + 210555D58B8A537EF18AAF0B643564F0 /* FSCalendar+Deprecated.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FSCalendar+Deprecated.m"; path = "FSCalendar/FSCalendar+Deprecated.m"; sourceTree = ""; }; + 2167BB4023599A48A8D2C42C99E73FA5 /* pb_common.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_common.c; sourceTree = ""; }; + 22772D8AEAA7A680859EF608403ABB26 /* FSCalendarDynamicHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarDynamicHeader.h; path = FSCalendar/FSCalendarDynamicHeader.h; sourceTree = ""; }; + 2309D72E5471D7E9EAE8922795A810D1 /* FSCalendar.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FSCalendar.xcconfig; sourceTree = ""; }; + 238F719F399EA40A8FF8E9E7A2C375A5 /* FIRNetworkURLSession.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRNetworkURLSession.h; path = Firebase/Core/Private/FIRNetworkURLSession.h; sourceTree = ""; }; + 25027CBBD521F1DF274E6C1AD1445200 /* FIRErrors.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRErrors.h; path = Firebase/Core/Private/FIRErrors.h; sourceTree = ""; }; + 29B39186DA8FD3698035EE44A0667012 /* FIRAnalyticsConfiguration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAnalyticsConfiguration.h; path = Firebase/Core/Public/FIRAnalyticsConfiguration.h; sourceTree = ""; }; + 2AD180C89A9A6A3C0078B34B03C67EA3 /* FSCalendarWeekdayView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarWeekdayView.h; path = FSCalendar/FSCalendarWeekdayView.h; sourceTree = ""; }; + 2FBEC2AACB122BF1A6EC846538CFABC9 /* nanopb.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = nanopb.modulemap; sourceTree = ""; }; + 3486C9585B99BC01FD7D1EBC03E64600 /* FSCalendarCollectionViewLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCollectionViewLayout.h; path = FSCalendar/FSCalendarCollectionViewLayout.h; sourceTree = ""; }; + 351FF81E84B4B87180E8A6780381D209 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 383672284380A99A83854831FA9E51F5 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 38CF1C6B2749C9294D9067CA226216DF /* FSCalendarTransitionCoordinator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarTransitionCoordinator.m; path = FSCalendar/FSCalendarTransitionCoordinator.m; sourceTree = ""; }; + 39124FCC5BD6C20693C6EC17A9EDF327 /* FIRMutableDictionary.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRMutableDictionary.m; path = Firebase/Core/FIRMutableDictionary.m; sourceTree = ""; }; + 39B940DD75C0AD725937BF1DA689726C /* FIROptions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIROptions.h; path = Firebase/Core/Public/FIROptions.h; sourceTree = ""; }; + 3B1AC7DB2CCF7ADF56404D410C65870E /* pb_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_common.h; sourceTree = ""; }; + 3C2245E95A76F72FAE93EB3BDD83FFA9 /* GTMNSData+zlib.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "GTMNSData+zlib.h"; path = "Foundation/GTMNSData+zlib.h"; sourceTree = ""; }; + 3C402C4F02A4DCD3990E69AC400F67A0 /* FIRLoggerLevel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLoggerLevel.h; path = Firebase/Core/Public/FIRLoggerLevel.h; sourceTree = ""; }; + 3DF0635C09FDC291CF29CE96ADB112EA /* FSCalendarAppearance.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarAppearance.h; path = FSCalendar/FSCalendarAppearance.h; sourceTree = ""; }; + 3EF70F0D0A5F89B44B0EEBD4BC18D960 /* FSCalendarHeaderView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarHeaderView.h; path = FSCalendar/FSCalendarHeaderView.h; sourceTree = ""; }; + 41C2B48038707058A88ACA7E80CC537D /* FIRApp.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRApp.m; path = Firebase/Core/FIRApp.m; sourceTree = ""; }; + 43F67D4116FF2D75B55B4834843815AD /* FIRReachabilityChecker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRReachabilityChecker.h; path = Firebase/Core/Private/FIRReachabilityChecker.h; sourceTree = ""; }; + 48FD4B8046F183AEDC7554A0A9E91CA6 /* nanopb.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = nanopb.xcconfig; sourceTree = ""; }; + 4C5FE2BEF334B92C5CA373188CC4BF29 /* nanopb-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "nanopb-prefix.pch"; sourceTree = ""; }; + 4CBDEE7B3B2971DCCC4A60E26D1F3342 /* pb_encode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_encode.h; sourceTree = ""; }; + 4D0AC04779E24679B434D3EFCB4A34E3 /* FSCalendarHeaderView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarHeaderView.m; path = FSCalendar/FSCalendarHeaderView.m; sourceTree = ""; }; + 503F5823BA0EF2B1E9517FC3B891A28B /* FSCalendarCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCell.h; path = FSCalendar/FSCalendarCell.h; sourceTree = ""; }; + 5565484A5722CC345FA6B4491CEB9C3A /* GoogleToolboxForMac-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GoogleToolboxForMac-dummy.m"; sourceTree = ""; }; + 55B30988B0FF0A345D59AA2878AFFD7A /* GoogleToolboxForMac-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GoogleToolboxForMac-umbrella.h"; sourceTree = ""; }; + 5C21F30C8858370CD91AD817377EACA9 /* GTMDefines.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = ""; }; + 5DB860C9D1347C7CEC25B999446C2284 /* FSCalendarStickyHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarStickyHeader.h; path = FSCalendar/FSCalendarStickyHeader.h; sourceTree = ""; }; + 5EA98271072B39305CBD4867B2D56138 /* Pods-Verdnaturaventas-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Verdnaturaventas-acknowledgements.markdown"; sourceTree = ""; }; + 6233E690F1E51D7E382E52716FFF0FB2 /* FSCalendar-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSCalendar-umbrella.h"; sourceTree = ""; }; + 646DBF373747A9DB3C8D33ECEE53CD59 /* FSCalendarStickyHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarStickyHeader.m; path = FSCalendar/FSCalendarStickyHeader.m; sourceTree = ""; }; + 657918FDD5C85532BCAFB21EB10A3E83 /* FirebaseAnalytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseAnalytics.framework; path = Frameworks/FirebaseAnalytics.framework; sourceTree = ""; }; + 67251054416787A00C730B66D48AE88A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + 6BED05F813A972D49C1739E43C5EA7BF /* FIRConfiguration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRConfiguration.h; path = Firebase/Core/Public/FIRConfiguration.h; sourceTree = ""; }; + 6EF5D0BC81360F85CD1E27D7D5DE4E6B /* FIRAppInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppInternal.h; path = Firebase/Core/Private/FIRAppInternal.h; sourceTree = ""; }; + 72377A55B5CEE608F29965BD61AE2679 /* FIRNetworkLoggerProtocol.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRNetworkLoggerProtocol.h; path = Firebase/Core/Private/FIRNetworkLoggerProtocol.h; sourceTree = ""; }; + 7290D1C3511306640537A1B1547D7242 /* FSCalendarDelegationProxy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarDelegationProxy.h; path = FSCalendar/FSCalendarDelegationProxy.h; sourceTree = ""; }; + 7516252FEA92DA8A05ED527BDB9A89DB /* Pods-Verdnaturaventas-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Verdnaturaventas-frameworks.sh"; sourceTree = ""; }; + 792A46C182FE3E1B70856570FA8F5B91 /* FIRApp.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRApp.h; path = Firebase/Core/Public/FIRApp.h; sourceTree = ""; }; + 79D39BB0E7D3E67A42B8807AC45C4C63 /* FIRLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRLogger.h; path = Firebase/Core/Private/FIRLogger.h; sourceTree = ""; }; + 7C174FFF3A79EF963F593DEAB1555D1E /* FIRReachabilityChecker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRReachabilityChecker.m; path = Firebase/Core/FIRReachabilityChecker.m; sourceTree = ""; }; + 7D52392F0665BA8ABFA8C7BE91ADE07D /* Pods-Verdnaturaventas-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Verdnaturaventas-acknowledgements.plist"; sourceTree = ""; }; + 7D99ED9BED2A718CFBBC0654CB8F5844 /* FIRConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRConfiguration.m; path = Firebase/Core/FIRConfiguration.m; sourceTree = ""; }; + 7E6FD23E19551D986E4B633D3B23728E /* FIRNetworkURLSession.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRNetworkURLSession.m; path = Firebase/Core/FIRNetworkURLSession.m; sourceTree = ""; }; + 7ED79201E0C43D9461983DFB2DDC9ADD /* FIRAnalyticsConfiguration+Internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FIRAnalyticsConfiguration+Internal.h"; path = "Firebase/Core/Private/FIRAnalyticsConfiguration+Internal.h"; sourceTree = ""; }; + 801D845191A0AA868BE6B0AAAF28AC82 /* FSCalendar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FSCalendar-dummy.m"; sourceTree = ""; }; + 840F2ABB3FEBC55A608A6AF9D7D807F3 /* FSCalendarTransitionCoordinator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarTransitionCoordinator.h; path = FSCalendar/FSCalendarTransitionCoordinator.h; sourceTree = ""; }; + 842CD672C2EAE297C23973D7B5F32307 /* FIRBundleUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRBundleUtil.h; path = Firebase/Core/Private/FIRBundleUtil.h; sourceTree = ""; }; + 85D39CA6311F1677048AABE053C61337 /* FSCalendarDelegationFactory.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarDelegationFactory.m; path = FSCalendar/FSCalendarDelegationFactory.m; sourceTree = ""; }; + 8B17E452EDBBDEC7FC1293754CC2800D /* FSCalendarCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCell.m; path = FSCalendar/FSCalendarCell.m; sourceTree = ""; }; + 8B7A0D5A9D4BBF01363C647F7866651A /* FIRLogger.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRLogger.m; path = Firebase/Core/FIRLogger.m; sourceTree = ""; }; + 8BFE5FB319B0197040F045ED09B00EF0 /* pb_decode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_decode.h; sourceTree = ""; }; + 8DDD939C31BE581CE59115BBEEE7AE04 /* FIROptions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIROptions.m; path = Firebase/Core/FIROptions.m; sourceTree = ""; }; + 8F755C5EF0FC317859C76BAA2AC8C9BA /* FSCalendar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendar.h; path = FSCalendar/FSCalendar.h; sourceTree = ""; }; + 8FBED9FC43B7A4EFC930CCA52887023B /* FirebaseCore.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FirebaseCore.h; path = Firebase/Core/Public/FirebaseCore.h; sourceTree = ""; }; + 92073E8C0539322D285E9FB1F35F9F2A /* FSCalendar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = FSCalendar.framework; path = FSCalendar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93BDF26A34993084DD9B50D710869DC1 /* FIRAppAssociationRegistration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRAppAssociationRegistration.m; path = Firebase/Core/FIRAppAssociationRegistration.m; sourceTree = ""; }; + 973E9EF1A434EE33F61AD7D3390C843C /* FIRAppEnvironmentUtil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRAppEnvironmentUtil.m; path = Firebase/Core/third_party/FIRAppEnvironmentUtil.m; sourceTree = ""; }; + 98D3B2136091E3E60C1F94FE96B6C4DA /* FSCalendarWeekdayView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarWeekdayView.m; path = FSCalendar/FSCalendarWeekdayView.m; sourceTree = ""; }; + 9A0157C9E58BC2F6A8687495D3161860 /* FirebaseCore.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FirebaseCore.xcconfig; sourceTree = ""; }; + 9BBABAE7A8B8AD6E27E5890C457AA49E /* FSCalendarScopeHandle.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarScopeHandle.m; path = FSCalendar/FSCalendarScopeHandle.m; sourceTree = ""; }; + A2A11FB4539A8C40FEE8AC0E10413796 /* nanopb.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = nanopb.framework; path = nanopb.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A74570DBA78A1CAA6CD68D25B142DCCF /* FIROptionsInternal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIROptionsInternal.h; path = Firebase/Core/Private/FIROptionsInternal.h; sourceTree = ""; }; + A7E9D8597530E787211154C65A816E2B /* FirebaseCore.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = FirebaseCore.modulemap; sourceTree = ""; }; + A9AB5695C46F1AF8DC19791DC83BB6C5 /* FIRBundleUtil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRBundleUtil.m; path = Firebase/Core/FIRBundleUtil.m; sourceTree = ""; }; + AEA471439919068EB5C442FB5187126C /* FirebaseCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = FirebaseCore.framework; path = FirebaseCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AF90194A983E221C629D557491DEE066 /* FIRReachabilityChecker+Internal.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FIRReachabilityChecker+Internal.h"; path = "Firebase/Core/Private/FIRReachabilityChecker+Internal.h"; sourceTree = ""; }; + B2E9D578908FECC2CD1BEEA7664D8B1A /* FSCalendarConstants.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarConstants.m; path = FSCalendar/FSCalendarConstants.m; sourceTree = ""; }; + B5CE9C7DB77BA04C8A1EE75BA4A06FC3 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + B63AD503D8671E5E71CE55CBC3536486 /* Pods-Verdnaturaventas.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Verdnaturaventas.modulemap"; sourceTree = ""; }; + B66AC7703E37D283DDAC86A54C37D61D /* Pods-Verdnaturaventas.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Verdnaturaventas.debug.xcconfig"; sourceTree = ""; }; + B8595AEC88B58FF9D7151B75134AD320 /* FIRAppEnvironmentUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppEnvironmentUtil.h; path = Firebase/Core/third_party/FIRAppEnvironmentUtil.h; sourceTree = ""; }; + B8CD1482927F2CCC8F7F93D7E38E796E /* nanopb-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "nanopb-umbrella.h"; sourceTree = ""; }; + BA79099C1ECFDA2A20EDE6264282DD78 /* FSCalendarConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarConstants.h; path = FSCalendar/FSCalendarConstants.h; sourceTree = ""; }; + BC051C11E19063609191FDCDEF12EA05 /* pb_decode.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_decode.c; sourceTree = ""; }; + BD88B5B56DBEE99323A5C9B68AB73590 /* GoogleToolboxForMac.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GoogleToolboxForMac.framework; path = GoogleToolboxForMac.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C30687A940012403EFA730AEFE5CB3DD /* FIRMutableDictionary.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRMutableDictionary.h; path = Firebase/Core/Private/FIRMutableDictionary.h; sourceTree = ""; }; + C536A358972E4C1FD3133470F60CF05C /* FIRVersion.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRVersion.m; path = Firebase/Core/FIRVersion.m; sourceTree = ""; }; + C5725C1984ED3B4DCE4F12594399FA30 /* FIRAnalyticsConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRAnalyticsConfiguration.m; path = Firebase/Core/FIRAnalyticsConfiguration.m; sourceTree = ""; }; + C60DDCF431718A1AC18808427293538D /* FSCalendarCollectionView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCollectionView.h; path = FSCalendar/FSCalendarCollectionView.h; sourceTree = ""; }; + C66309F6CF9CB2283EBC6F087A4A3E8C /* FSCalendar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSCalendar-prefix.pch"; sourceTree = ""; }; + C952D1691A1E66A934D45765CA9E9C0F /* FSCalendarCalculator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCalculator.m; path = FSCalendar/FSCalendarCalculator.m; sourceTree = ""; }; + C9B9E34D862280E14DC42AACDBDE6892 /* FIRAppAssociationRegistration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRAppAssociationRegistration.h; path = Firebase/Core/Private/FIRAppAssociationRegistration.h; sourceTree = ""; }; + CABCF0072115D1221503826FEF199A98 /* FirebaseNanoPB.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseNanoPB.framework; path = Frameworks/FirebaseNanoPB.framework; sourceTree = ""; }; + CF77B1A38D0903FE3F389D418FE9ADC1 /* Pods-Verdnaturaventas-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Verdnaturaventas-umbrella.h"; sourceTree = ""; }; + D10F972E823193A9F3CB1849FF8C8878 /* Pods-Verdnaturaventas-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Verdnaturaventas-dummy.m"; sourceTree = ""; }; + D1F1780DE9196972DC49E3D6F522FAC6 /* FSCalendarCollectionView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCollectionView.m; path = FSCalendar/FSCalendarCollectionView.m; sourceTree = ""; }; + D7BBD78AEDC3716F12FD340CD362B8A0 /* pb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb.h; sourceTree = ""; }; + D8A8C6F8F2321B7B8AA6145EAC8EA9B9 /* FIRNetworkMessageCode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRNetworkMessageCode.h; path = Firebase/Core/Private/FIRNetworkMessageCode.h; sourceTree = ""; }; + DA049D4B28B0D335207CEC065EBECEB8 /* FIRErrorCode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRErrorCode.h; path = Firebase/Core/Private/FIRErrorCode.h; sourceTree = ""; }; + DB0BBD28905311E92E801F16265BDB3A /* FSCalendarDelegationProxy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarDelegationProxy.m; path = FSCalendar/FSCalendarDelegationProxy.m; sourceTree = ""; }; + DE1104D7DA8059246D8C2695461A02B1 /* FirebaseCore-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FirebaseCore-dummy.m"; sourceTree = ""; }; + DE76204366970D4EB7EAF45849855543 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + DF9E91A87FCA970626934467BE94FDCC /* Pods-Verdnaturaventas-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Verdnaturaventas-resources.sh"; sourceTree = ""; }; + DFBC7767AC30D62B4005282179736A6E /* Firebase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Firebase.h; path = CoreOnly/Sources/Firebase.h; sourceTree = ""; }; + E851EE177A5ECB157B09BD3F14079B64 /* pb_encode.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_encode.c; sourceTree = ""; }; + E8E73576DC8F24B3BB0BFD7203F2158A /* FIRNetworkConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FIRNetworkConstants.h; path = Firebase/Core/Private/FIRNetworkConstants.h; sourceTree = ""; }; + EA57B9F71E1107695772C8AA8244B486 /* FSCalendar.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = FSCalendar.modulemap; sourceTree = ""; }; + EC8180B9358A93673B3BE2D71D1BF57B /* FSCalendarCalculator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCalculator.h; path = FSCalendar/FSCalendarCalculator.h; sourceTree = ""; }; + EDC409591B76A9F6D61587293BD29A4F /* FSCalendar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendar.m; path = FSCalendar/FSCalendar.m; sourceTree = ""; }; + EEAFA1D6762DD5638F6AE74C20520DF7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EF7DC8D3189B7EC2FFB59053F5C6DA5B /* FSCalendarExtensions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarExtensions.m; path = FSCalendar/FSCalendarExtensions.m; sourceTree = ""; }; + F403529C82AB8F8EF0AEBCD2C83CB2B7 /* GoogleToolboxForMac.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = GoogleToolboxForMac.modulemap; sourceTree = ""; }; + F6713C7E904A605DF5DD72B573ADB624 /* FIRErrors.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRErrors.m; path = Firebase/Core/FIRErrors.m; sourceTree = ""; }; + F8D36426AD3A6D2E0551AB4043062845 /* FSCalendarCollectionViewLayout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCollectionViewLayout.m; path = FSCalendar/FSCalendarCollectionViewLayout.m; sourceTree = ""; }; + F9160C39B9B4AEA1A5BD85A0B8ABB13D /* FirebaseInstanceID.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseInstanceID.framework; path = Frameworks/FirebaseInstanceID.framework; sourceTree = ""; }; + FAB5835AD74ED92BA2B30BFDFC2E3DF9 /* GoogleToolboxForMac-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GoogleToolboxForMac-prefix.pch"; sourceTree = ""; }; + FE6D4BBAA0CF8EE1CE9CB849EA3C1AE7 /* FIRNetwork.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FIRNetwork.m; path = Firebase/Core/FIRNetwork.m; sourceTree = ""; }; + FF5095C3633F99391A3315D956CCFAAC /* GoogleToolboxForMac.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GoogleToolboxForMac.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 24A6EBA9EAE5017F65E804F351F8C1E0 /* Frameworks */ = { + 2B0C121755DBF940DA569A041E683C9E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 30D2A77C4197DF77DEAF13D41D97FAB1 /* Foundation.framework in Frameworks */, - B4C6C827EDB0DF9F605FF4C2FA3626E0 /* QuartzCore.framework in Frameworks */, - 4960C49802C172EF3469FEC6DCBC1318 /* UIKit.framework in Frameworks */, + 5CE58FA585A19EE7F88D520FAE62DF11 /* Foundation.framework in Frameworks */, + DD4646CBC5149731A9BE6061106B0CC7 /* QuartzCore.framework in Frameworks */, + EE2852BDCE8909B07AFEB2D585379DDE /* UIKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - AB7412433C3884CC52DB362959E37E08 /* Frameworks */ = { + 94A4C9099E418E828F86C588AA95CE89 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E20A253E8B32E3679DD1B13844709F26 /* Foundation.framework in Frameworks */, + ECABF181D9C27016DA9E9DE06E03F9E4 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 971041836592E28ADEEDA495A96A62A2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 52F333DF6E858B07AEBCB2DBF2A99976 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CE41125430BCF410B9E4B1B44E90786F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F1846A3430EB335BFBCE2B38CC28E5AF /* Foundation.framework in Frameworks */, + DA7452CF7FB69698A73DD19CC863D03C /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EBA94EBD766F0AD901DB2A14CB1E202B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9BBD467B0D509C44DE0848E18CDF4BBA /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0FE21D7E9190CB8FF3DAA291EA7B46F2 /* Support Files */ = { + 13D24B754F440CAB72F0A70AC46B5BC2 /* Support Files */ = { isa = PBXGroup; children = ( - 5C32D283AFF9767FE04FB3D27A2D93D5 /* FSCalendar.modulemap */, - F964C9BC17A31A59BCDAD81259391E99 /* FSCalendar.xcconfig */, - 6C87C1A5FB3D8DA8F4AD70BDA9D7B44A /* FSCalendar-dummy.m */, - 9B61826B3D452DCC3B687F30A891F0D0 /* FSCalendar-prefix.pch */, - AF45E441F8C6E244BCFEA866579B5C5F /* FSCalendar-umbrella.h */, - 5265AB2CFE48EE9C37E365DF67299F47 /* Info.plist */, + A7E9D8597530E787211154C65A816E2B /* FirebaseCore.modulemap */, + 9A0157C9E58BC2F6A8687495D3161860 /* FirebaseCore.xcconfig */, + DE1104D7DA8059246D8C2695461A02B1 /* FirebaseCore-dummy.m */, + 09A7B762CB60821CB42BC3F28718BAFA /* FirebaseCore-umbrella.h */, ); name = "Support Files"; - path = "../Target Support Files/FSCalendar"; + path = "../Target Support Files/FirebaseCore"; sourceTree = ""; }; - 122DA2E5084A4393C29BE363C764795C /* Frameworks */ = { + 14B8B9B15ECBE87983FF987239AB2D7B /* Frameworks */ = { isa = PBXGroup; children = ( - DA23025FEDA7F7FE2AACB2532BD80D14 /* iOS */, + 3A1EDC539818BA91AFE186AB504AAA41 /* iOS */, ); name = Frameworks; sourceTree = ""; }; - 1691A473B2A86C771E7F849527F3C2D0 /* Products */ = { + 1A93661514359BD8ECDF98275CEAD053 /* Targets Support Files */ = { isa = PBXGroup; children = ( - 9E3061880F7A3AACACCC69AB2DB69555 /* FSCalendar.framework */, - 284826027086B1CAB0D7807EA166B824 /* Pods.framework */, + A67B337B079748BE2313879C1F3E4ED5 /* Pods-Verdnaturaventas */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 217E7BE12CD92EA325A9A00D362B5632 /* GoogleToolboxForMac */ = { + isa = PBXGroup; + children = ( + F11BD7FA2BB484499E34335907BC022C /* Defines */, + 5D544270FA3DC0AC82B80481F6B7C9D5 /* NSData+zlib */, + DDA67509CD01110678EA561475A13C06 /* Support Files */, + ); + name = GoogleToolboxForMac; + path = GoogleToolboxForMac; + sourceTree = ""; + }; + 2492A6E740C9AA775DB319C047ECE6F5 /* FSCalendar */ = { + isa = PBXGroup; + children = ( + 8F755C5EF0FC317859C76BAA2AC8C9BA /* FSCalendar.h */, + EDC409591B76A9F6D61587293BD29A4F /* FSCalendar.m */, + 210555D58B8A537EF18AAF0B643564F0 /* FSCalendar+Deprecated.m */, + 3DF0635C09FDC291CF29CE96ADB112EA /* FSCalendarAppearance.h */, + 1231E04D35D83CD24B35D7ABA3401361 /* FSCalendarAppearance.m */, + EC8180B9358A93673B3BE2D71D1BF57B /* FSCalendarCalculator.h */, + C952D1691A1E66A934D45765CA9E9C0F /* FSCalendarCalculator.m */, + 503F5823BA0EF2B1E9517FC3B891A28B /* FSCalendarCell.h */, + 8B17E452EDBBDEC7FC1293754CC2800D /* FSCalendarCell.m */, + C60DDCF431718A1AC18808427293538D /* FSCalendarCollectionView.h */, + D1F1780DE9196972DC49E3D6F522FAC6 /* FSCalendarCollectionView.m */, + 3486C9585B99BC01FD7D1EBC03E64600 /* FSCalendarCollectionViewLayout.h */, + F8D36426AD3A6D2E0551AB4043062845 /* FSCalendarCollectionViewLayout.m */, + BA79099C1ECFDA2A20EDE6264282DD78 /* FSCalendarConstants.h */, + B2E9D578908FECC2CD1BEEA7664D8B1A /* FSCalendarConstants.m */, + 08AE4D641081764B7A37D4051DBB48ED /* FSCalendarDelegationFactory.h */, + 85D39CA6311F1677048AABE053C61337 /* FSCalendarDelegationFactory.m */, + 7290D1C3511306640537A1B1547D7242 /* FSCalendarDelegationProxy.h */, + DB0BBD28905311E92E801F16265BDB3A /* FSCalendarDelegationProxy.m */, + 22772D8AEAA7A680859EF608403ABB26 /* FSCalendarDynamicHeader.h */, + 1580AFAADCE1F810322FC0303485FB89 /* FSCalendarExtensions.h */, + EF7DC8D3189B7EC2FFB59053F5C6DA5B /* FSCalendarExtensions.m */, + 3EF70F0D0A5F89B44B0EEBD4BC18D960 /* FSCalendarHeaderView.h */, + 4D0AC04779E24679B434D3EFCB4A34E3 /* FSCalendarHeaderView.m */, + 0CFAE936A4D8B325AC001CD8C9323797 /* FSCalendarScopeHandle.h */, + 9BBABAE7A8B8AD6E27E5890C457AA49E /* FSCalendarScopeHandle.m */, + 5DB860C9D1347C7CEC25B999446C2284 /* FSCalendarStickyHeader.h */, + 646DBF373747A9DB3C8D33ECEE53CD59 /* FSCalendarStickyHeader.m */, + 840F2ABB3FEBC55A608A6AF9D7D807F3 /* FSCalendarTransitionCoordinator.h */, + 38CF1C6B2749C9294D9067CA226216DF /* FSCalendarTransitionCoordinator.m */, + 2AD180C89A9A6A3C0078B34B03C67EA3 /* FSCalendarWeekdayView.h */, + 98D3B2136091E3E60C1F94FE96B6C4DA /* FSCalendarWeekdayView.m */, + AD1A83561692BA8AD3E677137D47EC95 /* Support Files */, + ); + name = FSCalendar; + path = FSCalendar; + sourceTree = ""; + }; + 2D519F65F31E43441DBA51530DF8D3C7 /* Products */ = { + isa = PBXGroup; + children = ( + AEA471439919068EB5C442FB5187126C /* FirebaseCore.framework */, + 92073E8C0539322D285E9FB1F35F9F2A /* FSCalendar.framework */, + BD88B5B56DBEE99323A5C9B68AB73590 /* GoogleToolboxForMac.framework */, + A2A11FB4539A8C40FEE8AC0E10413796 /* nanopb.framework */, + 1872B7A85540FA06824927D35B989DF5 /* Pods_Verdnaturaventas.framework */, ); name = Products; sourceTree = ""; }; - 1B1414788D00FCDBBFC0ED4163A1B2E6 /* Pods */ = { + 3A1EDC539818BA91AFE186AB504AAA41 /* iOS */ = { isa = PBXGroup; children = ( - 5F7358C36BC3B85F670329793E837256 /* FSCalendar */, + 0F1D1D817F155DE694BC9CEF76762417 /* Foundation.framework */, + B5CE9C7DB77BA04C8A1EE75BA4A06FC3 /* QuartzCore.framework */, + 67251054416787A00C730B66D48AE88A /* SystemConfiguration.framework */, + DE76204366970D4EB7EAF45849855543 /* UIKit.framework */, ); - name = Pods; + name = iOS; sourceTree = ""; }; - 5F7358C36BC3B85F670329793E837256 /* FSCalendar */ = { + 3E8A7CC162A81F27054D1F7243407CB7 /* Frameworks */ = { isa = PBXGroup; children = ( - 973C6ACFE44EE61AC3EB163842687499 /* CALayer+FSExtension.h */, - F0D56D8E51D040808E96D623109D9677 /* CALayer+FSExtension.m */, - CC1E62AB45C7FE4D10390474B2FDE645 /* FSCalendar.h */, - 98CD1A2A02AB1888D0D56BE327D56429 /* FSCalendar.m */, - 7A73BF15FC5F8D84C8C1E89BC5012F8B /* FSCalendar+IBExtension.h */, - 9D9EA616D8F785AFE57E49EB2EBB9199 /* FSCalendar+IBExtension.m */, - C0D8BCC3685C44CA28E320CCFDFC5896 /* FSCalendarAnimator.h */, - F9180C6EAEB7510676867403C29B059D /* FSCalendarAnimator.m */, - 59A3A667EB647318A5CB7F633A9A7EE3 /* FSCalendarAppearance.h */, - 1524B94489B35EDB0193D2795F7AC857 /* FSCalendarAppearance.m */, - B49CDF768CA3F6526D472C8C650B8FAC /* FSCalendarCell.h */, - 18D0AC9847ACFE1E70FCA1815B8B6D61 /* FSCalendarCell.m */, - C960DB8A2528D516D3A13FCCA82C3B66 /* FSCalendarCollectionView.h */, - 2CB0C45B63CC86C4C0837D6C3D9095F1 /* FSCalendarCollectionView.m */, - 66A12E4D5C211678B2448F9E984899B4 /* FSCalendarConstance.h */, - 6C6E65A2E80A14F0FB803523C77B30C5 /* FSCalendarConstance.m */, - D49228A8363C97A98756ABE725AC608C /* FSCalendarDynamicHeader.h */, - 0A612F8B03967A88706A41DBBCB40C2F /* FSCalendarEventIndicator.h */, - B17FE42DA526E38B1BAD0E640FAC0E67 /* FSCalendarEventIndicator.m */, - 9B0AF2A7CE74D14448B0D5942BDFBA33 /* FSCalendarFlowLayout.h */, - FF20F0CC674B99CCEC0A85786BDCDB05 /* FSCalendarFlowLayout.m */, - 01C90B5BA1ED973CF81DA8D2E5651F43 /* FSCalendarHeader.h */, - 3CD502FEBD83BB7C9A99531C9B8FF7AA /* FSCalendarHeader.m */, - EAE96FA9099CE5E9A94A75A3F757BB9E /* FSCalendarStickyHeader.h */, - 9FDBB92A380E152AD7BD7095E586CAA2 /* FSCalendarStickyHeader.m */, - 004D1A969174AF6C5B848624330800BB /* NSDate+FSExtension.h */, - 3B885DB0B763A1DCD70285647F631796 /* NSDate+FSExtension.m */, - 1BB28774480DA728F69EFCE55C620818 /* NSString+FSExtension.h */, - 57A5F764D689F517AF0A280881C6A35E /* NSString+FSExtension.m */, - 4C016456080B824C14A47832D1EC2588 /* UIView+FSExtension.h */, - 6026ABDBA74287306D2C9518D545B324 /* UIView+FSExtension.m */, - 0FE21D7E9190CB8FF3DAA291EA7B46F2 /* Support Files */, + F9160C39B9B4AEA1A5BD85A0B8ABB13D /* FirebaseInstanceID.framework */, ); - path = FSCalendar; + name = Frameworks; sourceTree = ""; }; - 75D98FF52E597A11900E131B6C4E1ADA /* Pods */ = { + 4EF4C58484E602474AF2CCB01ABB0CB7 /* encode */ = { isa = PBXGroup; children = ( - E8446514FBAD26C0E18F24A5715AEF67 /* Info.plist */, - 79A9DEDC89FE8336BF5FEDAAF75BF7FC /* Pods.modulemap */, - D0405803033A2A777B8E4DFA0C1800ED /* Pods-acknowledgements.markdown */, - 87B213035BAC5F75386F62D3C75D2342 /* Pods-acknowledgements.plist */, - 894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */, - E7F21354943D9F42A70697D5A5EF72E9 /* Pods-frameworks.sh */, - CBC0F7C552B739C909B650A0F42F7F38 /* Pods-resources.sh */, - 2BCC458FDD5F692BBB2BFC64BB5701FC /* Pods-umbrella.h */, - 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */, - DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */, ); - name = Pods; - path = "Target Support Files/Pods"; + name = encode; + sourceTree = ""; + }; + 5528F56625FDE19977A9CDD93CF6A2BC /* CoreOnly */ = { + isa = PBXGroup; + children = ( + DFBC7767AC30D62B4005282179736A6E /* Firebase.h */, + ); + name = CoreOnly; + sourceTree = ""; + }; + 5D544270FA3DC0AC82B80481F6B7C9D5 /* NSData+zlib */ = { + isa = PBXGroup; + children = ( + 3C2245E95A76F72FAE93EB3BDD83FFA9 /* GTMNSData+zlib.h */, + 05B1B35EA6084639A69C79611DB5E11C /* GTMNSData+zlib.m */, + ); + name = "NSData+zlib"; + sourceTree = ""; + }; + 67DC3D515EAA21963BFCA4FE3CBB3DA1 /* FirebaseAnalytics */ = { + isa = PBXGroup; + children = ( + BEF493C7194426729775A4DB02DD7DFB /* Frameworks */, + ); + name = FirebaseAnalytics; + path = FirebaseAnalytics; sourceTree = ""; }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( - BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, - 122DA2E5084A4393C29BE363C764795C /* Frameworks */, - 1B1414788D00FCDBBFC0ED4163A1B2E6 /* Pods */, - 1691A473B2A86C771E7F849527F3C2D0 /* Products */, - B7B80995527643776607AFFA75B91E24 /* Targets Support Files */, + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 14B8B9B15ECBE87983FF987239AB2D7B /* Frameworks */, + D6F02ABBD58C9BC061779E928E5B051B /* Pods */, + 2D519F65F31E43441DBA51530DF8D3C7 /* Products */, + 1A93661514359BD8ECDF98275CEAD053 /* Targets Support Files */, ); sourceTree = ""; }; - B7B80995527643776607AFFA75B91E24 /* Targets Support Files */ = { + 82ED9830B270F6AE396A4D9BE610760F /* FirebaseInstanceID */ = { isa = PBXGroup; children = ( - 75D98FF52E597A11900E131B6C4E1ADA /* Pods */, + 3E8A7CC162A81F27054D1F7243407CB7 /* Frameworks */, ); - name = "Targets Support Files"; + name = FirebaseInstanceID; + path = FirebaseInstanceID; sourceTree = ""; }; - DA23025FEDA7F7FE2AACB2532BD80D14 /* iOS */ = { + A67B337B079748BE2313879C1F3E4ED5 /* Pods-Verdnaturaventas */ = { isa = PBXGroup; children = ( - 91413329813FA6FE5A78842159E69621 /* Foundation.framework */, - E642B1A057ADA2ABEF90BE2417F349C1 /* QuartzCore.framework */, - D9DE615671731BF3AEFB3CB1F984FA8F /* UIKit.framework */, + 0F45A9E44F86576C7F0C54C3DC40B27A /* Info.plist */, + B63AD503D8671E5E71CE55CBC3536486 /* Pods-Verdnaturaventas.modulemap */, + 5EA98271072B39305CBD4867B2D56138 /* Pods-Verdnaturaventas-acknowledgements.markdown */, + 7D52392F0665BA8ABFA8C7BE91ADE07D /* Pods-Verdnaturaventas-acknowledgements.plist */, + D10F972E823193A9F3CB1849FF8C8878 /* Pods-Verdnaturaventas-dummy.m */, + 7516252FEA92DA8A05ED527BDB9A89DB /* Pods-Verdnaturaventas-frameworks.sh */, + DF9E91A87FCA970626934467BE94FDCC /* Pods-Verdnaturaventas-resources.sh */, + CF77B1A38D0903FE3F389D418FE9ADC1 /* Pods-Verdnaturaventas-umbrella.h */, + B66AC7703E37D283DDAC86A54C37D61D /* Pods-Verdnaturaventas.debug.xcconfig */, + 0EA766089CA20B31F9AAF9FFD698A906 /* Pods-Verdnaturaventas.release.xcconfig */, ); - name = iOS; + name = "Pods-Verdnaturaventas"; + path = "Target Support Files/Pods-Verdnaturaventas"; + sourceTree = ""; + }; + A937DE67ACEC17F39A78AC08562D2161 /* Support Files */ = { + isa = PBXGroup; + children = ( + 351FF81E84B4B87180E8A6780381D209 /* Info.plist */, + 2FBEC2AACB122BF1A6EC846538CFABC9 /* nanopb.modulemap */, + 48FD4B8046F183AEDC7554A0A9E91CA6 /* nanopb.xcconfig */, + 19F80F063EA877989FDC6FC73B15AD6B /* nanopb-dummy.m */, + 4C5FE2BEF334B92C5CA373188CC4BF29 /* nanopb-prefix.pch */, + B8CD1482927F2CCC8F7F93D7E38E796E /* nanopb-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/nanopb"; + sourceTree = ""; + }; + AD1A83561692BA8AD3E677137D47EC95 /* Support Files */ = { + isa = PBXGroup; + children = ( + EA57B9F71E1107695772C8AA8244B486 /* FSCalendar.modulemap */, + 2309D72E5471D7E9EAE8922795A810D1 /* FSCalendar.xcconfig */, + 801D845191A0AA868BE6B0AAAF28AC82 /* FSCalendar-dummy.m */, + C66309F6CF9CB2283EBC6F087A4A3E8C /* FSCalendar-prefix.pch */, + 6233E690F1E51D7E382E52716FFF0FB2 /* FSCalendar-umbrella.h */, + EEAFA1D6762DD5638F6AE74C20520DF7 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/FSCalendar"; + sourceTree = ""; + }; + B098422968CD3B796795DDF09DE0F38D /* decode */ = { + isa = PBXGroup; + children = ( + ); + name = decode; + sourceTree = ""; + }; + BEF493C7194426729775A4DB02DD7DFB /* Frameworks */ = { + isa = PBXGroup; + children = ( + 657918FDD5C85532BCAFB21EB10A3E83 /* FirebaseAnalytics.framework */, + 05B39802DFBCA23AF93A18392E85549B /* FirebaseCoreDiagnostics.framework */, + CABCF0072115D1221503826FEF199A98 /* FirebaseNanoPB.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C5A0F3C8D9CF43273E5FF838584E36A6 /* nanopb */ = { + isa = PBXGroup; + children = ( + D7BBD78AEDC3716F12FD340CD362B8A0 /* pb.h */, + 2167BB4023599A48A8D2C42C99E73FA5 /* pb_common.c */, + 3B1AC7DB2CCF7ADF56404D410C65870E /* pb_common.h */, + BC051C11E19063609191FDCDEF12EA05 /* pb_decode.c */, + 8BFE5FB319B0197040F045ED09B00EF0 /* pb_decode.h */, + E851EE177A5ECB157B09BD3F14079B64 /* pb_encode.c */, + 4CBDEE7B3B2971DCCC4A60E26D1F3342 /* pb_encode.h */, + B098422968CD3B796795DDF09DE0F38D /* decode */, + 4EF4C58484E602474AF2CCB01ABB0CB7 /* encode */, + A937DE67ACEC17F39A78AC08562D2161 /* Support Files */, + ); + name = nanopb; + path = nanopb; + sourceTree = ""; + }; + D6F02ABBD58C9BC061779E928E5B051B /* Pods */ = { + isa = PBXGroup; + children = ( + F5A9A2357C8F23EB0A4E888096569009 /* Firebase */, + 67DC3D515EAA21963BFCA4FE3CBB3DA1 /* FirebaseAnalytics */, + FD698990C2D59E305B7F68DD492D83BE /* FirebaseCore */, + 82ED9830B270F6AE396A4D9BE610760F /* FirebaseInstanceID */, + 2492A6E740C9AA775DB319C047ECE6F5 /* FSCalendar */, + 217E7BE12CD92EA325A9A00D362B5632 /* GoogleToolboxForMac */, + C5A0F3C8D9CF43273E5FF838584E36A6 /* nanopb */, + ); + name = Pods; + sourceTree = ""; + }; + DDA67509CD01110678EA561475A13C06 /* Support Files */ = { + isa = PBXGroup; + children = ( + F403529C82AB8F8EF0AEBCD2C83CB2B7 /* GoogleToolboxForMac.modulemap */, + FF5095C3633F99391A3315D956CCFAAC /* GoogleToolboxForMac.xcconfig */, + 5565484A5722CC345FA6B4491CEB9C3A /* GoogleToolboxForMac-dummy.m */, + FAB5835AD74ED92BA2B30BFDFC2E3DF9 /* GoogleToolboxForMac-prefix.pch */, + 55B30988B0FF0A345D59AA2878AFFD7A /* GoogleToolboxForMac-umbrella.h */, + 383672284380A99A83854831FA9E51F5 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/GoogleToolboxForMac"; + sourceTree = ""; + }; + F11BD7FA2BB484499E34335907BC022C /* Defines */ = { + isa = PBXGroup; + children = ( + 5C21F30C8858370CD91AD817377EACA9 /* GTMDefines.h */, + ); + name = Defines; + sourceTree = ""; + }; + F5A9A2357C8F23EB0A4E888096569009 /* Firebase */ = { + isa = PBXGroup; + children = ( + 5528F56625FDE19977A9CDD93CF6A2BC /* CoreOnly */, + ); + name = Firebase; + path = Firebase; + sourceTree = ""; + }; + FD698990C2D59E305B7F68DD492D83BE /* FirebaseCore */ = { + isa = PBXGroup; + children = ( + 29B39186DA8FD3698035EE44A0667012 /* FIRAnalyticsConfiguration.h */, + C5725C1984ED3B4DCE4F12594399FA30 /* FIRAnalyticsConfiguration.m */, + 7ED79201E0C43D9461983DFB2DDC9ADD /* FIRAnalyticsConfiguration+Internal.h */, + 792A46C182FE3E1B70856570FA8F5B91 /* FIRApp.h */, + 41C2B48038707058A88ACA7E80CC537D /* FIRApp.m */, + C9B9E34D862280E14DC42AACDBDE6892 /* FIRAppAssociationRegistration.h */, + 93BDF26A34993084DD9B50D710869DC1 /* FIRAppAssociationRegistration.m */, + B8595AEC88B58FF9D7151B75134AD320 /* FIRAppEnvironmentUtil.h */, + 973E9EF1A434EE33F61AD7D3390C843C /* FIRAppEnvironmentUtil.m */, + 6EF5D0BC81360F85CD1E27D7D5DE4E6B /* FIRAppInternal.h */, + 842CD672C2EAE297C23973D7B5F32307 /* FIRBundleUtil.h */, + A9AB5695C46F1AF8DC19791DC83BB6C5 /* FIRBundleUtil.m */, + 6BED05F813A972D49C1739E43C5EA7BF /* FIRConfiguration.h */, + 7D99ED9BED2A718CFBBC0654CB8F5844 /* FIRConfiguration.m */, + 8FBED9FC43B7A4EFC930CCA52887023B /* FirebaseCore.h */, + DA049D4B28B0D335207CEC065EBECEB8 /* FIRErrorCode.h */, + 25027CBBD521F1DF274E6C1AD1445200 /* FIRErrors.h */, + F6713C7E904A605DF5DD72B573ADB624 /* FIRErrors.m */, + 79D39BB0E7D3E67A42B8807AC45C4C63 /* FIRLogger.h */, + 8B7A0D5A9D4BBF01363C647F7866651A /* FIRLogger.m */, + 3C402C4F02A4DCD3990E69AC400F67A0 /* FIRLoggerLevel.h */, + C30687A940012403EFA730AEFE5CB3DD /* FIRMutableDictionary.h */, + 39124FCC5BD6C20693C6EC17A9EDF327 /* FIRMutableDictionary.m */, + 0520666223B1464C2A1042753A3B324A /* FIRNetwork.h */, + FE6D4BBAA0CF8EE1CE9CB849EA3C1AE7 /* FIRNetwork.m */, + E8E73576DC8F24B3BB0BFD7203F2158A /* FIRNetworkConstants.h */, + 139A27996E36B2299E65F3EFF24C5ABB /* FIRNetworkConstants.m */, + 72377A55B5CEE608F29965BD61AE2679 /* FIRNetworkLoggerProtocol.h */, + D8A8C6F8F2321B7B8AA6145EAC8EA9B9 /* FIRNetworkMessageCode.h */, + 238F719F399EA40A8FF8E9E7A2C375A5 /* FIRNetworkURLSession.h */, + 7E6FD23E19551D986E4B633D3B23728E /* FIRNetworkURLSession.m */, + 39B940DD75C0AD725937BF1DA689726C /* FIROptions.h */, + 8DDD939C31BE581CE59115BBEEE7AE04 /* FIROptions.m */, + A74570DBA78A1CAA6CD68D25B142DCCF /* FIROptionsInternal.h */, + 43F67D4116FF2D75B55B4834843815AD /* FIRReachabilityChecker.h */, + 7C174FFF3A79EF963F593DEAB1555D1E /* FIRReachabilityChecker.m */, + AF90194A983E221C629D557491DEE066 /* FIRReachabilityChecker+Internal.h */, + 1A28A77B48E76CA45E518DD41CFB31C6 /* FIRVersion.h */, + C536A358972E4C1FD3133470F60CF05C /* FIRVersion.m */, + 13D24B754F440CAB72F0A70AC46B5BC2 /* Support Files */, + ); + name = FirebaseCore; + path = FirebaseCore; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 848CAA779F22E44C4E79C91F9A46DA84 /* Headers */ = { + 4547B9AF8085A499AA35614798F8F9E4 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - C60C0BAB1840ED78E320BF832EB7D90F /* CALayer+FSExtension.h in Headers */, - 5C88EB02C6D789D20C6298CF77049112 /* FSCalendar+IBExtension.h in Headers */, - DE0A4E10ED1E104BF1DEF81453A6EBC8 /* FSCalendar-umbrella.h in Headers */, - F7944D091AD240B80D98066395A99B95 /* FSCalendar.h in Headers */, - E773A27D47BC2080FB249FBD4513AB1C /* FSCalendarAnimator.h in Headers */, - D603EE78D5DBF389EC429A33757BFF5C /* FSCalendarAppearance.h in Headers */, - 9522DA78F08119D9EAFA3E30698BDE41 /* FSCalendarCell.h in Headers */, - 11F20D807E923A4DBE6CDFDA9A73C229 /* FSCalendarCollectionView.h in Headers */, - 2FCE1C00460CF74F457E0093A676A834 /* FSCalendarConstance.h in Headers */, - CEBADA794147C66483B0C205EDED2F4B /* FSCalendarDynamicHeader.h in Headers */, - F7317B2BAF77EC9AF9422499C1D467AA /* FSCalendarEventIndicator.h in Headers */, - 6983260381111B42F335961452EEE2B0 /* FSCalendarFlowLayout.h in Headers */, - 0E44012DD097816D61C9AF7B4D509469 /* FSCalendarHeader.h in Headers */, - 7FE3ECFE7843570AAFAD9216E3546026 /* FSCalendarStickyHeader.h in Headers */, - 39582F80068C0DEF708DEE01B8C053F7 /* NSDate+FSExtension.h in Headers */, - B08294E2247DE35943C7180A647EE72D /* NSString+FSExtension.h in Headers */, - C17B63D63425ED26125A32CC2E15B2A6 /* UIView+FSExtension.h in Headers */, + F9D92BA503505CB48EF4ECF0DDF57686 /* nanopb-umbrella.h in Headers */, + 392F2CF142BAA751AC1BB61D8B757D98 /* pb.h in Headers */, + 806BAA4E00218D70995697C4400BE7A0 /* pb_common.h in Headers */, + 29FEADDF2086FDEA7D5BA87DD23B08C6 /* pb_decode.h in Headers */, + E181395E73163EB702FCE9A21403D67B /* pb_encode.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - FB4C9CC59F9DB94DD02038CB8A40C9A0 /* Headers */ = { + 84F466EF33CB8D3214A6AEA89E2BF70A /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 215F145235E6770BB3B93DD87D011579 /* Pods-umbrella.h in Headers */, + B7762CCB1BF67C5F8451AF095A678D42 /* GoogleToolboxForMac-umbrella.h in Headers */, + 3883B72198499726B04F847CA9D1F627 /* GTMDefines.h in Headers */, + 4FB56F6CF1214292B65508F5374418AE /* GTMNSData+zlib.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BF562D1845632971852142CA4CE5F015 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CE8CABEF8DD52D0E6DCBF81798F6BC02 /* Pods-Verdnaturaventas-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CB8DD0EC96D179C9F98FBF280A5BD30F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 7525390045039F998FF0DADC322488CB /* FIRAnalyticsConfiguration+Internal.h in Headers */, + 8F0FFA270E768BC335C0AB4DDC229B9A /* FIRAnalyticsConfiguration.h in Headers */, + ECDED525D94D5EB2C6E2A2430C263091 /* FIRApp.h in Headers */, + 65736E1FDF516AE1EF4927AA623D5486 /* FIRAppAssociationRegistration.h in Headers */, + 4E9E3F4C76FDD56538C1D94D6E004488 /* FIRAppEnvironmentUtil.h in Headers */, + FB11BD2C3420AB15D25927163B7B5883 /* FIRAppInternal.h in Headers */, + 05F97FB862DED24F1B1905C862373C6F /* FIRBundleUtil.h in Headers */, + A1910C42D44099DC241B389D9BCC26C1 /* FIRConfiguration.h in Headers */, + CDB2195B09973FF1A90E093B2DA73FEE /* FirebaseCore-umbrella.h in Headers */, + FE57FA66A59CFE7BF9DEE193BA04EA63 /* FirebaseCore.h in Headers */, + E5A5D0A0FE946574D88719130B234B84 /* FIRErrorCode.h in Headers */, + EBDEB68E8A470B9A82FA5AF8315E1CC4 /* FIRErrors.h in Headers */, + 381AED7B43FE7EAD4E6C7A48FE4CB740 /* FIRLogger.h in Headers */, + 7EF7379A0CC562D025B9F38F0B087CFF /* FIRLoggerLevel.h in Headers */, + D4D85DCC77C00686249407005DBAA53E /* FIRMutableDictionary.h in Headers */, + 9B3BB0BB63055112AE0B41146D80AA04 /* FIRNetwork.h in Headers */, + E1959EA54A2CBA1858855C530C844337 /* FIRNetworkConstants.h in Headers */, + 5B46B9D656F626D2AB2033FE60A5FDF3 /* FIRNetworkLoggerProtocol.h in Headers */, + F14DE07709E12D0D1913F2590548B202 /* FIRNetworkMessageCode.h in Headers */, + DA625BE200A2E8AD3A51CB233D33B598 /* FIRNetworkURLSession.h in Headers */, + FA5FD415B2981BB2D8F0DBEAC41F705B /* FIROptions.h in Headers */, + F6E4719DEDBA73D6404445A113521CA2 /* FIROptionsInternal.h in Headers */, + 3D87E3A862C9B32F401A6F6F561B5046 /* FIRReachabilityChecker+Internal.h in Headers */, + 5176D8C2F911883FC75A97525B5567CB /* FIRReachabilityChecker.h in Headers */, + F4D8DA24C4BF579C3BC481E2C376A988 /* FIRVersion.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FA5EFE33C112D00A2A9DE597CBC519EF /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 625F05F7702CA250DEB66A699766DA9E /* FSCalendar-umbrella.h in Headers */, + 9CF04404C01848D25E78B22A88BFF129 /* FSCalendar.h in Headers */, + FD051B5A9F3E663081656EB261A724D2 /* FSCalendarAppearance.h in Headers */, + F746795DC38AD2DB3D584A110174FED0 /* FSCalendarCalculator.h in Headers */, + F75DFB5A6E8642C4964CC3968A2DD0C8 /* FSCalendarCell.h in Headers */, + E3B93CDF418A2678614DDAD9331C0C0D /* FSCalendarCollectionView.h in Headers */, + 91693C90642539B4F411E794548A9E2A /* FSCalendarCollectionViewLayout.h in Headers */, + 0A7AF0E9B853211DE831CAAD4C21F11C /* FSCalendarConstants.h in Headers */, + 57D4F36C483A487950FA1F143AE5DCBC /* FSCalendarDelegationFactory.h in Headers */, + 49F1C59A34E52484FD2B6462CE8D7C91 /* FSCalendarDelegationProxy.h in Headers */, + 712FF0C70B4C85F44AFB5CDDC1DD9018 /* FSCalendarDynamicHeader.h in Headers */, + C69663957B2EB4C7CF4D8192480AA8B4 /* FSCalendarExtensions.h in Headers */, + F6A1EC699E916996EF2B7B4C6137DB8D /* FSCalendarHeaderView.h in Headers */, + E1B077BAFD8840CA3D96BB4545B7B255 /* FSCalendarScopeHandle.h in Headers */, + D4F3BEEB43698475E5443150838E84ED /* FSCalendarStickyHeader.h in Headers */, + BDA1ED05CBA5580B30785A431D5B231B /* FSCalendarTransitionCoordinator.h in Headers */, + C17D68C964954EF1C0BB3C314C2F452F /* FSCalendarWeekdayView.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - B2619B2813D910DBC9FE9714E0788D55 /* FSCalendar */ = { + 0D79520CBD612E9BF756AE97B40028BB /* Pods-Verdnaturaventas */ = { isa = PBXNativeTarget; - buildConfigurationList = 7E66DDA4D9ACEE4559FE14589C5F582B /* Build configuration list for PBXNativeTarget "FSCalendar" */; + buildConfigurationList = 22184DB192DC43E42217DCE866BDDE3E /* Build configuration list for PBXNativeTarget "Pods-Verdnaturaventas" */; buildPhases = ( - 4C57AC1B079DBD5A5910873EA4FE09F2 /* Sources */, - 24A6EBA9EAE5017F65E804F351F8C1E0 /* Frameworks */, - 848CAA779F22E44C4E79C91F9A46DA84 /* Headers */, + 0C70A12CD080D1FF16ECDDB270622C4A /* Sources */, + EBA94EBD766F0AD901DB2A14CB1E202B /* Frameworks */, + BF562D1845632971852142CA4CE5F015 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 4DD61968648C8061773535B0CBFC3EB1 /* PBXTargetDependency */, + 5FB59A818C8C7229A9DBF5F7B06F4708 /* PBXTargetDependency */, + ED070B2EF06A60C578D5B67F8AD66FFC /* PBXTargetDependency */, + 549811A0A0E04D5C15024DDD1F63C6B0 /* PBXTargetDependency */, + ); + name = "Pods-Verdnaturaventas"; + productName = "Pods-Verdnaturaventas"; + productReference = 1872B7A85540FA06824927D35B989DF5 /* Pods_Verdnaturaventas.framework */; + productType = "com.apple.product-type.framework"; + }; + 1BC96BED8E82CC4984352C8705A764D8 /* FirebaseCore */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E2CFBFB1D71ECBB0CAC96391D572369 /* Build configuration list for PBXNativeTarget "FirebaseCore" */; + buildPhases = ( + CC9B2033D75E04E0EE35C1988055D3AC /* Sources */, + CE41125430BCF410B9E4B1B44E90786F /* Frameworks */, + CB8DD0EC96D179C9F98FBF280A5BD30F /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 95655A12517E11DD065F678183D2E5BE /* PBXTargetDependency */, + ); + name = FirebaseCore; + productName = FirebaseCore; + productReference = AEA471439919068EB5C442FB5187126C /* FirebaseCore.framework */; + productType = "com.apple.product-type.framework"; + }; + C5A2DB7A84B7B78E359870D2E1B24AA7 /* FSCalendar */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9E489D1BD67E6516082312A3038C627E /* Build configuration list for PBXNativeTarget "FSCalendar" */; + buildPhases = ( + 3ECDCA9AFCCC7F02686144C6CFD30A86 /* Sources */, + 2B0C121755DBF940DA569A041E683C9E /* Frameworks */, + FA5EFE33C112D00A2A9DE597CBC519EF /* Headers */, ); buildRules = ( ); @@ -313,25 +807,41 @@ ); name = FSCalendar; productName = FSCalendar; - productReference = 9E3061880F7A3AACACCC69AB2DB69555 /* FSCalendar.framework */; + productReference = 92073E8C0539322D285E9FB1F35F9F2A /* FSCalendar.framework */; productType = "com.apple.product-type.framework"; }; - DF9645A5A279AE409F149EBF9CA9FB28 /* Pods */ = { + E4DD95323C54A78F879DAB0F1508B8E7 /* nanopb */ = { isa = PBXNativeTarget; - buildConfigurationList = 4F0B6230EA55BB6A0230F67E56A65BE6 /* Build configuration list for PBXNativeTarget "Pods" */; + buildConfigurationList = F118B0FA84AC9116AB2E480C302C3999 /* Build configuration list for PBXNativeTarget "nanopb" */; buildPhases = ( - FE36D06581A8E1BB3F0CC84A2024D03B /* Sources */, - AB7412433C3884CC52DB362959E37E08 /* Frameworks */, - FB4C9CC59F9DB94DD02038CB8A40C9A0 /* Headers */, + 238527BE8D494586023F2A2B8A60D242 /* Sources */, + 971041836592E28ADEEDA495A96A62A2 /* Frameworks */, + 4547B9AF8085A499AA35614798F8F9E4 /* Headers */, ); buildRules = ( ); dependencies = ( - 4044EAEAEFFE9E6B3AD494967CAFE787 /* PBXTargetDependency */, ); - name = Pods; - productName = Pods; - productReference = 284826027086B1CAB0D7807EA166B824 /* Pods.framework */; + name = nanopb; + productName = nanopb; + productReference = A2A11FB4539A8C40FEE8AC0E10413796 /* nanopb.framework */; + productType = "com.apple.product-type.framework"; + }; + F3535EDFA606E7F458C510BC81D8F03A /* GoogleToolboxForMac */ = { + isa = PBXNativeTarget; + buildConfigurationList = A6463CEDD5A9E7834B0A6169FCB3B178 /* Build configuration list for PBXNativeTarget "GoogleToolboxForMac" */; + buildPhases = ( + 352540812ADED7BA9290BA358FB48D66 /* Sources */, + 94A4C9099E418E828F86C588AA95CE89 /* Frameworks */, + 84F466EF33CB8D3214A6AEA89E2BF70A /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GoogleToolboxForMac; + productName = GoogleToolboxForMac; + productReference = BD88B5B56DBEE99323A5C9B68AB73590 /* GoogleToolboxForMac.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -340,8 +850,8 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -351,205 +861,439 @@ en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 1691A473B2A86C771E7F849527F3C2D0 /* Products */; + productRefGroup = 2D519F65F31E43441DBA51530DF8D3C7 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - B2619B2813D910DBC9FE9714E0788D55 /* FSCalendar */, - DF9645A5A279AE409F149EBF9CA9FB28 /* Pods */, + 1BC96BED8E82CC4984352C8705A764D8 /* FirebaseCore */, + C5A2DB7A84B7B78E359870D2E1B24AA7 /* FSCalendar */, + F3535EDFA606E7F458C510BC81D8F03A /* GoogleToolboxForMac */, + E4DD95323C54A78F879DAB0F1508B8E7 /* nanopb */, + 0D79520CBD612E9BF756AE97B40028BB /* Pods-Verdnaturaventas */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 4C57AC1B079DBD5A5910873EA4FE09F2 /* Sources */ = { + 0C70A12CD080D1FF16ECDDB270622C4A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7E1B58C9322E8E27C3376E330C124FC7 /* CALayer+FSExtension.m in Sources */, - 4814EE71271BC074621A5ABB07525ACF /* FSCalendar+IBExtension.m in Sources */, - 7A779B7652F894A80FBCAF67E3E960FA /* FSCalendar-dummy.m in Sources */, - 6ECD11C96CBDCA50F0331F3FBDAECE64 /* FSCalendar.m in Sources */, - 785778BB36B2F9B21FAE5E476E1B6E2E /* FSCalendarAnimator.m in Sources */, - 082C46A244A1077339875D1132DF9874 /* FSCalendarAppearance.m in Sources */, - 21209814564B699E013C0579D7617C88 /* FSCalendarCell.m in Sources */, - DB0D7D2A2EDB8D6D5C18B850CB779F7B /* FSCalendarCollectionView.m in Sources */, - D4B2E79A7850584715A743A46D4EFA14 /* FSCalendarConstance.m in Sources */, - 51D1AC1D010EA99E078E75C69C6D2111 /* FSCalendarEventIndicator.m in Sources */, - 6C92086C1DC08BB2A45B0A66F839CA48 /* FSCalendarFlowLayout.m in Sources */, - 3B202C12728218C238D98AEE659FF7D1 /* FSCalendarHeader.m in Sources */, - 3CBF88CA2DE4F67B82C36AE6290DCC90 /* FSCalendarStickyHeader.m in Sources */, - 9EFD5A3145CC48882E4B6F6A71EE1505 /* NSDate+FSExtension.m in Sources */, - 078D4DF75013A50AAFBCC75467214CFB /* NSString+FSExtension.m in Sources */, - 42E18A7773D704188DAE03B594B0B690 /* UIView+FSExtension.m in Sources */, + 81F8C528AB6DF9D7494A12C136572C12 /* Pods-Verdnaturaventas-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - FE36D06581A8E1BB3F0CC84A2024D03B /* Sources */ = { + 238527BE8D494586023F2A2B8A60D242 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DF12D28003AF7562B560123341B2D2DB /* Pods-dummy.m in Sources */, + 468DFD90B6C4DA2F7CFA0C1C89F1B615 /* nanopb-dummy.m in Sources */, + 3A50F5C8ECED9627F2EBD97F61BD376D /* pb_common.c in Sources */, + 54F580BF4588159D6A61F21D15591805 /* pb_decode.c in Sources */, + 55D8D5D912CFD2F3584E4553C2EAD734 /* pb_encode.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 352540812ADED7BA9290BA358FB48D66 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 41D10CE405433B469CBE8C40B42865E1 /* GoogleToolboxForMac-dummy.m in Sources */, + CEE0F11B7D13AF6CDA079F544A127554 /* GTMNSData+zlib.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3ECDCA9AFCCC7F02686144C6CFD30A86 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A3D1147CED9648BEDE2E47B8E8A44924 /* FSCalendar+Deprecated.m in Sources */, + 8632FCFA0471878FC95240290BE97458 /* FSCalendar-dummy.m in Sources */, + 66737F48243D514269C499D65A7B4DBE /* FSCalendar.m in Sources */, + 0DD46AF65FABE6D2BDE4501F807046A6 /* FSCalendarAppearance.m in Sources */, + FFBEAF63A28F6A7DD881E8256F9503B7 /* FSCalendarCalculator.m in Sources */, + 55F4561E55A6CF264BEDB8FB18B5FA8C /* FSCalendarCell.m in Sources */, + 7E320930D1F4218F307C7FB786F0C514 /* FSCalendarCollectionView.m in Sources */, + A000A7A7023F7FB4CEDD1023EB87BF93 /* FSCalendarCollectionViewLayout.m in Sources */, + 243E3FBB25AD6B55CDF6971E0D22DA4F /* FSCalendarConstants.m in Sources */, + F54E2CAED6EAE74D9E1F878E10FA30BD /* FSCalendarDelegationFactory.m in Sources */, + AA978FCF3EF1D8D10DDE3BB4C6312A7B /* FSCalendarDelegationProxy.m in Sources */, + 96E021283F050BCADF9A9B668C77B203 /* FSCalendarExtensions.m in Sources */, + 5C62C27E2855390100E9519DE3095DDB /* FSCalendarHeaderView.m in Sources */, + 8E8E60E0406837DF7038528766C90AEA /* FSCalendarScopeHandle.m in Sources */, + EE078A13105301767BE0ECAC1705A9B5 /* FSCalendarStickyHeader.m in Sources */, + CDB052C277F6148BBAACB2C2C7C6321B /* FSCalendarTransitionCoordinator.m in Sources */, + 8F7003744526BA3547F59200EE4F4D16 /* FSCalendarWeekdayView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CC9B2033D75E04E0EE35C1988055D3AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F48F32411C56B14902BD1CD937E74716 /* FIRAnalyticsConfiguration.m in Sources */, + FDF3FB90B18F1F4C211F38110EE750A3 /* FIRApp.m in Sources */, + 1F19C59101F5F9B66F8730F9EF625A1F /* FIRAppAssociationRegistration.m in Sources */, + 8B595D1E703A57549BB98A1AF0F257DA /* FIRAppEnvironmentUtil.m in Sources */, + 1FD11A578D78250D186EADB1DE6732F7 /* FIRBundleUtil.m in Sources */, + 3BD66D6656842D316A18D8F595045BF0 /* FIRConfiguration.m in Sources */, + 58A4DA15799705E46B6A18BA48838897 /* FirebaseCore-dummy.m in Sources */, + 0ABF3961C14F4E2D012936D83C5C724A /* FIRErrors.m in Sources */, + CAAD8C8007C5868AEC3DEB72D6D1D74A /* FIRLogger.m in Sources */, + E5D01D1436ED6AED3103E3ECA01F6C4E /* FIRMutableDictionary.m in Sources */, + F82C7DF4CBBE4EFF86EEB12C209720EB /* FIRNetwork.m in Sources */, + DFB4D54E24E9B7EBD4A66946569162E6 /* FIRNetworkConstants.m in Sources */, + 2FAFE7A2E5F7C163B3F9A55000557F72 /* FIRNetworkURLSession.m in Sources */, + C04AADE8E4A470C4074FCA8EE90CF4C2 /* FIROptions.m in Sources */, + B65CB6EF3292BEB782D1C68597EB362F /* FIRReachabilityChecker.m in Sources */, + C14BCC00F75331E60F28F82F7D3F9EA9 /* FIRVersion.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 4044EAEAEFFE9E6B3AD494967CAFE787 /* PBXTargetDependency */ = { + 4DD61968648C8061773535B0CBFC3EB1 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = FSCalendar; - target = B2619B2813D910DBC9FE9714E0788D55 /* FSCalendar */; - targetProxy = 650DFB32E50AFECE1EBB68208751A584 /* PBXContainerItemProxy */; + target = C5A2DB7A84B7B78E359870D2E1B24AA7 /* FSCalendar */; + targetProxy = 5552687950E695ABAB4010B336A315FE /* PBXContainerItemProxy */; + }; + 549811A0A0E04D5C15024DDD1F63C6B0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = nanopb; + target = E4DD95323C54A78F879DAB0F1508B8E7 /* nanopb */; + targetProxy = 69A95F1E64EF0A7B6FD9B88896B4B4D6 /* PBXContainerItemProxy */; + }; + 5FB59A818C8C7229A9DBF5F7B06F4708 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = FirebaseCore; + target = 1BC96BED8E82CC4984352C8705A764D8 /* FirebaseCore */; + targetProxy = F54CD0573B0DEBD4AE1E1319BC593FA2 /* PBXContainerItemProxy */; + }; + 95655A12517E11DD065F678183D2E5BE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleToolboxForMac; + target = F3535EDFA606E7F458C510BC81D8F03A /* GoogleToolboxForMac */; + targetProxy = 54D5E18D452A5EDA7693AB371ADF56BD /* PBXContainerItemProxy */; + }; + ED070B2EF06A60C578D5B67F8AD66FFC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleToolboxForMac; + target = F3535EDFA606E7F458C510BC81D8F03A /* GoogleToolboxForMac */; + targetProxy = B846B2E50217608C53A06EB228367E04 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 2CF1A55FBC171828E9D217DE4D88EB80 /* Release */ = { + 12984DAB6F2EEDB78D3E952DDDC16ECE /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DA312349A49333542E6F4B36B329960E /* Pods.release.xcconfig */; + baseConfigurationReference = FF5095C3633F99391A3315D956CCFAAC /* GoogleToolboxForMac.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/GoogleToolboxForMac/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_NAME = Pods; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 9A358E1EBC1FE863E275D45887146F83 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F964C9BC17A31A59BCDAD81259391E99 /* FSCalendar.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/FSCalendar/FSCalendar-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/FSCalendar/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/FSCalendar/FSCalendar.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = FSCalendar; + MODULEMAP_FILE = "Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.modulemap"; + PRODUCT_MODULE_NAME = GoogleToolboxForMac; + PRODUCT_NAME = GoogleToolboxForMac; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 9EDB52415BA19124A1FF9CC2D068E0CB /* Release */ = { + 1B50201C0ACE8C7A7E1588B62A0D9C6E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F964C9BC17A31A59BCDAD81259391E99 /* FSCalendar.xcconfig */; + baseConfigurationReference = 48FD4B8046F183AEDC7554A0A9E91CA6 /* nanopb.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/FSCalendar/FSCalendar-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/FSCalendar/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/nanopb/nanopb-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/nanopb/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/FSCalendar/FSCalendar.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = FSCalendar; + MODULEMAP_FILE = "Target Support Files/nanopb/nanopb.modulemap"; + PRODUCT_MODULE_NAME = nanopb; + PRODUCT_NAME = nanopb; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */ = { + 1EE19F5DD95931924296F637BF18BD8F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", "DEBUG=1", "$(inherited)", ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SYMROOT = "${SRCROOT}/../build"; }; name = Debug; }; - B3F62574337F328339EF101FE8A1164F /* Debug */ = { + 5CE503606C29B8D8A8116C09287BBA6E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */; + baseConfigurationReference = 2309D72E5471D7E9EAE8922795A810D1 /* FSCalendar.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/FSCalendar/FSCalendar-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSCalendar/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/FSCalendar/FSCalendar.modulemap"; + PRODUCT_MODULE_NAME = FSCalendar; + PRODUCT_NAME = FSCalendar; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 6FFC46EB567A6BD373FDC59EFADA62DE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FF5095C3633F99391A3315D956CCFAAC /* GoogleToolboxForMac.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/GoogleToolboxForMac/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.modulemap"; + PRODUCT_MODULE_NAME = GoogleToolboxForMac; + PRODUCT_NAME = GoogleToolboxForMac; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 88DDA0D3FA94A15567434F510466A300 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9A0157C9E58BC2F6A8687495D3161860 /* FirebaseCore.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - INFOPLIST_FILE = "Target Support Files/Pods/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods/Pods.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MODULEMAP_FILE = "Target Support Files/FirebaseCore/FirebaseCore.modulemap"; + PRODUCT_MODULE_NAME = FirebaseCore; + PRODUCT_NAME = FirebaseCore; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 8C3A3445F187A4C3BA81B4FDCFB0B580 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2309D72E5471D7E9EAE8922795A810D1 /* FSCalendar.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/FSCalendar/FSCalendar-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/FSCalendar/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/FSCalendar/FSCalendar.modulemap"; + PRODUCT_MODULE_NAME = FSCalendar; + PRODUCT_NAME = FSCalendar; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A1A7D9C088625B4192681CB1E35AC461 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 48FD4B8046F183AEDC7554A0A9E91CA6 /* nanopb.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/nanopb/nanopb-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/nanopb/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/nanopb/nanopb.modulemap"; + PRODUCT_MODULE_NAME = nanopb; + PRODUCT_NAME = nanopb; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + B31B371DCDFA01DDA9423BEEE6636852 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B66AC7703E37D283DDAC86A54C37D61D /* Pods-Verdnaturaventas.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-Verdnaturaventas/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.modulemap"; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; - PRODUCT_NAME = Pods; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; @@ -558,66 +1302,181 @@ }; name = Debug; }; - FB45FFD90572718D82AB9092B750F0CA /* Release */ = { + D62C6A4C14D5917F70DBCEDD0EAB5B23 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9A0157C9E58BC2F6A8687495D3161860 /* FirebaseCore.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/FirebaseCore/FirebaseCore.modulemap"; + PRODUCT_MODULE_NAME = FirebaseCore; + PRODUCT_NAME = FirebaseCore; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + DEDDED9D8C90D256C15F1CA19471256A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0EA766089CA20B31F9AAF9FFD698A906 /* Pods-Verdnaturaventas.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-Verdnaturaventas/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + F4568DEE257655D290C2B9CEAB37C934 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 22184DB192DC43E42217DCE866BDDE3E /* Build configuration list for PBXNativeTarget "Pods-Verdnaturaventas" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B31B371DCDFA01DDA9423BEEE6636852 /* Debug */, + DEDDED9D8C90D256C15F1CA19471256A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */, - FB45FFD90572718D82AB9092B750F0CA /* Release */, + 1EE19F5DD95931924296F637BF18BD8F /* Debug */, + F4568DEE257655D290C2B9CEAB37C934 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4F0B6230EA55BB6A0230F67E56A65BE6 /* Build configuration list for PBXNativeTarget "Pods" */ = { + 7E2CFBFB1D71ECBB0CAC96391D572369 /* Build configuration list for PBXNativeTarget "FirebaseCore" */ = { isa = XCConfigurationList; buildConfigurations = ( - B3F62574337F328339EF101FE8A1164F /* Debug */, - 2CF1A55FBC171828E9D217DE4D88EB80 /* Release */, + D62C6A4C14D5917F70DBCEDD0EAB5B23 /* Debug */, + 88DDA0D3FA94A15567434F510466A300 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 7E66DDA4D9ACEE4559FE14589C5F582B /* Build configuration list for PBXNativeTarget "FSCalendar" */ = { + 9E489D1BD67E6516082312A3038C627E /* Build configuration list for PBXNativeTarget "FSCalendar" */ = { isa = XCConfigurationList; buildConfigurations = ( - 9A358E1EBC1FE863E275D45887146F83 /* Debug */, - 9EDB52415BA19124A1FF9CC2D068E0CB /* Release */, + 8C3A3445F187A4C3BA81B4FDCFB0B580 /* Debug */, + 5CE503606C29B8D8A8116C09287BBA6E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A6463CEDD5A9E7834B0A6169FCB3B178 /* Build configuration list for PBXNativeTarget "GoogleToolboxForMac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 12984DAB6F2EEDB78D3E952DDDC16ECE /* Debug */, + 6FFC46EB567A6BD373FDC59EFADA62DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F118B0FA84AC9116AB2E480C302C3999 /* Build configuration list for PBXNativeTarget "nanopb" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1B50201C0ACE8C7A7E1588B62A0D9C6E /* Debug */, + A1A7D9C088625B4192681CB1E35AC461 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/FSCalendar.xcscheme b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/FSCalendar.xcscheme similarity index 68% rename from Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/FSCalendar.xcscheme rename to Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/FSCalendar.xcscheme index 4baab35..1822c2c 100644 --- a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/FSCalendar.xcscheme +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/FSCalendar.xcscheme @@ -1,39 +1,36 @@ + buildForArchiving = "YES"> + ReferencedContainer = "container:Pods.xcodeproj" + BuildableName = "FSCalendar.framework"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> - - - - + debugDocumentVersioning = "YES" + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/FirebaseCore.xcscheme b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/FirebaseCore.xcscheme new file mode 100644 index 0000000..80339a3 --- /dev/null +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/FirebaseCore.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/GoogleToolboxForMac.xcscheme b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/GoogleToolboxForMac.xcscheme new file mode 100644 index 0000000..74731e0 --- /dev/null +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/GoogleToolboxForMac.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/Pods.xcscheme b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/Pods-Verdnaturaventas.xcscheme similarity index 84% rename from Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/Pods.xcscheme rename to Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/Pods-Verdnaturaventas.xcscheme index 0e12a94..4cedcc7 100644 --- a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/Pods.xcscheme +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/Pods-Verdnaturaventas.xcscheme @@ -1,6 +1,6 @@ @@ -45,9 +45,9 @@ diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/nanopb.xcscheme b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/nanopb.xcscheme new file mode 100644 index 0000000..094cfea --- /dev/null +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/nanopb.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist index fe04a11..fe2dfa3 100644 --- a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist @@ -6,14 +6,41 @@ FSCalendar.xcscheme + isShown + + orderHint + 1 + + FirebaseCore.xcscheme + + isShown + + orderHint + 0 + + GoogleToolboxForMac.xcscheme + + isShown + orderHint 2 - Pods.xcscheme + Pods-Verdnaturaventas.xcscheme + isShown + + orderHint + 4 + + nanopb.xcscheme + + isShown + orderHint 3 + SuppressBuildableAutocreation + diff --git a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/xcschememanagement.plist b/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 0797045..0000000 --- a/Verdnaturaventas/Pods/Pods.xcodeproj/xcuserdata/nelo.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - SchemeUserState - - FSCalendar.xcscheme - - isShown - - - Pods.xcscheme - - isShown - - - - SuppressBuildableAutocreation - - B2619B2813D910DBC9FE9714E0788D55 - - primary - - - DF9645A5A279AE409F149EBF9CA9FB28 - - primary - - - - - diff --git a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-prefix.pch b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-prefix.pch index aa992a4..beb2a24 100644 --- a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-prefix.pch +++ b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-umbrella.h b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-umbrella.h index 09611e7..e6dee6e 100644 --- a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-umbrella.h +++ b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar-umbrella.h @@ -1,21 +1,31 @@ +#ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif -#import "CALayer+FSExtension.h" -#import "FSCalendar+IBExtension.h" #import "FSCalendar.h" -#import "FSCalendarAnimator.h" #import "FSCalendarAppearance.h" +#import "FSCalendarCalculator.h" #import "FSCalendarCell.h" #import "FSCalendarCollectionView.h" -#import "FSCalendarConstance.h" +#import "FSCalendarCollectionViewLayout.h" +#import "FSCalendarConstants.h" +#import "FSCalendarDelegationFactory.h" +#import "FSCalendarDelegationProxy.h" #import "FSCalendarDynamicHeader.h" -#import "FSCalendarEventIndicator.h" -#import "FSCalendarFlowLayout.h" -#import "FSCalendarHeader.h" +#import "FSCalendarExtensions.h" +#import "FSCalendarHeaderView.h" +#import "FSCalendarScopeHandle.h" #import "FSCalendarStickyHeader.h" -#import "NSDate+FSExtension.h" -#import "NSString+FSExtension.h" -#import "UIView+FSExtension.h" +#import "FSCalendarTransitionCoordinator.h" +#import "FSCalendarWeekdayView.h" FOUNDATION_EXPORT double FSCalendarVersionNumber; FOUNDATION_EXPORT const unsigned char FSCalendarVersionString[]; diff --git a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar.xcconfig b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar.xcconfig index 6b079bd..de55efc 100644 --- a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar.xcconfig +++ b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/FSCalendar.xcconfig @@ -1,5 +1,9 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FSCalendar GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FSCalendar" "${PODS_ROOT}/Headers/Public" OTHER_LDFLAGS = -framework "QuartzCore" -framework "UIKit" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} -SKIP_INSTALL = YES \ No newline at end of file +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FSCalendar +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/Info.plist b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/Info.plist index c2fdb7a..52c84ba 100644 --- a/Verdnaturaventas/Pods/Target Support Files/FSCalendar/Info.plist +++ b/Verdnaturaventas/Pods/Target Support Files/FSCalendar/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.1 + 2.7.9 CFBundleSignature ???? CFBundleVersion diff --git a/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore-dummy.m b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore-dummy.m new file mode 100644 index 0000000..4f1eb27 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_FirebaseCore : NSObject +@end +@implementation PodsDummy_FirebaseCore +@end diff --git a/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore-umbrella.h b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore-umbrella.h new file mode 100644 index 0000000..791a7c0 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore-umbrella.h @@ -0,0 +1,22 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "FIRAnalyticsConfiguration.h" +#import "FIRApp.h" +#import "FIRConfiguration.h" +#import "FirebaseCore.h" +#import "FIRLoggerLevel.h" +#import "FIROptions.h" + +FOUNDATION_EXPORT double FirebaseCoreVersionNumber; +FOUNDATION_EXPORT const unsigned char FirebaseCoreVersionString[]; + diff --git a/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore.modulemap b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore.modulemap new file mode 100644 index 0000000..4c38b87 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore.modulemap @@ -0,0 +1,6 @@ +framework module FirebaseCore { + umbrella header "FirebaseCore-umbrella.h" + + export * + module * { export * } +} diff --git a/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore.xcconfig b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore.xcconfig new file mode 100644 index 0000000..f5644a2 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/FirebaseCore/FirebaseCore.xcconfig @@ -0,0 +1,11 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 FIRCore_VERSION=5.0.4 Firebase_VERSION=5.3.0 +OTHER_CFLAGS = $(inherited) -fno-autolink +OTHER_LDFLAGS = -framework "Foundation" -framework "SystemConfiguration" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/FirebaseCore +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-dummy.m b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-dummy.m new file mode 100644 index 0000000..9e35ec0 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_GoogleToolboxForMac : NSObject +@end +@implementation PodsDummy_GoogleToolboxForMac +@end diff --git a/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-umbrella.h b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-umbrella.h new file mode 100644 index 0000000..ee94a85 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-umbrella.h @@ -0,0 +1,18 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "GTMDefines.h" +#import "GTMNSData+zlib.h" + +FOUNDATION_EXPORT double GoogleToolboxForMacVersionNumber; +FOUNDATION_EXPORT const unsigned char GoogleToolboxForMacVersionString[]; + diff --git a/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.modulemap b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.modulemap new file mode 100644 index 0000000..3245b6d --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.modulemap @@ -0,0 +1,6 @@ +framework module GoogleToolboxForMac { + umbrella header "GoogleToolboxForMac-umbrella.h" + + export * + module * { export * } +} diff --git a/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.xcconfig b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.xcconfig new file mode 100644 index 0000000..5603bef --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_LDFLAGS = -l"z" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleToolboxForMac +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/Info.plist b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/Info.plist new file mode 100644 index 0000000..57b76a5 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/GoogleToolboxForMac/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.1.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Info.plist b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Info.plist similarity index 92% rename from Verdnaturaventas/Pods/Target Support Files/Pods/Info.plist rename to Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Info.plist index 6974542..2243fe6 100644 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Info.plist +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + ${PRODUCT_BUNDLE_IDENTIFIER} CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-acknowledgements.markdown b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-acknowledgements.markdown new file mode 100644 index 0000000..b250990 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-acknowledgements.markdown @@ -0,0 +1,474 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## FSCalendar + +Copyright (c) 2013-2016 FSCalendar (https://github.com/WenchaoD/FSCalendar) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## Firebase + +Copyright 2018 Google + +## FirebaseAnalytics + +Copyright 2018 Google + +## FirebaseCore + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +## FirebaseInstanceID + +Copyright 2018 Google + +## GoogleToolboxForMac + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +## nanopb + +Copyright (c) 2011 Petteri Aimonen + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + +Generated by CocoaPods - https://cocoapods.org diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-acknowledgements.plist b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-acknowledgements.plist new file mode 100644 index 0000000..0f31d72 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-acknowledgements.plist @@ -0,0 +1,542 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2013-2016 FSCalendar (https://github.com/WenchaoD/FSCalendar) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + FSCalendar + Type + PSGroupSpecifier + + + FooterText + Copyright 2018 Google + License + Copyright + Title + Firebase + Type + PSGroupSpecifier + + + FooterText + Copyright 2018 Google + License + Copyright + Title + FirebaseAnalytics + Type + PSGroupSpecifier + + + FooterText + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + License + Apache + Title + FirebaseCore + Type + PSGroupSpecifier + + + FooterText + Copyright 2018 Google + License + Copyright + Title + FirebaseInstanceID + Type + PSGroupSpecifier + + + FooterText + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + License + Apache + Title + GoogleToolboxForMac + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi> + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + + License + zlib + Title + nanopb + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-dummy.m b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-dummy.m new file mode 100644 index 0000000..c627627 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_Verdnaturaventas : NSObject +@end +@implementation PodsDummy_Pods_Verdnaturaventas +@end diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-frameworks.sh b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-frameworks.sh new file mode 100755 index 0000000..5558c9b --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-frameworks.sh @@ -0,0 +1,157 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" + else + # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/FSCalendar/FSCalendar.framework" + install_framework "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework" + install_framework "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/FSCalendar/FSCalendar.framework" + install_framework "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework" + install_framework "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-resources.sh b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-resources.sh new file mode 100755 index 0000000..345301f --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-umbrella.h b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-umbrella.h new file mode 100644 index 0000000..8f7e47a --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_VerdnaturaventasVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_VerdnaturaventasVersionString[]; + diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.debug.xcconfig b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.debug.xcconfig new file mode 100644 index 0000000..0010328 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.debug.xcconfig @@ -0,0 +1,10 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FSCalendar" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 +HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FSCalendar/FSCalendar.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" +OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"sqlite3" -l"z" -framework "FSCalendar" -framework "FirebaseAnalytics" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "FirebaseNanoPB" -framework "Foundation" -framework "GoogleToolboxForMac" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.modulemap b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.modulemap new file mode 100644 index 0000000..c4ee923 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.modulemap @@ -0,0 +1,6 @@ +framework module Pods_Verdnaturaventas { + umbrella header "Pods-Verdnaturaventas-umbrella.h" + + export * + module * { export * } +} diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.release.xcconfig b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.release.xcconfig new file mode 100644 index 0000000..0010328 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.release.xcconfig @@ -0,0 +1,10 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FSCalendar" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 +HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FSCalendar/FSCalendar.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Firebase" +OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"sqlite3" -l"z" -framework "FSCalendar" -framework "FirebaseAnalytics" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "FirebaseNanoPB" -framework "Foundation" -framework "GoogleToolboxForMac" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration" -framework "nanopb" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown deleted file mode 100644 index 345846d..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown +++ /dev/null @@ -1,26 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## FSCalendar - -Copyright (c) 2013-2016 FSCalendar (https://github.com/WenchaoIOS/FSCalendar) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Generated by CocoaPods - http://cocoapods.org diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-acknowledgements.plist deleted file mode 100644 index ce7d0bc..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-acknowledgements.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2013-2016 FSCalendar (https://github.com/WenchaoIOS/FSCalendar) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - Title - FSCalendar - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - http://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-dummy.m b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-dummy.m deleted file mode 100644 index ade64bd..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods : NSObject -@end -@implementation PodsDummy_Pods -@end diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-frameworks.sh b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-frameworks.sh deleted file mode 100755 index bc520f0..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-frameworks.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -set -e - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "Pods/FSCalendar.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "Pods/FSCalendar.framework" -fi diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-resources.sh b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-resources.sh deleted file mode 100755 index 16774fb..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-resources.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -realpath() { - DIRECTORY="$(cd "${1%/*}" && pwd)" - FILENAME="${1##*/}" - echo "$DIRECTORY/$FILENAME" -} - -install_resource() -{ - case $1 in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.framework) - echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" - xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - /*) - echo "$1" - echo "$1" >> "$RESOURCES_TO_COPY" - ;; - *) - echo "${PODS_ROOT}/$1" - echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; - esac - - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "`realpath $PODS_ROOT`*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-umbrella.h b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-umbrella.h deleted file mode 100644 index 21dcfd2..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods-umbrella.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - - -FOUNDATION_EXPORT double PodsVersionNumber; -FOUNDATION_EXPORT const unsigned char PodsVersionString[]; - diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.debug.xcconfig deleted file mode 100644 index 53a61a3..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.debug.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/FSCalendar.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "FSCalendar" -PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.modulemap b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.modulemap deleted file mode 100644 index 8413413..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods { - umbrella header "Pods-umbrella.h" - - export * - module * { export * } -} diff --git a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.release.xcconfig b/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.release.xcconfig deleted file mode 100644 index 53a61a3..0000000 --- a/Verdnaturaventas/Pods/Target Support Files/Pods/Pods.release.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/FSCalendar.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "FSCalendar" -PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Verdnaturaventas/Pods/Target Support Files/nanopb/Info.plist b/Verdnaturaventas/Pods/Target Support Files/nanopb/Info.plist new file mode 100644 index 0000000..2cb2374 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/nanopb/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.3.8 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-dummy.m b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-dummy.m new file mode 100644 index 0000000..b3fa595 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_nanopb : NSObject +@end +@implementation PodsDummy_nanopb +@end diff --git a/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-prefix.pch b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-umbrella.h b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-umbrella.h new file mode 100644 index 0000000..07e77b3 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb-umbrella.h @@ -0,0 +1,26 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "pb.h" +#import "pb_common.h" +#import "pb_decode.h" +#import "pb_encode.h" +#import "pb.h" +#import "pb_decode.h" +#import "pb_common.h" +#import "pb.h" +#import "pb_encode.h" +#import "pb_common.h" + +FOUNDATION_EXPORT double nanopbVersionNumber; +FOUNDATION_EXPORT const unsigned char nanopbVersionString[]; + diff --git a/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb.modulemap b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb.modulemap new file mode 100644 index 0000000..e8d4b53 --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb.modulemap @@ -0,0 +1,6 @@ +framework module nanopb { + umbrella header "nanopb-umbrella.h" + + export * + module * { export * } +} diff --git a/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb.xcconfig b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb.xcconfig new file mode 100644 index 0000000..48a6a8f --- /dev/null +++ b/Verdnaturaventas/Pods/Target Support Files/nanopb/nanopb.xcconfig @@ -0,0 +1,8 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/nanopb +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/nanopb +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Verdnaturaventas/Pods/nanopb/LICENSE.txt b/Verdnaturaventas/Pods/nanopb/LICENSE.txt new file mode 100644 index 0000000..d11c9af --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2011 Petteri Aimonen + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. diff --git a/Verdnaturaventas/Pods/nanopb/README.md b/Verdnaturaventas/Pods/nanopb/README.md new file mode 100644 index 0000000..07860f0 --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/README.md @@ -0,0 +1,71 @@ +Nanopb - Protocol Buffers for Embedded Systems +============================================== + +[![Build Status](https://travis-ci.org/nanopb/nanopb.svg?branch=master)](https://travis-ci.org/nanopb/nanopb) + +Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is +especially suitable for use in microcontrollers, but fits any memory +restricted system. + +* **Homepage:** https://jpa.kapsi.fi/nanopb/ +* **Documentation:** https://jpa.kapsi.fi/nanopb/docs/ +* **Downloads:** https://jpa.kapsi.fi/nanopb/download/ +* **Forum:** https://groups.google.com/forum/#!forum/nanopb + + + +Using the nanopb library +------------------------ +To use the nanopb library, you need to do two things: + +1. Compile your .proto files for nanopb, using protoc. +2. Include pb_encode.c, pb_decode.c and pb_common.c in your project. + +The easiest way to get started is to study the project in "examples/simple". +It contains a Makefile, which should work directly under most Linux systems. +However, for any other kind of build system, see the manual steps in +README.txt in that folder. + + + +Using the Protocol Buffers compiler (protoc) +-------------------------------------------- +The nanopb generator is implemented as a plugin for the Google's own protoc +compiler. This has the advantage that there is no need to reimplement the +basic parsing of .proto files. However, it does mean that you need the +Google's protobuf library in order to run the generator. + +If you have downloaded a binary package for nanopb (either Windows, Linux or +Mac OS X version), the 'protoc' binary is included in the 'generator-bin' +folder. In this case, you are ready to go. Simply run this command: + + generator-bin/protoc --nanopb_out=. myprotocol.proto + +However, if you are using a git checkout or a plain source distribution, you +need to provide your own version of protoc and the Google's protobuf library. +On Linux, the necessary packages are protobuf-compiler and python-protobuf. +On Windows, you can either build Google's protobuf library from source or use +one of the binary distributions of it. In either case, if you use a separate +protoc, you need to manually give the path to nanopb generator: + + protoc --plugin=protoc-gen-nanopb=nanopb/generator/protoc-gen-nanopb ... + + + +Running the tests +----------------- +If you want to perform further development of the nanopb core, or to verify +its functionality using your compiler and platform, you'll want to run the +test suite. The build rules for the test suite are implemented using Scons, +so you need to have that installed. To run the tests: + + cd tests + scons + +This will show the progress of various test cases. If the output does not +end in an error, the test cases were successful. + +Note: Mac OS X by default aliases 'clang' as 'gcc', while not actually +supporting the same command line options as gcc does. To run tests on +Mac OS X, use: "scons CC=clang CXX=clang". Same way can be used to run +tests with different compilers on any platform. diff --git a/Verdnaturaventas/Pods/nanopb/pb.h b/Verdnaturaventas/Pods/nanopb/pb.h new file mode 100644 index 0000000..bf05a63 --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb.h @@ -0,0 +1,583 @@ +/* Common parts of the nanopb library. Most of these are quite low-level + * stuff. For the high-level interface, see pb_encode.h and pb_decode.h. + */ + +#ifndef PB_H_INCLUDED +#define PB_H_INCLUDED + +/***************************************************************** + * Nanopb compilation time options. You can change these here by * + * uncommenting the lines, or on the compiler command line. * + *****************************************************************/ + +/* Enable support for dynamically allocated fields */ +/* #define PB_ENABLE_MALLOC 1 */ + +/* Define this if your CPU / compiler combination does not support + * unaligned memory access to packed structures. */ +/* #define PB_NO_PACKED_STRUCTS 1 */ + +/* Increase the number of required fields that are tracked. + * A compiler warning will tell if you need this. */ +/* #define PB_MAX_REQUIRED_FIELDS 256 */ + +/* Add support for tag numbers > 255 and fields larger than 255 bytes. */ +/* #define PB_FIELD_16BIT 1 */ + +/* Add support for tag numbers > 65536 and fields larger than 65536 bytes. */ +/* #define PB_FIELD_32BIT 1 */ + +/* Disable support for error messages in order to save some code space. */ +/* #define PB_NO_ERRMSG 1 */ + +/* Disable support for custom streams (support only memory buffers). */ +/* #define PB_BUFFER_ONLY 1 */ + +/* Switch back to the old-style callback function signature. + * This was the default until nanopb-0.2.1. */ +/* #define PB_OLD_CALLBACK_STYLE */ + + +/****************************************************************** + * You usually don't need to change anything below this line. * + * Feel free to look around and use the defined macros, though. * + ******************************************************************/ + + +/* Version of the nanopb library. Just in case you want to check it in + * your own program. */ +#define NANOPB_VERSION nanopb-0.3.8 + +/* Include all the system headers needed by nanopb. You will need the + * definitions of the following: + * - strlen, memcpy, memset functions + * - [u]int_least8_t, uint_fast8_t, [u]int_least16_t, [u]int32_t, [u]int64_t + * - size_t + * - bool + * + * If you don't have the standard header files, you can instead provide + * a custom header that defines or includes all this. In that case, + * define PB_SYSTEM_HEADER to the path of this file. + */ +#ifdef PB_SYSTEM_HEADER +#include PB_SYSTEM_HEADER +#else +#include +#include +#include +#include + +#ifdef PB_ENABLE_MALLOC +#include +#endif +#endif + +/* Macro for defining packed structures (compiler dependent). + * This just reduces memory requirements, but is not required. + */ +#if defined(PB_NO_PACKED_STRUCTS) + /* Disable struct packing */ +# define PB_PACKED_STRUCT_START +# define PB_PACKED_STRUCT_END +# define pb_packed +#elif defined(__GNUC__) || defined(__clang__) + /* For GCC and clang */ +# define PB_PACKED_STRUCT_START +# define PB_PACKED_STRUCT_END +# define pb_packed __attribute__((packed)) +#elif defined(__ICCARM__) || defined(__CC_ARM) + /* For IAR ARM and Keil MDK-ARM compilers */ +# define PB_PACKED_STRUCT_START _Pragma("pack(push, 1)") +# define PB_PACKED_STRUCT_END _Pragma("pack(pop)") +# define pb_packed +#elif defined(_MSC_VER) && (_MSC_VER >= 1500) + /* For Microsoft Visual C++ */ +# define PB_PACKED_STRUCT_START __pragma(pack(push, 1)) +# define PB_PACKED_STRUCT_END __pragma(pack(pop)) +# define pb_packed +#else + /* Unknown compiler */ +# define PB_PACKED_STRUCT_START +# define PB_PACKED_STRUCT_END +# define pb_packed +#endif + +/* Handly macro for suppressing unreferenced-parameter compiler warnings. */ +#ifndef PB_UNUSED +#define PB_UNUSED(x) (void)(x) +#endif + +/* Compile-time assertion, used for checking compatible compilation options. + * If this does not work properly on your compiler, use + * #define PB_NO_STATIC_ASSERT to disable it. + * + * But before doing that, check carefully the error message / place where it + * comes from to see if the error has a real cause. Unfortunately the error + * message is not always very clear to read, but you can see the reason better + * in the place where the PB_STATIC_ASSERT macro was called. + */ +#ifndef PB_NO_STATIC_ASSERT +#ifndef PB_STATIC_ASSERT +#define PB_STATIC_ASSERT(COND,MSG) typedef char PB_STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1]; +#define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) +#define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##LINE##COUNTER +#endif +#else +#define PB_STATIC_ASSERT(COND,MSG) +#endif + +/* Number of required fields to keep track of. */ +#ifndef PB_MAX_REQUIRED_FIELDS +#define PB_MAX_REQUIRED_FIELDS 64 +#endif + +#if PB_MAX_REQUIRED_FIELDS < 64 +#error You should not lower PB_MAX_REQUIRED_FIELDS from the default value (64). +#endif + +/* List of possible field types. These are used in the autogenerated code. + * Least-significant 4 bits tell the scalar type + * Most-significant 4 bits specify repeated/required/packed etc. + */ + +typedef uint_least8_t pb_type_t; + +/**** Field data types ****/ + +/* Numeric types */ +#define PB_LTYPE_VARINT 0x00 /* int32, int64, enum, bool */ +#define PB_LTYPE_UVARINT 0x01 /* uint32, uint64 */ +#define PB_LTYPE_SVARINT 0x02 /* sint32, sint64 */ +#define PB_LTYPE_FIXED32 0x03 /* fixed32, sfixed32, float */ +#define PB_LTYPE_FIXED64 0x04 /* fixed64, sfixed64, double */ + +/* Marker for last packable field type. */ +#define PB_LTYPE_LAST_PACKABLE 0x04 + +/* Byte array with pre-allocated buffer. + * data_size is the length of the allocated PB_BYTES_ARRAY structure. */ +#define PB_LTYPE_BYTES 0x05 + +/* String with pre-allocated buffer. + * data_size is the maximum length. */ +#define PB_LTYPE_STRING 0x06 + +/* Submessage + * submsg_fields is pointer to field descriptions */ +#define PB_LTYPE_SUBMESSAGE 0x07 + +/* Extension pseudo-field + * The field contains a pointer to pb_extension_t */ +#define PB_LTYPE_EXTENSION 0x08 + +/* Byte array with inline, pre-allocated byffer. + * data_size is the length of the inline, allocated buffer. + * This differs from PB_LTYPE_BYTES by defining the element as + * pb_byte_t[data_size] rather than pb_bytes_array_t. */ +#define PB_LTYPE_FIXED_LENGTH_BYTES 0x09 + +/* Number of declared LTYPES */ +#define PB_LTYPES_COUNT 0x0A +#define PB_LTYPE_MASK 0x0F + +/**** Field repetition rules ****/ + +#define PB_HTYPE_REQUIRED 0x00 +#define PB_HTYPE_OPTIONAL 0x10 +#define PB_HTYPE_REPEATED 0x20 +#define PB_HTYPE_ONEOF 0x30 +#define PB_HTYPE_MASK 0x30 + +/**** Field allocation types ****/ + +#define PB_ATYPE_STATIC 0x00 +#define PB_ATYPE_POINTER 0x80 +#define PB_ATYPE_CALLBACK 0x40 +#define PB_ATYPE_MASK 0xC0 + +#define PB_ATYPE(x) ((x) & PB_ATYPE_MASK) +#define PB_HTYPE(x) ((x) & PB_HTYPE_MASK) +#define PB_LTYPE(x) ((x) & PB_LTYPE_MASK) + +/* Data type used for storing sizes of struct fields + * and array counts. + */ +#if defined(PB_FIELD_32BIT) + typedef uint32_t pb_size_t; + typedef int32_t pb_ssize_t; +#elif defined(PB_FIELD_16BIT) + typedef uint_least16_t pb_size_t; + typedef int_least16_t pb_ssize_t; +#else + typedef uint_least8_t pb_size_t; + typedef int_least8_t pb_ssize_t; +#endif +#define PB_SIZE_MAX ((pb_size_t)-1) + +/* Data type for storing encoded data and other byte streams. + * This typedef exists to support platforms where uint8_t does not exist. + * You can regard it as equivalent on uint8_t on other platforms. + */ +typedef uint_least8_t pb_byte_t; + +/* This structure is used in auto-generated constants + * to specify struct fields. + * You can change field sizes if you need structures + * larger than 256 bytes or field tags larger than 256. + * The compiler should complain if your .proto has such + * structures. Fix that by defining PB_FIELD_16BIT or + * PB_FIELD_32BIT. + */ +PB_PACKED_STRUCT_START +typedef struct pb_field_s pb_field_t; +struct pb_field_s { + pb_size_t tag; + pb_type_t type; + pb_size_t data_offset; /* Offset of field data, relative to previous field. */ + pb_ssize_t size_offset; /* Offset of array size or has-boolean, relative to data */ + pb_size_t data_size; /* Data size in bytes for a single item */ + pb_size_t array_size; /* Maximum number of entries in array */ + + /* Field definitions for submessage + * OR default value for all other non-array, non-callback types + * If null, then field will zeroed. */ + const void *ptr; +} pb_packed; +PB_PACKED_STRUCT_END + +/* Make sure that the standard integer types are of the expected sizes. + * Otherwise fixed32/fixed64 fields can break. + * + * If you get errors here, it probably means that your stdint.h is not + * correct for your platform. + */ +PB_STATIC_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t), INT64_T_WRONG_SIZE) +PB_STATIC_ASSERT(sizeof(uint64_t) == 2 * sizeof(uint32_t), UINT64_T_WRONG_SIZE) + +/* This structure is used for 'bytes' arrays. + * It has the number of bytes in the beginning, and after that an array. + * Note that actual structs used will have a different length of bytes array. + */ +#define PB_BYTES_ARRAY_T(n) struct { pb_size_t size; pb_byte_t bytes[n]; } +#define PB_BYTES_ARRAY_T_ALLOCSIZE(n) ((size_t)n + offsetof(pb_bytes_array_t, bytes)) + +struct pb_bytes_array_s { + pb_size_t size; + pb_byte_t bytes[1]; +}; +typedef struct pb_bytes_array_s pb_bytes_array_t; + +/* This structure is used for giving the callback function. + * It is stored in the message structure and filled in by the method that + * calls pb_decode. + * + * The decoding callback will be given a limited-length stream + * If the wire type was string, the length is the length of the string. + * If the wire type was a varint/fixed32/fixed64, the length is the length + * of the actual value. + * The function may be called multiple times (especially for repeated types, + * but also otherwise if the message happens to contain the field multiple + * times.) + * + * The encoding callback will receive the actual output stream. + * It should write all the data in one call, including the field tag and + * wire type. It can write multiple fields. + * + * The callback can be null if you want to skip a field. + */ +typedef struct pb_istream_s pb_istream_t; +typedef struct pb_ostream_s pb_ostream_t; +typedef struct pb_callback_s pb_callback_t; +struct pb_callback_s { +#ifdef PB_OLD_CALLBACK_STYLE + /* Deprecated since nanopb-0.2.1 */ + union { + bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void *arg); + bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, const void *arg); + } funcs; +#else + /* New function signature, which allows modifying arg contents in callback. */ + union { + bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void **arg); + bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, void * const *arg); + } funcs; +#endif + + /* Free arg for use by callback */ + void *arg; +}; + +/* Wire types. Library user needs these only in encoder callbacks. */ +typedef enum { + PB_WT_VARINT = 0, + PB_WT_64BIT = 1, + PB_WT_STRING = 2, + PB_WT_32BIT = 5 +} pb_wire_type_t; + +/* Structure for defining the handling of unknown/extension fields. + * Usually the pb_extension_type_t structure is automatically generated, + * while the pb_extension_t structure is created by the user. However, + * if you want to catch all unknown fields, you can also create a custom + * pb_extension_type_t with your own callback. + */ +typedef struct pb_extension_type_s pb_extension_type_t; +typedef struct pb_extension_s pb_extension_t; +struct pb_extension_type_s { + /* Called for each unknown field in the message. + * If you handle the field, read off all of its data and return true. + * If you do not handle the field, do not read anything and return true. + * If you run into an error, return false. + * Set to NULL for default handler. + */ + bool (*decode)(pb_istream_t *stream, pb_extension_t *extension, + uint32_t tag, pb_wire_type_t wire_type); + + /* Called once after all regular fields have been encoded. + * If you have something to write, do so and return true. + * If you do not have anything to write, just return true. + * If you run into an error, return false. + * Set to NULL for default handler. + */ + bool (*encode)(pb_ostream_t *stream, const pb_extension_t *extension); + + /* Free field for use by the callback. */ + const void *arg; +}; + +struct pb_extension_s { + /* Type describing the extension field. Usually you'll initialize + * this to a pointer to the automatically generated structure. */ + const pb_extension_type_t *type; + + /* Destination for the decoded data. This must match the datatype + * of the extension field. */ + void *dest; + + /* Pointer to the next extension handler, or NULL. + * If this extension does not match a field, the next handler is + * automatically called. */ + pb_extension_t *next; + + /* The decoder sets this to true if the extension was found. + * Ignored for encoding. */ + bool found; +}; + +/* Memory allocation functions to use. You can define pb_realloc and + * pb_free to custom functions if you want. */ +#ifdef PB_ENABLE_MALLOC +# ifndef pb_realloc +# define pb_realloc(ptr, size) realloc(ptr, size) +# endif +# ifndef pb_free +# define pb_free(ptr) free(ptr) +# endif +#endif + +/* This is used to inform about need to regenerate .pb.h/.pb.c files. */ +#define PB_PROTO_HEADER_VERSION 30 + +/* These macros are used to declare pb_field_t's in the constant array. */ +/* Size of a structure member, in bytes. */ +#define pb_membersize(st, m) (sizeof ((st*)0)->m) +/* Number of entries in an array. */ +#define pb_arraysize(st, m) (pb_membersize(st, m) / pb_membersize(st, m[0])) +/* Delta from start of one member to the start of another member. */ +#define pb_delta(st, m1, m2) ((int)offsetof(st, m1) - (int)offsetof(st, m2)) +/* Marks the end of the field list */ +#define PB_LAST_FIELD {0,(pb_type_t) 0,0,0,0,0,0} + +/* Macros for filling in the data_offset field */ +/* data_offset for first field in a message */ +#define PB_DATAOFFSET_FIRST(st, m1, m2) (offsetof(st, m1)) +/* data_offset for subsequent fields */ +#define PB_DATAOFFSET_OTHER(st, m1, m2) (offsetof(st, m1) - offsetof(st, m2) - pb_membersize(st, m2)) +/* data offset for subsequent fields inside an union (oneof) */ +#define PB_DATAOFFSET_UNION(st, m1, m2) (PB_SIZE_MAX) +/* Choose first/other based on m1 == m2 (deprecated, remains for backwards compatibility) */ +#define PB_DATAOFFSET_CHOOSE(st, m1, m2) (int)(offsetof(st, m1) == offsetof(st, m2) \ + ? PB_DATAOFFSET_FIRST(st, m1, m2) \ + : PB_DATAOFFSET_OTHER(st, m1, m2)) + +/* Required fields are the simplest. They just have delta (padding) from + * previous field end, and the size of the field. Pointer is used for + * submessages and default values. + */ +#define PB_REQUIRED_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_REQUIRED | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +/* Optional fields add the delta to the has_ variable. */ +#define PB_OPTIONAL_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_OPTIONAL | ltype, \ + fd, \ + pb_delta(st, has_ ## m, m), \ + pb_membersize(st, m), 0, ptr} + +#define PB_SINGULAR_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +/* Repeated fields have a _count field and also the maximum number of entries. */ +#define PB_REPEATED_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_REPEATED | ltype, \ + fd, \ + pb_delta(st, m ## _count, m), \ + pb_membersize(st, m[0]), \ + pb_arraysize(st, m), ptr} + +/* Allocated fields carry the size of the actual data, not the pointer */ +#define PB_REQUIRED_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_REQUIRED | ltype, \ + fd, 0, pb_membersize(st, m[0]), 0, ptr} + +/* Optional fields don't need a has_ variable, as information would be redundant */ +#define PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m[0]), 0, ptr} + +/* Same as optional fields*/ +#define PB_SINGULAR_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m[0]), 0, ptr} + +/* Repeated fields have a _count field and a pointer to array of pointers */ +#define PB_REPEATED_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_REPEATED | ltype, \ + fd, pb_delta(st, m ## _count, m), \ + pb_membersize(st, m[0]), 0, ptr} + +/* Callbacks are much like required fields except with special datatype. */ +#define PB_REQUIRED_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_REQUIRED | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +#define PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +#define PB_SINGULAR_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +#define PB_REPEATED_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_REPEATED | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +/* Optional extensions don't have the has_ field, as that would be redundant. + * Furthermore, the combination of OPTIONAL without has_ field is used + * for indicating proto3 style fields. Extensions exist in proto2 mode only, + * so they should be encoded according to proto2 rules. To avoid the conflict, + * extensions are marked as REQUIRED instead. + */ +#define PB_OPTEXT_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_REQUIRED | ltype, \ + 0, \ + 0, \ + pb_membersize(st, m), 0, ptr} + +#define PB_OPTEXT_POINTER(tag, st, m, fd, ltype, ptr) \ + PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr) + +#define PB_OPTEXT_CALLBACK(tag, st, m, fd, ltype, ptr) \ + PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr) + +/* The mapping from protobuf types to LTYPEs is done using these macros. */ +#define PB_LTYPE_MAP_BOOL PB_LTYPE_VARINT +#define PB_LTYPE_MAP_BYTES PB_LTYPE_BYTES +#define PB_LTYPE_MAP_DOUBLE PB_LTYPE_FIXED64 +#define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINT +#define PB_LTYPE_MAP_UENUM PB_LTYPE_UVARINT +#define PB_LTYPE_MAP_FIXED32 PB_LTYPE_FIXED32 +#define PB_LTYPE_MAP_FIXED64 PB_LTYPE_FIXED64 +#define PB_LTYPE_MAP_FLOAT PB_LTYPE_FIXED32 +#define PB_LTYPE_MAP_INT32 PB_LTYPE_VARINT +#define PB_LTYPE_MAP_INT64 PB_LTYPE_VARINT +#define PB_LTYPE_MAP_MESSAGE PB_LTYPE_SUBMESSAGE +#define PB_LTYPE_MAP_SFIXED32 PB_LTYPE_FIXED32 +#define PB_LTYPE_MAP_SFIXED64 PB_LTYPE_FIXED64 +#define PB_LTYPE_MAP_SINT32 PB_LTYPE_SVARINT +#define PB_LTYPE_MAP_SINT64 PB_LTYPE_SVARINT +#define PB_LTYPE_MAP_STRING PB_LTYPE_STRING +#define PB_LTYPE_MAP_UINT32 PB_LTYPE_UVARINT +#define PB_LTYPE_MAP_UINT64 PB_LTYPE_UVARINT +#define PB_LTYPE_MAP_EXTENSION PB_LTYPE_EXTENSION +#define PB_LTYPE_MAP_FIXED_LENGTH_BYTES PB_LTYPE_FIXED_LENGTH_BYTES + +/* This is the actual macro used in field descriptions. + * It takes these arguments: + * - Field tag number + * - Field type: BOOL, BYTES, DOUBLE, ENUM, UENUM, FIXED32, FIXED64, + * FLOAT, INT32, INT64, MESSAGE, SFIXED32, SFIXED64 + * SINT32, SINT64, STRING, UINT32, UINT64 or EXTENSION + * - Field rules: REQUIRED, OPTIONAL or REPEATED + * - Allocation: STATIC, CALLBACK or POINTER + * - Placement: FIRST or OTHER, depending on if this is the first field in structure. + * - Message name + * - Field name + * - Previous field name (or field name again for first field) + * - Pointer to default value or submsg fields. + */ + +#define PB_FIELD(tag, type, rules, allocation, placement, message, field, prevfield, ptr) \ + PB_ ## rules ## _ ## allocation(tag, message, field, \ + PB_DATAOFFSET_ ## placement(message, field, prevfield), \ + PB_LTYPE_MAP_ ## type, ptr) + +/* Field description for oneof fields. This requires taking into account the + * union name also, that's why a separate set of macros is needed. + */ +#define PB_ONEOF_STATIC(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, u.m), \ + pb_membersize(st, u.m), 0, ptr} + +#define PB_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, u.m), \ + pb_membersize(st, u.m[0]), 0, ptr} + +#define PB_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \ + PB_ONEOF_ ## allocation(union_name, tag, message, field, \ + PB_DATAOFFSET_ ## placement(message, union_name.field, prevfield), \ + PB_LTYPE_MAP_ ## type, ptr) + +#define PB_ANONYMOUS_ONEOF_STATIC(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, m), \ + pb_membersize(st, m), 0, ptr} + +#define PB_ANONYMOUS_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, m), \ + pb_membersize(st, m[0]), 0, ptr} + +#define PB_ANONYMOUS_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \ + PB_ANONYMOUS_ONEOF_ ## allocation(union_name, tag, message, field, \ + PB_DATAOFFSET_ ## placement(message, field, prevfield), \ + PB_LTYPE_MAP_ ## type, ptr) + +/* These macros are used for giving out error messages. + * They are mostly a debugging aid; the main error information + * is the true/false return value from functions. + * Some code space can be saved by disabling the error + * messages if not used. + * + * PB_SET_ERROR() sets the error message if none has been set yet. + * msg must be a constant string literal. + * PB_GET_ERROR() always returns a pointer to a string. + * PB_RETURN_ERROR() sets the error and returns false from current + * function. + */ +#ifdef PB_NO_ERRMSG +#define PB_SET_ERROR(stream, msg) PB_UNUSED(stream) +#define PB_GET_ERROR(stream) "(errmsg disabled)" +#else +#define PB_SET_ERROR(stream, msg) (stream->errmsg = (stream)->errmsg ? (stream)->errmsg : (msg)) +#define PB_GET_ERROR(stream) ((stream)->errmsg ? (stream)->errmsg : "(none)") +#endif + +#define PB_RETURN_ERROR(stream, msg) return PB_SET_ERROR(stream, msg), false + +#endif diff --git a/Verdnaturaventas/Pods/nanopb/pb_common.c b/Verdnaturaventas/Pods/nanopb/pb_common.c new file mode 100644 index 0000000..4fb7186 --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb_common.c @@ -0,0 +1,97 @@ +/* pb_common.c: Common support functions for pb_encode.c and pb_decode.c. + * + * 2014 Petteri Aimonen + */ + +#include "pb_common.h" + +bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_field_t *fields, void *dest_struct) +{ + iter->start = fields; + iter->pos = fields; + iter->required_field_index = 0; + iter->dest_struct = dest_struct; + iter->pData = (char*)dest_struct + iter->pos->data_offset; + iter->pSize = (char*)iter->pData + iter->pos->size_offset; + + return (iter->pos->tag != 0); +} + +bool pb_field_iter_next(pb_field_iter_t *iter) +{ + const pb_field_t *prev_field = iter->pos; + + if (prev_field->tag == 0) + { + /* Handle empty message types, where the first field is already the terminator. + * In other cases, the iter->pos never points to the terminator. */ + return false; + } + + iter->pos++; + + if (iter->pos->tag == 0) + { + /* Wrapped back to beginning, reinitialize */ + (void)pb_field_iter_begin(iter, iter->start, iter->dest_struct); + return false; + } + else + { + /* Increment the pointers based on previous field size */ + size_t prev_size = prev_field->data_size; + + if (PB_HTYPE(prev_field->type) == PB_HTYPE_ONEOF && + PB_HTYPE(iter->pos->type) == PB_HTYPE_ONEOF && + iter->pos->data_offset == PB_SIZE_MAX) + { + /* Don't advance pointers inside unions */ + return true; + } + else if (PB_ATYPE(prev_field->type) == PB_ATYPE_STATIC && + PB_HTYPE(prev_field->type) == PB_HTYPE_REPEATED) + { + /* In static arrays, the data_size tells the size of a single entry and + * array_size is the number of entries */ + prev_size *= prev_field->array_size; + } + else if (PB_ATYPE(prev_field->type) == PB_ATYPE_POINTER) + { + /* Pointer fields always have a constant size in the main structure. + * The data_size only applies to the dynamically allocated area. */ + prev_size = sizeof(void*); + } + + if (PB_HTYPE(prev_field->type) == PB_HTYPE_REQUIRED) + { + /* Count the required fields, in order to check their presence in the + * decoder. */ + iter->required_field_index++; + } + + iter->pData = (char*)iter->pData + prev_size + iter->pos->data_offset; + iter->pSize = (char*)iter->pData + iter->pos->size_offset; + return true; + } +} + +bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag) +{ + const pb_field_t *start = iter->pos; + + do { + if (iter->pos->tag == tag && + PB_LTYPE(iter->pos->type) != PB_LTYPE_EXTENSION) + { + /* Found the wanted field */ + return true; + } + + (void)pb_field_iter_next(iter); + } while (iter->pos != start); + + /* Searched all the way back to start, and found nothing. */ + return false; +} + + diff --git a/Verdnaturaventas/Pods/nanopb/pb_common.h b/Verdnaturaventas/Pods/nanopb/pb_common.h new file mode 100644 index 0000000..60b3d37 --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb_common.h @@ -0,0 +1,42 @@ +/* pb_common.h: Common support functions for pb_encode.c and pb_decode.c. + * These functions are rarely needed by applications directly. + */ + +#ifndef PB_COMMON_H_INCLUDED +#define PB_COMMON_H_INCLUDED + +#include "pb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Iterator for pb_field_t list */ +struct pb_field_iter_s { + const pb_field_t *start; /* Start of the pb_field_t array */ + const pb_field_t *pos; /* Current position of the iterator */ + unsigned required_field_index; /* Zero-based index that counts only the required fields */ + void *dest_struct; /* Pointer to start of the structure */ + void *pData; /* Pointer to current field value */ + void *pSize; /* Pointer to count/has field */ +}; +typedef struct pb_field_iter_s pb_field_iter_t; + +/* Initialize the field iterator structure to beginning. + * Returns false if the message type is empty. */ +bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_field_t *fields, void *dest_struct); + +/* Advance the iterator to the next field. + * Returns false when the iterator wraps back to the first field. */ +bool pb_field_iter_next(pb_field_iter_t *iter); + +/* Advance the iterator until it points at a field with the given tag. + * Returns false if no such field exists. */ +bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif + diff --git a/Verdnaturaventas/Pods/nanopb/pb_decode.c b/Verdnaturaventas/Pods/nanopb/pb_decode.c new file mode 100644 index 0000000..e2e90ca --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb_decode.c @@ -0,0 +1,1379 @@ +/* pb_decode.c -- decode a protobuf using minimal resources + * + * 2011 Petteri Aimonen + */ + +/* Use the GCC warn_unused_result attribute to check that all return values + * are propagated correctly. On other compilers and gcc before 3.4.0 just + * ignore the annotation. + */ +#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) + #define checkreturn +#else + #define checkreturn __attribute__((warn_unused_result)) +#endif + +#include "pb.h" +#include "pb_decode.h" +#include "pb_common.h" + +/************************************** + * Declarations internal to this file * + **************************************/ + +typedef bool (*pb_decoder_t)(pb_istream_t *stream, const pb_field_t *field, void *dest) checkreturn; + +static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count); +static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size); +static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static void iter_from_extension(pb_field_iter_t *iter, pb_extension_t *extension); +static bool checkreturn default_extension_decoder(pb_istream_t *stream, pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type); +static bool checkreturn decode_extension(pb_istream_t *stream, uint32_t tag, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static bool checkreturn find_extension_field(pb_field_iter_t *iter); +static void pb_field_set_to_default(pb_field_iter_t *iter); +static void pb_message_set_to_defaults(const pb_field_t fields[], void *dest_struct); +static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_uvarint(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_fixed32(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_fixed64(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_fixed_length_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_skip_varint(pb_istream_t *stream); +static bool checkreturn pb_skip_string(pb_istream_t *stream); + +#ifdef PB_ENABLE_MALLOC +static bool checkreturn allocate_field(pb_istream_t *stream, void *pData, size_t data_size, size_t array_size); +static bool checkreturn pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *iter); +static void pb_release_single_field(const pb_field_iter_t *iter); +#endif + +/* --- Function pointers to field decoders --- + * Order in the array must match pb_action_t LTYPE numbering. + */ +static const pb_decoder_t PB_DECODERS[PB_LTYPES_COUNT] = { + &pb_dec_varint, + &pb_dec_uvarint, + &pb_dec_svarint, + &pb_dec_fixed32, + &pb_dec_fixed64, + + &pb_dec_bytes, + &pb_dec_string, + &pb_dec_submessage, + NULL, /* extensions */ + &pb_dec_fixed_length_bytes +}; + +/******************************* + * pb_istream_t implementation * + *******************************/ + +static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) +{ + size_t i; + const pb_byte_t *source = (const pb_byte_t*)stream->state; + stream->state = (pb_byte_t*)stream->state + count; + + if (buf != NULL) + { + for (i = 0; i < count; i++) + buf[i] = source[i]; + } + + return true; +} + +bool checkreturn pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) +{ +#ifndef PB_BUFFER_ONLY + if (buf == NULL && stream->callback != buf_read) + { + /* Skip input bytes */ + pb_byte_t tmp[16]; + while (count > 16) + { + if (!pb_read(stream, tmp, 16)) + return false; + + count -= 16; + } + + return pb_read(stream, tmp, count); + } +#endif + + if (stream->bytes_left < count) + PB_RETURN_ERROR(stream, "end-of-stream"); + +#ifndef PB_BUFFER_ONLY + if (!stream->callback(stream, buf, count)) + PB_RETURN_ERROR(stream, "io error"); +#else + if (!buf_read(stream, buf, count)) + return false; +#endif + + stream->bytes_left -= count; + return true; +} + +/* Read a single byte from input stream. buf may not be NULL. + * This is an optimization for the varint decoding. */ +static bool checkreturn pb_readbyte(pb_istream_t *stream, pb_byte_t *buf) +{ + if (stream->bytes_left == 0) + PB_RETURN_ERROR(stream, "end-of-stream"); + +#ifndef PB_BUFFER_ONLY + if (!stream->callback(stream, buf, 1)) + PB_RETURN_ERROR(stream, "io error"); +#else + *buf = *(const pb_byte_t*)stream->state; + stream->state = (pb_byte_t*)stream->state + 1; +#endif + + stream->bytes_left--; + + return true; +} + +pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t bufsize) +{ + pb_istream_t stream; + /* Cast away the const from buf without a compiler error. We are + * careful to use it only in a const manner in the callbacks. + */ + union { + void *state; + const void *c_state; + } state; +#ifdef PB_BUFFER_ONLY + stream.callback = NULL; +#else + stream.callback = &buf_read; +#endif + state.c_state = buf; + stream.state = state.state; + stream.bytes_left = bufsize; +#ifndef PB_NO_ERRMSG + stream.errmsg = NULL; +#endif + return stream; +} + +/******************** + * Helper functions * + ********************/ + +bool checkreturn pb_decode_varint32(pb_istream_t *stream, uint32_t *dest) +{ + pb_byte_t byte; + uint32_t result; + + if (!pb_readbyte(stream, &byte)) + return false; + + if ((byte & 0x80) == 0) + { + /* Quick case, 1 byte value */ + result = byte; + } + else + { + /* Multibyte case */ + uint_fast8_t bitpos = 7; + result = byte & 0x7F; + + do + { + if (bitpos >= 32) + PB_RETURN_ERROR(stream, "varint overflow"); + + if (!pb_readbyte(stream, &byte)) + return false; + + result |= (uint32_t)(byte & 0x7F) << bitpos; + bitpos = (uint_fast8_t)(bitpos + 7); + } while (byte & 0x80); + } + + *dest = result; + return true; +} + +bool checkreturn pb_decode_varint(pb_istream_t *stream, uint64_t *dest) +{ + pb_byte_t byte; + uint_fast8_t bitpos = 0; + uint64_t result = 0; + + do + { + if (bitpos >= 64) + PB_RETURN_ERROR(stream, "varint overflow"); + + if (!pb_readbyte(stream, &byte)) + return false; + + result |= (uint64_t)(byte & 0x7F) << bitpos; + bitpos = (uint_fast8_t)(bitpos + 7); + } while (byte & 0x80); + + *dest = result; + return true; +} + +bool checkreturn pb_skip_varint(pb_istream_t *stream) +{ + pb_byte_t byte; + do + { + if (!pb_read(stream, &byte, 1)) + return false; + } while (byte & 0x80); + return true; +} + +bool checkreturn pb_skip_string(pb_istream_t *stream) +{ + uint32_t length; + if (!pb_decode_varint32(stream, &length)) + return false; + + return pb_read(stream, NULL, length); +} + +bool checkreturn pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof) +{ + uint32_t temp; + *eof = false; + *wire_type = (pb_wire_type_t) 0; + *tag = 0; + + if (!pb_decode_varint32(stream, &temp)) + { + if (stream->bytes_left == 0) + *eof = true; + + return false; + } + + if (temp == 0) + { + *eof = true; /* Special feature: allow 0-terminated messages. */ + return false; + } + + *tag = temp >> 3; + *wire_type = (pb_wire_type_t)(temp & 7); + return true; +} + +bool checkreturn pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type) +{ + switch (wire_type) + { + case PB_WT_VARINT: return pb_skip_varint(stream); + case PB_WT_64BIT: return pb_read(stream, NULL, 8); + case PB_WT_STRING: return pb_skip_string(stream); + case PB_WT_32BIT: return pb_read(stream, NULL, 4); + default: PB_RETURN_ERROR(stream, "invalid wire_type"); + } +} + +/* Read a raw value to buffer, for the purpose of passing it to callback as + * a substream. Size is maximum size on call, and actual size on return. + */ +static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size) +{ + size_t max_size = *size; + switch (wire_type) + { + case PB_WT_VARINT: + *size = 0; + do + { + (*size)++; + if (*size > max_size) return false; + if (!pb_read(stream, buf, 1)) return false; + } while (*buf++ & 0x80); + return true; + + case PB_WT_64BIT: + *size = 8; + return pb_read(stream, buf, 8); + + case PB_WT_32BIT: + *size = 4; + return pb_read(stream, buf, 4); + + default: PB_RETURN_ERROR(stream, "invalid wire_type"); + } +} + +/* Decode string length from stream and return a substream with limited length. + * Remember to close the substream using pb_close_string_substream(). + */ +bool checkreturn pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream) +{ + uint32_t size; + if (!pb_decode_varint32(stream, &size)) + return false; + + *substream = *stream; + if (substream->bytes_left < size) + PB_RETURN_ERROR(stream, "parent stream too short"); + + substream->bytes_left = size; + stream->bytes_left -= size; + return true; +} + +bool checkreturn pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream) +{ + if (substream->bytes_left) { + if (!pb_read(substream, NULL, substream->bytes_left)) + return false; + } + + stream->state = substream->state; + +#ifndef PB_NO_ERRMSG + stream->errmsg = substream->errmsg; +#endif + return true; +} + +/************************* + * Decode a single field * + *************************/ + +static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ + pb_type_t type; + pb_decoder_t func; + + type = iter->pos->type; + func = PB_DECODERS[PB_LTYPE(type)]; + + switch (PB_HTYPE(type)) + { + case PB_HTYPE_REQUIRED: + return func(stream, iter->pos, iter->pData); + + case PB_HTYPE_OPTIONAL: + if (iter->pSize != iter->pData) + *(bool*)iter->pSize = true; + return func(stream, iter->pos, iter->pData); + + case PB_HTYPE_REPEATED: + if (wire_type == PB_WT_STRING + && PB_LTYPE(type) <= PB_LTYPE_LAST_PACKABLE) + { + /* Packed array */ + bool status = true; + pb_size_t *size = (pb_size_t*)iter->pSize; + pb_istream_t substream; + if (!pb_make_string_substream(stream, &substream)) + return false; + + while (substream.bytes_left > 0 && *size < iter->pos->array_size) + { + void *pItem = (char*)iter->pData + iter->pos->data_size * (*size); + if (!func(&substream, iter->pos, pItem)) + { + status = false; + break; + } + (*size)++; + } + + if (substream.bytes_left != 0) + PB_RETURN_ERROR(stream, "array overflow"); + if (!pb_close_string_substream(stream, &substream)) + return false; + + return status; + } + else + { + /* Repeated field */ + pb_size_t *size = (pb_size_t*)iter->pSize; + void *pItem = (char*)iter->pData + iter->pos->data_size * (*size); + if (*size >= iter->pos->array_size) + PB_RETURN_ERROR(stream, "array overflow"); + + (*size)++; + return func(stream, iter->pos, pItem); + } + + case PB_HTYPE_ONEOF: + *(pb_size_t*)iter->pSize = iter->pos->tag; + if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE) + { + /* We memset to zero so that any callbacks are set to NULL. + * Then set any default values. */ + memset(iter->pData, 0, iter->pos->data_size); + pb_message_set_to_defaults((const pb_field_t*)iter->pos->ptr, iter->pData); + } + return func(stream, iter->pos, iter->pData); + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +} + +#ifdef PB_ENABLE_MALLOC +/* Allocate storage for the field and store the pointer at iter->pData. + * array_size is the number of entries to reserve in an array. + * Zero size is not allowed, use pb_free() for releasing. + */ +static bool checkreturn allocate_field(pb_istream_t *stream, void *pData, size_t data_size, size_t array_size) +{ + void *ptr = *(void**)pData; + + if (data_size == 0 || array_size == 0) + PB_RETURN_ERROR(stream, "invalid size"); + + /* Check for multiplication overflows. + * This code avoids the costly division if the sizes are small enough. + * Multiplication is safe as long as only half of bits are set + * in either multiplicand. + */ + { + const size_t check_limit = (size_t)1 << (sizeof(size_t) * 4); + if (data_size >= check_limit || array_size >= check_limit) + { + const size_t size_max = (size_t)-1; + if (size_max / array_size < data_size) + { + PB_RETURN_ERROR(stream, "size too large"); + } + } + } + + /* Allocate new or expand previous allocation */ + /* Note: on failure the old pointer will remain in the structure, + * the message must be freed by caller also on error return. */ + ptr = pb_realloc(ptr, array_size * data_size); + if (ptr == NULL) + PB_RETURN_ERROR(stream, "realloc failed"); + + *(void**)pData = ptr; + return true; +} + +/* Clear a newly allocated item in case it contains a pointer, or is a submessage. */ +static void initialize_pointer_field(void *pItem, pb_field_iter_t *iter) +{ + if (PB_LTYPE(iter->pos->type) == PB_LTYPE_STRING || + PB_LTYPE(iter->pos->type) == PB_LTYPE_BYTES) + { + *(void**)pItem = NULL; + } + else if (PB_LTYPE(iter->pos->type) == PB_LTYPE_SUBMESSAGE) + { + pb_message_set_to_defaults((const pb_field_t *) iter->pos->ptr, pItem); + } +} +#endif + +static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ +#ifndef PB_ENABLE_MALLOC + PB_UNUSED(wire_type); + PB_UNUSED(iter); + PB_RETURN_ERROR(stream, "no malloc support"); +#else + pb_type_t type; + pb_decoder_t func; + + type = iter->pos->type; + func = PB_DECODERS[PB_LTYPE(type)]; + + switch (PB_HTYPE(type)) + { + case PB_HTYPE_REQUIRED: + case PB_HTYPE_OPTIONAL: + case PB_HTYPE_ONEOF: + if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE && + *(void**)iter->pData != NULL) + { + /* Duplicate field, have to release the old allocation first. */ + pb_release_single_field(iter); + } + + if (PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + *(pb_size_t*)iter->pSize = iter->pos->tag; + } + + if (PB_LTYPE(type) == PB_LTYPE_STRING || + PB_LTYPE(type) == PB_LTYPE_BYTES) + { + return func(stream, iter->pos, iter->pData); + } + else + { + if (!allocate_field(stream, iter->pData, iter->pos->data_size, 1)) + return false; + + initialize_pointer_field(*(void**)iter->pData, iter); + return func(stream, iter->pos, *(void**)iter->pData); + } + + case PB_HTYPE_REPEATED: + if (wire_type == PB_WT_STRING + && PB_LTYPE(type) <= PB_LTYPE_LAST_PACKABLE) + { + /* Packed array, multiple items come in at once. */ + bool status = true; + pb_size_t *size = (pb_size_t*)iter->pSize; + size_t allocated_size = *size; + void *pItem; + pb_istream_t substream; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + while (substream.bytes_left) + { + if ((size_t)*size + 1 > allocated_size) + { + /* Allocate more storage. This tries to guess the + * number of remaining entries. Round the division + * upwards. */ + allocated_size += (substream.bytes_left - 1) / iter->pos->data_size + 1; + + if (!allocate_field(&substream, iter->pData, iter->pos->data_size, allocated_size)) + { + status = false; + break; + } + } + + /* Decode the array entry */ + pItem = *(char**)iter->pData + iter->pos->data_size * (*size); + initialize_pointer_field(pItem, iter); + if (!func(&substream, iter->pos, pItem)) + { + status = false; + break; + } + + if (*size == PB_SIZE_MAX) + { +#ifndef PB_NO_ERRMSG + stream->errmsg = "too many array entries"; +#endif + status = false; + break; + } + + (*size)++; + } + if (!pb_close_string_substream(stream, &substream)) + return false; + + return status; + } + else + { + /* Normal repeated field, i.e. only one item at a time. */ + pb_size_t *size = (pb_size_t*)iter->pSize; + void *pItem; + + if (*size == PB_SIZE_MAX) + PB_RETURN_ERROR(stream, "too many array entries"); + + (*size)++; + if (!allocate_field(stream, iter->pData, iter->pos->data_size, *size)) + return false; + + pItem = *(char**)iter->pData + iter->pos->data_size * (*size - 1); + initialize_pointer_field(pItem, iter); + return func(stream, iter->pos, pItem); + } + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +#endif +} + +static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ + pb_callback_t *pCallback = (pb_callback_t*)iter->pData; + +#ifdef PB_OLD_CALLBACK_STYLE + void *arg = pCallback->arg; +#else + void **arg = &(pCallback->arg); +#endif + + if (pCallback->funcs.decode == NULL) + return pb_skip_field(stream, wire_type); + + if (wire_type == PB_WT_STRING) + { + pb_istream_t substream; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + do + { + if (!pCallback->funcs.decode(&substream, iter->pos, arg)) + PB_RETURN_ERROR(stream, "callback failed"); + } while (substream.bytes_left); + + if (!pb_close_string_substream(stream, &substream)) + return false; + + return true; + } + else + { + /* Copy the single scalar value to stack. + * This is required so that we can limit the stream length, + * which in turn allows to use same callback for packed and + * not-packed fields. */ + pb_istream_t substream; + pb_byte_t buffer[10]; + size_t size = sizeof(buffer); + + if (!read_raw_value(stream, wire_type, buffer, &size)) + return false; + substream = pb_istream_from_buffer(buffer, size); + + return pCallback->funcs.decode(&substream, iter->pos, arg); + } +} + +static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ +#ifdef PB_ENABLE_MALLOC + /* When decoding an oneof field, check if there is old data that must be + * released first. */ + if (PB_HTYPE(iter->pos->type) == PB_HTYPE_ONEOF) + { + if (!pb_release_union_field(stream, iter)) + return false; + } +#endif + + switch (PB_ATYPE(iter->pos->type)) + { + case PB_ATYPE_STATIC: + return decode_static_field(stream, wire_type, iter); + + case PB_ATYPE_POINTER: + return decode_pointer_field(stream, wire_type, iter); + + case PB_ATYPE_CALLBACK: + return decode_callback_field(stream, wire_type, iter); + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +} + +static void iter_from_extension(pb_field_iter_t *iter, pb_extension_t *extension) +{ + /* Fake a field iterator for the extension field. + * It is not actually safe to advance this iterator, but decode_field + * will not even try to. */ + const pb_field_t *field = (const pb_field_t*)extension->type->arg; + (void)pb_field_iter_begin(iter, field, extension->dest); + iter->pData = extension->dest; + iter->pSize = &extension->found; + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { + /* For pointer extensions, the pointer is stored directly + * in the extension structure. This avoids having an extra + * indirection. */ + iter->pData = &extension->dest; + } +} + +/* Default handler for extension fields. Expects a pb_field_t structure + * in extension->type->arg. */ +static bool checkreturn default_extension_decoder(pb_istream_t *stream, + pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type) +{ + const pb_field_t *field = (const pb_field_t*)extension->type->arg; + pb_field_iter_t iter; + + if (field->tag != tag) + return true; + + iter_from_extension(&iter, extension); + extension->found = true; + return decode_field(stream, wire_type, &iter); +} + +/* Try to decode an unknown field as an extension field. Tries each extension + * decoder in turn, until one of them handles the field or loop ends. */ +static bool checkreturn decode_extension(pb_istream_t *stream, + uint32_t tag, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ + pb_extension_t *extension = *(pb_extension_t* const *)iter->pData; + size_t pos = stream->bytes_left; + + while (extension != NULL && pos == stream->bytes_left) + { + bool status; + if (extension->type->decode) + status = extension->type->decode(stream, extension, tag, wire_type); + else + status = default_extension_decoder(stream, extension, tag, wire_type); + + if (!status) + return false; + + extension = extension->next; + } + + return true; +} + +/* Step through the iterator until an extension field is found or until all + * entries have been checked. There can be only one extension field per + * message. Returns false if no extension field is found. */ +static bool checkreturn find_extension_field(pb_field_iter_t *iter) +{ + const pb_field_t *start = iter->pos; + + do { + if (PB_LTYPE(iter->pos->type) == PB_LTYPE_EXTENSION) + return true; + (void)pb_field_iter_next(iter); + } while (iter->pos != start); + + return false; +} + +/* Initialize message fields to default values, recursively */ +static void pb_field_set_to_default(pb_field_iter_t *iter) +{ + pb_type_t type; + type = iter->pos->type; + + if (PB_LTYPE(type) == PB_LTYPE_EXTENSION) + { + pb_extension_t *ext = *(pb_extension_t* const *)iter->pData; + while (ext != NULL) + { + pb_field_iter_t ext_iter; + ext->found = false; + iter_from_extension(&ext_iter, ext); + pb_field_set_to_default(&ext_iter); + ext = ext->next; + } + } + else if (PB_ATYPE(type) == PB_ATYPE_STATIC) + { + bool init_data = true; + if (PB_HTYPE(type) == PB_HTYPE_OPTIONAL && iter->pSize != iter->pData) + { + /* Set has_field to false. Still initialize the optional field + * itself also. */ + *(bool*)iter->pSize = false; + } + else if (PB_HTYPE(type) == PB_HTYPE_REPEATED || + PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + /* REPEATED: Set array count to 0, no need to initialize contents. + ONEOF: Set which_field to 0. */ + *(pb_size_t*)iter->pSize = 0; + init_data = false; + } + + if (init_data) + { + if (PB_LTYPE(iter->pos->type) == PB_LTYPE_SUBMESSAGE) + { + /* Initialize submessage to defaults */ + pb_message_set_to_defaults((const pb_field_t *) iter->pos->ptr, iter->pData); + } + else if (iter->pos->ptr != NULL) + { + /* Initialize to default value */ + memcpy(iter->pData, iter->pos->ptr, iter->pos->data_size); + } + else + { + /* Initialize to zeros */ + memset(iter->pData, 0, iter->pos->data_size); + } + } + } + else if (PB_ATYPE(type) == PB_ATYPE_POINTER) + { + /* Initialize the pointer to NULL. */ + *(void**)iter->pData = NULL; + + /* Initialize array count to 0. */ + if (PB_HTYPE(type) == PB_HTYPE_REPEATED || + PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + *(pb_size_t*)iter->pSize = 0; + } + } + else if (PB_ATYPE(type) == PB_ATYPE_CALLBACK) + { + /* Don't overwrite callback */ + } +} + +static void pb_message_set_to_defaults(const pb_field_t fields[], void *dest_struct) +{ + pb_field_iter_t iter; + + if (!pb_field_iter_begin(&iter, fields, dest_struct)) + return; /* Empty message type */ + + do + { + pb_field_set_to_default(&iter); + } while (pb_field_iter_next(&iter)); +} + +/********************* + * Decode all fields * + *********************/ + +bool checkreturn pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct) +{ + uint32_t fields_seen[(PB_MAX_REQUIRED_FIELDS + 31) / 32] = {0, 0}; + const uint32_t allbits = ~(uint32_t)0; + uint32_t extension_range_start = 0; + pb_field_iter_t iter; + + /* Return value ignored, as empty message types will be correctly handled by + * pb_field_iter_find() anyway. */ + (void)pb_field_iter_begin(&iter, fields, dest_struct); + + while (stream->bytes_left) + { + uint32_t tag; + pb_wire_type_t wire_type; + bool eof; + + if (!pb_decode_tag(stream, &wire_type, &tag, &eof)) + { + if (eof) + break; + else + return false; + } + + if (!pb_field_iter_find(&iter, tag)) + { + /* No match found, check if it matches an extension. */ + if (tag >= extension_range_start) + { + if (!find_extension_field(&iter)) + extension_range_start = (uint32_t)-1; + else + extension_range_start = iter.pos->tag; + + if (tag >= extension_range_start) + { + size_t pos = stream->bytes_left; + + if (!decode_extension(stream, tag, wire_type, &iter)) + return false; + + if (pos != stream->bytes_left) + { + /* The field was handled */ + continue; + } + } + } + + /* No match found, skip data */ + if (!pb_skip_field(stream, wire_type)) + return false; + continue; + } + + if (PB_HTYPE(iter.pos->type) == PB_HTYPE_REQUIRED + && iter.required_field_index < PB_MAX_REQUIRED_FIELDS) + { + uint32_t tmp = ((uint32_t)1 << (iter.required_field_index & 31)); + fields_seen[iter.required_field_index >> 5] |= tmp; + } + + if (!decode_field(stream, wire_type, &iter)) + return false; + } + + /* Check that all required fields were present. */ + { + /* First figure out the number of required fields by + * seeking to the end of the field array. Usually we + * are already close to end after decoding. + */ + unsigned req_field_count; + pb_type_t last_type; + unsigned i; + do { + req_field_count = iter.required_field_index; + last_type = iter.pos->type; + } while (pb_field_iter_next(&iter)); + + /* Fixup if last field was also required. */ + if (PB_HTYPE(last_type) == PB_HTYPE_REQUIRED && iter.pos->tag != 0) + req_field_count++; + + if (req_field_count > 0) + { + /* Check the whole words */ + for (i = 0; i < (req_field_count >> 5); i++) + { + if (fields_seen[i] != allbits) + PB_RETURN_ERROR(stream, "missing required field"); + } + + /* Check the remaining bits */ + if (fields_seen[req_field_count >> 5] != (allbits >> (32 - (req_field_count & 31)))) + PB_RETURN_ERROR(stream, "missing required field"); + } + } + + return true; +} + +bool checkreturn pb_decode(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct) +{ + bool status; + pb_message_set_to_defaults(fields, dest_struct); + status = pb_decode_noinit(stream, fields, dest_struct); + +#ifdef PB_ENABLE_MALLOC + if (!status) + pb_release(fields, dest_struct); +#endif + + return status; +} + +bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct) +{ + pb_istream_t substream; + bool status; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + status = pb_decode(&substream, fields, dest_struct); + + if (!pb_close_string_substream(stream, &substream)) + return false; + return status; +} + +#ifdef PB_ENABLE_MALLOC +/* Given an oneof field, if there has already been a field inside this oneof, + * release it before overwriting with a different one. */ +static bool pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *iter) +{ + pb_size_t old_tag = *(pb_size_t*)iter->pSize; /* Previous which_ value */ + pb_size_t new_tag = iter->pos->tag; /* New which_ value */ + + if (old_tag == 0) + return true; /* Ok, no old data in union */ + + if (old_tag == new_tag) + return true; /* Ok, old data is of same type => merge */ + + /* Release old data. The find can fail if the message struct contains + * invalid data. */ + if (!pb_field_iter_find(iter, old_tag)) + PB_RETURN_ERROR(stream, "invalid union tag"); + + pb_release_single_field(iter); + + /* Restore iterator to where it should be. + * This shouldn't fail unless the pb_field_t structure is corrupted. */ + if (!pb_field_iter_find(iter, new_tag)) + PB_RETURN_ERROR(stream, "iterator error"); + + return true; +} + +static void pb_release_single_field(const pb_field_iter_t *iter) +{ + pb_type_t type; + type = iter->pos->type; + + if (PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + if (*(pb_size_t*)iter->pSize != iter->pos->tag) + return; /* This is not the current field in the union */ + } + + /* Release anything contained inside an extension or submsg. + * This has to be done even if the submsg itself is statically + * allocated. */ + if (PB_LTYPE(type) == PB_LTYPE_EXTENSION) + { + /* Release fields from all extensions in the linked list */ + pb_extension_t *ext = *(pb_extension_t**)iter->pData; + while (ext != NULL) + { + pb_field_iter_t ext_iter; + iter_from_extension(&ext_iter, ext); + pb_release_single_field(&ext_iter); + ext = ext->next; + } + } + else if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE) + { + /* Release fields in submessage or submsg array */ + void *pItem = iter->pData; + pb_size_t count = 1; + + if (PB_ATYPE(type) == PB_ATYPE_POINTER) + { + pItem = *(void**)iter->pData; + } + + if (PB_HTYPE(type) == PB_HTYPE_REPEATED) + { + count = *(pb_size_t*)iter->pSize; + + if (PB_ATYPE(type) == PB_ATYPE_STATIC && count > iter->pos->array_size) + { + /* Protect against corrupted _count fields */ + count = iter->pos->array_size; + } + } + + if (pItem) + { + while (count--) + { + pb_release((const pb_field_t*)iter->pos->ptr, pItem); + pItem = (char*)pItem + iter->pos->data_size; + } + } + } + + if (PB_ATYPE(type) == PB_ATYPE_POINTER) + { + if (PB_HTYPE(type) == PB_HTYPE_REPEATED && + (PB_LTYPE(type) == PB_LTYPE_STRING || + PB_LTYPE(type) == PB_LTYPE_BYTES)) + { + /* Release entries in repeated string or bytes array */ + void **pItem = *(void***)iter->pData; + pb_size_t count = *(pb_size_t*)iter->pSize; + while (count--) + { + pb_free(*pItem); + *pItem++ = NULL; + } + } + + if (PB_HTYPE(type) == PB_HTYPE_REPEATED) + { + /* We are going to release the array, so set the size to 0 */ + *(pb_size_t*)iter->pSize = 0; + } + + /* Release main item */ + pb_free(*(void**)iter->pData); + *(void**)iter->pData = NULL; + } +} + +void pb_release(const pb_field_t fields[], void *dest_struct) +{ + pb_field_iter_t iter; + + if (!dest_struct) + return; /* Ignore NULL pointers, similar to free() */ + + if (!pb_field_iter_begin(&iter, fields, dest_struct)) + return; /* Empty message type */ + + do + { + pb_release_single_field(&iter); + } while (pb_field_iter_next(&iter)); +} +#endif + +/* Field decoders */ + +bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest) +{ + uint64_t value; + if (!pb_decode_varint(stream, &value)) + return false; + + if (value & 1) + *dest = (int64_t)(~(value >> 1)); + else + *dest = (int64_t)(value >> 1); + + return true; +} + +bool pb_decode_fixed32(pb_istream_t *stream, void *dest) +{ + pb_byte_t bytes[4]; + + if (!pb_read(stream, bytes, 4)) + return false; + + *(uint32_t*)dest = ((uint32_t)bytes[0] << 0) | + ((uint32_t)bytes[1] << 8) | + ((uint32_t)bytes[2] << 16) | + ((uint32_t)bytes[3] << 24); + return true; +} + +bool pb_decode_fixed64(pb_istream_t *stream, void *dest) +{ + pb_byte_t bytes[8]; + + if (!pb_read(stream, bytes, 8)) + return false; + + *(uint64_t*)dest = ((uint64_t)bytes[0] << 0) | + ((uint64_t)bytes[1] << 8) | + ((uint64_t)bytes[2] << 16) | + ((uint64_t)bytes[3] << 24) | + ((uint64_t)bytes[4] << 32) | + ((uint64_t)bytes[5] << 40) | + ((uint64_t)bytes[6] << 48) | + ((uint64_t)bytes[7] << 56); + + return true; +} + +static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint64_t value; + int64_t svalue; + int64_t clamped; + if (!pb_decode_varint(stream, &value)) + return false; + + /* See issue 97: Google's C++ protobuf allows negative varint values to + * be cast as int32_t, instead of the int64_t that should be used when + * encoding. Previous nanopb versions had a bug in encoding. In order to + * not break decoding of such messages, we cast <=32 bit fields to + * int32_t first to get the sign correct. + */ + if (field->data_size == sizeof(int64_t)) + svalue = (int64_t)value; + else + svalue = (int32_t)value; + + /* Cast to the proper field size, while checking for overflows */ + if (field->data_size == sizeof(int64_t)) + clamped = *(int64_t*)dest = svalue; + else if (field->data_size == sizeof(int32_t)) + clamped = *(int32_t*)dest = (int32_t)svalue; + else if (field->data_size == sizeof(int_least16_t)) + clamped = *(int_least16_t*)dest = (int_least16_t)svalue; + else if (field->data_size == sizeof(int_least8_t)) + clamped = *(int_least8_t*)dest = (int_least8_t)svalue; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + if (clamped != svalue) + PB_RETURN_ERROR(stream, "integer too large"); + + return true; +} + +static bool checkreturn pb_dec_uvarint(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint64_t value, clamped; + if (!pb_decode_varint(stream, &value)) + return false; + + /* Cast to the proper field size, while checking for overflows */ + if (field->data_size == sizeof(uint64_t)) + clamped = *(uint64_t*)dest = value; + else if (field->data_size == sizeof(uint32_t)) + clamped = *(uint32_t*)dest = (uint32_t)value; + else if (field->data_size == sizeof(uint_least16_t)) + clamped = *(uint_least16_t*)dest = (uint_least16_t)value; + else if (field->data_size == sizeof(uint_least8_t)) + clamped = *(uint_least8_t*)dest = (uint_least8_t)value; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + if (clamped != value) + PB_RETURN_ERROR(stream, "integer too large"); + + return true; +} + +static bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + int64_t value, clamped; + if (!pb_decode_svarint(stream, &value)) + return false; + + /* Cast to the proper field size, while checking for overflows */ + if (field->data_size == sizeof(int64_t)) + clamped = *(int64_t*)dest = value; + else if (field->data_size == sizeof(int32_t)) + clamped = *(int32_t*)dest = (int32_t)value; + else if (field->data_size == sizeof(int_least16_t)) + clamped = *(int_least16_t*)dest = (int_least16_t)value; + else if (field->data_size == sizeof(int_least8_t)) + clamped = *(int_least8_t*)dest = (int_least8_t)value; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + if (clamped != value) + PB_RETURN_ERROR(stream, "integer too large"); + + return true; +} + +static bool checkreturn pb_dec_fixed32(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + PB_UNUSED(field); + return pb_decode_fixed32(stream, dest); +} + +static bool checkreturn pb_dec_fixed64(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + PB_UNUSED(field); + return pb_decode_fixed64(stream, dest); +} + +static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint32_t size; + size_t alloc_size; + pb_bytes_array_t *bdest; + + if (!pb_decode_varint32(stream, &size)) + return false; + + if (size > PB_SIZE_MAX) + PB_RETURN_ERROR(stream, "bytes overflow"); + + alloc_size = PB_BYTES_ARRAY_T_ALLOCSIZE(size); + if (size > alloc_size) + PB_RETURN_ERROR(stream, "size too large"); + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { +#ifndef PB_ENABLE_MALLOC + PB_RETURN_ERROR(stream, "no malloc support"); +#else + if (!allocate_field(stream, dest, alloc_size, 1)) + return false; + bdest = *(pb_bytes_array_t**)dest; +#endif + } + else + { + if (alloc_size > field->data_size) + PB_RETURN_ERROR(stream, "bytes overflow"); + bdest = (pb_bytes_array_t*)dest; + } + + bdest->size = (pb_size_t)size; + return pb_read(stream, bdest->bytes, size); +} + +static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint32_t size; + size_t alloc_size; + bool status; + if (!pb_decode_varint32(stream, &size)) + return false; + + /* Space for null terminator */ + alloc_size = size + 1; + + if (alloc_size < size) + PB_RETURN_ERROR(stream, "size too large"); + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { +#ifndef PB_ENABLE_MALLOC + PB_RETURN_ERROR(stream, "no malloc support"); +#else + if (!allocate_field(stream, dest, alloc_size, 1)) + return false; + dest = *(void**)dest; +#endif + } + else + { + if (alloc_size > field->data_size) + PB_RETURN_ERROR(stream, "string overflow"); + } + + status = pb_read(stream, (pb_byte_t*)dest, size); + *((pb_byte_t*)dest + size) = 0; + return status; +} + +static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + bool status; + pb_istream_t substream; + const pb_field_t* submsg_fields = (const pb_field_t*)field->ptr; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + if (field->ptr == NULL) + PB_RETURN_ERROR(stream, "invalid field descriptor"); + + /* New array entries need to be initialized, while required and optional + * submessages have already been initialized in the top-level pb_decode. */ + if (PB_HTYPE(field->type) == PB_HTYPE_REPEATED) + status = pb_decode(&substream, submsg_fields, dest); + else + status = pb_decode_noinit(&substream, submsg_fields, dest); + + if (!pb_close_string_substream(stream, &substream)) + return false; + return status; +} + +static bool checkreturn pb_dec_fixed_length_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint32_t size; + + if (!pb_decode_varint32(stream, &size)) + return false; + + if (size > PB_SIZE_MAX) + PB_RETURN_ERROR(stream, "bytes overflow"); + + if (size == 0) + { + /* As a special case, treat empty bytes string as all zeros for fixed_length_bytes. */ + memset(dest, 0, field->data_size); + return true; + } + + if (size != field->data_size) + PB_RETURN_ERROR(stream, "incorrect fixed length bytes size"); + + return pb_read(stream, (pb_byte_t*)dest, field->data_size); +} diff --git a/Verdnaturaventas/Pods/nanopb/pb_decode.h b/Verdnaturaventas/Pods/nanopb/pb_decode.h new file mode 100644 index 0000000..a426bdd --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb_decode.h @@ -0,0 +1,153 @@ +/* pb_decode.h: Functions to decode protocol buffers. Depends on pb_decode.c. + * The main function is pb_decode. You also need an input stream, and the + * field descriptions created by nanopb_generator.py. + */ + +#ifndef PB_DECODE_H_INCLUDED +#define PB_DECODE_H_INCLUDED + +#include "pb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Structure for defining custom input streams. You will need to provide + * a callback function to read the bytes from your storage, which can be + * for example a file or a network socket. + * + * The callback must conform to these rules: + * + * 1) Return false on IO errors. This will cause decoding to abort. + * 2) You can use state to store your own data (e.g. buffer pointer), + * and rely on pb_read to verify that no-body reads past bytes_left. + * 3) Your callback may be used with substreams, in which case bytes_left + * is different than from the main stream. Don't use bytes_left to compute + * any pointers. + */ +struct pb_istream_s +{ +#ifdef PB_BUFFER_ONLY + /* Callback pointer is not used in buffer-only configuration. + * Having an int pointer here allows binary compatibility but + * gives an error if someone tries to assign callback function. + */ + int *callback; +#else + bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count); +#endif + + void *state; /* Free field for use by callback implementation */ + size_t bytes_left; + +#ifndef PB_NO_ERRMSG + const char *errmsg; +#endif +}; + +/*************************** + * Main decoding functions * + ***************************/ + +/* Decode a single protocol buffers message from input stream into a C structure. + * Returns true on success, false on any failure. + * The actual struct pointed to by dest must match the description in fields. + * Callback fields of the destination structure must be initialized by caller. + * All other fields will be initialized by this function. + * + * Example usage: + * MyMessage msg = {}; + * uint8_t buffer[64]; + * pb_istream_t stream; + * + * // ... read some data into buffer ... + * + * stream = pb_istream_from_buffer(buffer, count); + * pb_decode(&stream, MyMessage_fields, &msg); + */ +bool pb_decode(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + +/* Same as pb_decode, except does not initialize the destination structure + * to default values. This is slightly faster if you need no default values + * and just do memset(struct, 0, sizeof(struct)) yourself. + * + * This can also be used for 'merging' two messages, i.e. update only the + * fields that exist in the new message. + * + * Note: If this function returns with an error, it will not release any + * dynamically allocated fields. You will need to call pb_release() yourself. + */ +bool pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + +/* Same as pb_decode, except expects the stream to start with the message size + * encoded as varint. Corresponds to parseDelimitedFrom() in Google's + * protobuf API. + */ +bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + +#ifdef PB_ENABLE_MALLOC +/* Release any allocated pointer fields. If you use dynamic allocation, you should + * call this for any successfully decoded message when you are done with it. If + * pb_decode() returns with an error, the message is already released. + */ +void pb_release(const pb_field_t fields[], void *dest_struct); +#endif + + +/************************************** + * Functions for manipulating streams * + **************************************/ + +/* Create an input stream for reading from a memory buffer. + * + * Alternatively, you can use a custom stream that reads directly from e.g. + * a file or a network socket. + */ +pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t bufsize); + +/* Function to read from a pb_istream_t. You can use this if you need to + * read some custom header data, or to read data in field callbacks. + */ +bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count); + + +/************************************************ + * Helper functions for writing field callbacks * + ************************************************/ + +/* Decode the tag for the next field in the stream. Gives the wire type and + * field tag. At end of the message, returns false and sets eof to true. */ +bool pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof); + +/* Skip the field payload data, given the wire type. */ +bool pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type); + +/* Decode an integer in the varint format. This works for bool, enum, int32, + * int64, uint32 and uint64 field types. */ +bool pb_decode_varint(pb_istream_t *stream, uint64_t *dest); + +/* Decode an integer in the varint format. This works for bool, enum, int32, + * and uint32 field types. */ +bool pb_decode_varint32(pb_istream_t *stream, uint32_t *dest); + +/* Decode an integer in the zig-zagged svarint format. This works for sint32 + * and sint64. */ +bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest); + +/* Decode a fixed32, sfixed32 or float value. You need to pass a pointer to + * a 4-byte wide C variable. */ +bool pb_decode_fixed32(pb_istream_t *stream, void *dest); + +/* Decode a fixed64, sfixed64 or double value. You need to pass a pointer to + * a 8-byte wide C variable. */ +bool pb_decode_fixed64(pb_istream_t *stream, void *dest); + +/* Make a limited-length substream for reading a PB_WT_STRING field. */ +bool pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream); +bool pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/Verdnaturaventas/Pods/nanopb/pb_encode.c b/Verdnaturaventas/Pods/nanopb/pb_encode.c new file mode 100644 index 0000000..30f60d8 --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb_encode.c @@ -0,0 +1,777 @@ +/* pb_encode.c -- encode a protobuf using minimal resources + * + * 2011 Petteri Aimonen + */ + +#include "pb.h" +#include "pb_encode.h" +#include "pb_common.h" + +/* Use the GCC warn_unused_result attribute to check that all return values + * are propagated correctly. On other compilers and gcc before 3.4.0 just + * ignore the annotation. + */ +#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) + #define checkreturn +#else + #define checkreturn __attribute__((warn_unused_result)) +#endif + +/************************************** + * Declarations internal to this file * + **************************************/ +typedef bool (*pb_encoder_t)(pb_ostream_t *stream, const pb_field_t *field, const void *src) checkreturn; + +static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); +static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, const void *pData, size_t count, pb_encoder_t func); +static bool checkreturn encode_field(pb_ostream_t *stream, const pb_field_t *field, const void *pData); +static bool checkreturn default_extension_encoder(pb_ostream_t *stream, const pb_extension_t *extension); +static bool checkreturn encode_extension_field(pb_ostream_t *stream, const pb_field_t *field, const void *pData); +static void *pb_const_cast(const void *p); +static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_submessage(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_fixed_length_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src); + +/* --- Function pointers to field encoders --- + * Order in the array must match pb_action_t LTYPE numbering. + */ +static const pb_encoder_t PB_ENCODERS[PB_LTYPES_COUNT] = { + &pb_enc_varint, + &pb_enc_uvarint, + &pb_enc_svarint, + &pb_enc_fixed32, + &pb_enc_fixed64, + + &pb_enc_bytes, + &pb_enc_string, + &pb_enc_submessage, + NULL, /* extensions */ + &pb_enc_fixed_length_bytes +}; + +/******************************* + * pb_ostream_t implementation * + *******************************/ + +static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) +{ + size_t i; + pb_byte_t *dest = (pb_byte_t*)stream->state; + stream->state = dest + count; + + for (i = 0; i < count; i++) + dest[i] = buf[i]; + + return true; +} + +pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize) +{ + pb_ostream_t stream; +#ifdef PB_BUFFER_ONLY + stream.callback = (void*)1; /* Just a marker value */ +#else + stream.callback = &buf_write; +#endif + stream.state = buf; + stream.max_size = bufsize; + stream.bytes_written = 0; +#ifndef PB_NO_ERRMSG + stream.errmsg = NULL; +#endif + return stream; +} + +bool checkreturn pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) +{ + if (stream->callback != NULL) + { + if (stream->bytes_written + count > stream->max_size) + PB_RETURN_ERROR(stream, "stream full"); + +#ifdef PB_BUFFER_ONLY + if (!buf_write(stream, buf, count)) + PB_RETURN_ERROR(stream, "io error"); +#else + if (!stream->callback(stream, buf, count)) + PB_RETURN_ERROR(stream, "io error"); +#endif + } + + stream->bytes_written += count; + return true; +} + +/************************* + * Encode a single field * + *************************/ + +/* Encode a static array. Handles the size calculations and possible packing. */ +static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, + const void *pData, size_t count, pb_encoder_t func) +{ + size_t i; + const void *p; + size_t size; + + if (count == 0) + return true; + + if (PB_ATYPE(field->type) != PB_ATYPE_POINTER && count > field->array_size) + PB_RETURN_ERROR(stream, "array max size exceeded"); + + /* We always pack arrays if the datatype allows it. */ + if (PB_LTYPE(field->type) <= PB_LTYPE_LAST_PACKABLE) + { + if (!pb_encode_tag(stream, PB_WT_STRING, field->tag)) + return false; + + /* Determine the total size of packed array. */ + if (PB_LTYPE(field->type) == PB_LTYPE_FIXED32) + { + size = 4 * count; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_FIXED64) + { + size = 8 * count; + } + else + { + pb_ostream_t sizestream = PB_OSTREAM_SIZING; + p = pData; + for (i = 0; i < count; i++) + { + if (!func(&sizestream, field, p)) + return false; + p = (const char*)p + field->data_size; + } + size = sizestream.bytes_written; + } + + if (!pb_encode_varint(stream, (uint64_t)size)) + return false; + + if (stream->callback == NULL) + return pb_write(stream, NULL, size); /* Just sizing.. */ + + /* Write the data */ + p = pData; + for (i = 0; i < count; i++) + { + if (!func(stream, field, p)) + return false; + p = (const char*)p + field->data_size; + } + } + else + { + p = pData; + for (i = 0; i < count; i++) + { + if (!pb_encode_tag_for_field(stream, field)) + return false; + + /* Normally the data is stored directly in the array entries, but + * for pointer-type string and bytes fields, the array entries are + * actually pointers themselves also. So we have to dereference once + * more to get to the actual data. */ + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER && + (PB_LTYPE(field->type) == PB_LTYPE_STRING || + PB_LTYPE(field->type) == PB_LTYPE_BYTES)) + { + if (!func(stream, field, *(const void* const*)p)) + return false; + } + else + { + if (!func(stream, field, p)) + return false; + } + p = (const char*)p + field->data_size; + } + } + + return true; +} + +/* In proto3, all fields are optional and are only encoded if their value is "non-zero". + * This function implements the check for the zero value. */ +static bool pb_check_proto3_default_value(const pb_field_t *field, const void *pData) +{ + if (PB_ATYPE(field->type) == PB_ATYPE_STATIC) + { + if (PB_LTYPE(field->type) == PB_LTYPE_BYTES) + { + const pb_bytes_array_t *bytes = (const pb_bytes_array_t*)pData; + return bytes->size == 0; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_STRING) + { + return *(const char*)pData == '\0'; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_FIXED_LENGTH_BYTES) + { + /* Fixed length bytes is only empty if its length is fixed + * as 0. Which would be pretty strange, but we can check + * it anyway. */ + return field->data_size == 0; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_SUBMESSAGE) + { + /* Check all fields in the submessage to find if any of them + * are non-zero. The comparison cannot be done byte-per-byte + * because the C struct may contain padding bytes that must + * be skipped. + */ + pb_field_iter_t iter; + if (pb_field_iter_begin(&iter, (const pb_field_t*)field->ptr, pb_const_cast(pData))) + { + do + { + if (!pb_check_proto3_default_value(iter.pos, iter.pData)) + { + return false; + } + } while (pb_field_iter_next(&iter)); + } + return true; + } + } + + { + /* Catch-all branch that does byte-per-byte comparison for zero value. + * + * This is for all pointer fields, and for static PB_LTYPE_VARINT, + * UVARINT, SVARINT, FIXED32, FIXED64, EXTENSION fields, and also + * callback fields. These all have integer or pointer value which + * can be compared with 0. + */ + pb_size_t i; + const char *p = (const char*)pData; + for (i = 0; i < field->data_size; i++) + { + if (p[i] != 0) + { + return false; + } + } + + return true; + } +} + +/* Encode a field with static or pointer allocation, i.e. one whose data + * is available to the encoder directly. */ +static bool checkreturn encode_basic_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + pb_encoder_t func; + bool implicit_has; + const void *pSize = &implicit_has; + + func = PB_ENCODERS[PB_LTYPE(field->type)]; + + if (field->size_offset) + { + /* Static optional, repeated or oneof field */ + pSize = (const char*)pData + field->size_offset; + } + else if (PB_HTYPE(field->type) == PB_HTYPE_OPTIONAL) + { + /* Proto3 style field, optional but without explicit has_ field. */ + implicit_has = !pb_check_proto3_default_value(field, pData); + } + else + { + /* Required field, always present */ + implicit_has = true; + } + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { + /* pData is a pointer to the field, which contains pointer to + * the data. If the 2nd pointer is NULL, it is interpreted as if + * the has_field was false. + */ + pData = *(const void* const*)pData; + implicit_has = (pData != NULL); + } + + switch (PB_HTYPE(field->type)) + { + case PB_HTYPE_REQUIRED: + if (!pData) + PB_RETURN_ERROR(stream, "missing required field"); + if (!pb_encode_tag_for_field(stream, field)) + return false; + if (!func(stream, field, pData)) + return false; + break; + + case PB_HTYPE_OPTIONAL: + if (*(const bool*)pSize) + { + if (!pb_encode_tag_for_field(stream, field)) + return false; + + if (!func(stream, field, pData)) + return false; + } + break; + + case PB_HTYPE_REPEATED: + if (!encode_array(stream, field, pData, *(const pb_size_t*)pSize, func)) + return false; + break; + + case PB_HTYPE_ONEOF: + if (*(const pb_size_t*)pSize == field->tag) + { + if (!pb_encode_tag_for_field(stream, field)) + return false; + + if (!func(stream, field, pData)) + return false; + } + break; + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } + + return true; +} + +/* Encode a field with callback semantics. This means that a user function is + * called to provide and encode the actual data. */ +static bool checkreturn encode_callback_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + const pb_callback_t *callback = (const pb_callback_t*)pData; + +#ifdef PB_OLD_CALLBACK_STYLE + const void *arg = callback->arg; +#else + void * const *arg = &(callback->arg); +#endif + + if (callback->funcs.encode != NULL) + { + if (!callback->funcs.encode(stream, field, arg)) + PB_RETURN_ERROR(stream, "callback error"); + } + return true; +} + +/* Encode a single field of any callback or static type. */ +static bool checkreturn encode_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + switch (PB_ATYPE(field->type)) + { + case PB_ATYPE_STATIC: + case PB_ATYPE_POINTER: + return encode_basic_field(stream, field, pData); + + case PB_ATYPE_CALLBACK: + return encode_callback_field(stream, field, pData); + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +} + +/* Default handler for extension fields. Expects to have a pb_field_t + * pointer in the extension->type->arg field. */ +static bool checkreturn default_extension_encoder(pb_ostream_t *stream, + const pb_extension_t *extension) +{ + const pb_field_t *field = (const pb_field_t*)extension->type->arg; + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { + /* For pointer extensions, the pointer is stored directly + * in the extension structure. This avoids having an extra + * indirection. */ + return encode_field(stream, field, &extension->dest); + } + else + { + return encode_field(stream, field, extension->dest); + } +} + +/* Walk through all the registered extensions and give them a chance + * to encode themselves. */ +static bool checkreturn encode_extension_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + const pb_extension_t *extension = *(const pb_extension_t* const *)pData; + PB_UNUSED(field); + + while (extension) + { + bool status; + if (extension->type->encode) + status = extension->type->encode(stream, extension); + else + status = default_extension_encoder(stream, extension); + + if (!status) + return false; + + extension = extension->next; + } + + return true; +} + +/********************* + * Encode all fields * + *********************/ + +static void *pb_const_cast(const void *p) +{ + /* Note: this casts away const, in order to use the common field iterator + * logic for both encoding and decoding. */ + union { + void *p1; + const void *p2; + } t; + t.p2 = p; + return t.p1; +} + +bool checkreturn pb_encode(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct) +{ + pb_field_iter_t iter; + if (!pb_field_iter_begin(&iter, fields, pb_const_cast(src_struct))) + return true; /* Empty message type */ + + do { + if (PB_LTYPE(iter.pos->type) == PB_LTYPE_EXTENSION) + { + /* Special case for the extension field placeholder */ + if (!encode_extension_field(stream, iter.pos, iter.pData)) + return false; + } + else + { + /* Regular field */ + if (!encode_field(stream, iter.pos, iter.pData)) + return false; + } + } while (pb_field_iter_next(&iter)); + + return true; +} + +bool pb_encode_delimited(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct) +{ + return pb_encode_submessage(stream, fields, src_struct); +} + +bool pb_get_encoded_size(size_t *size, const pb_field_t fields[], const void *src_struct) +{ + pb_ostream_t stream = PB_OSTREAM_SIZING; + + if (!pb_encode(&stream, fields, src_struct)) + return false; + + *size = stream.bytes_written; + return true; +} + +/******************** + * Helper functions * + ********************/ +bool checkreturn pb_encode_varint(pb_ostream_t *stream, uint64_t value) +{ + pb_byte_t buffer[10]; + size_t i = 0; + + if (value <= 0x7F) + { + pb_byte_t v = (pb_byte_t)value; + return pb_write(stream, &v, 1); + } + + while (value) + { + buffer[i] = (pb_byte_t)((value & 0x7F) | 0x80); + value >>= 7; + i++; + } + buffer[i-1] &= 0x7F; /* Unset top bit on last byte */ + + return pb_write(stream, buffer, i); +} + +bool checkreturn pb_encode_svarint(pb_ostream_t *stream, int64_t value) +{ + uint64_t zigzagged; + if (value < 0) + zigzagged = ~((uint64_t)value << 1); + else + zigzagged = (uint64_t)value << 1; + + return pb_encode_varint(stream, zigzagged); +} + +bool checkreturn pb_encode_fixed32(pb_ostream_t *stream, const void *value) +{ + uint32_t val = *(const uint32_t*)value; + pb_byte_t bytes[4]; + bytes[0] = (pb_byte_t)(val & 0xFF); + bytes[1] = (pb_byte_t)((val >> 8) & 0xFF); + bytes[2] = (pb_byte_t)((val >> 16) & 0xFF); + bytes[3] = (pb_byte_t)((val >> 24) & 0xFF); + return pb_write(stream, bytes, 4); +} + +bool checkreturn pb_encode_fixed64(pb_ostream_t *stream, const void *value) +{ + uint64_t val = *(const uint64_t*)value; + pb_byte_t bytes[8]; + bytes[0] = (pb_byte_t)(val & 0xFF); + bytes[1] = (pb_byte_t)((val >> 8) & 0xFF); + bytes[2] = (pb_byte_t)((val >> 16) & 0xFF); + bytes[3] = (pb_byte_t)((val >> 24) & 0xFF); + bytes[4] = (pb_byte_t)((val >> 32) & 0xFF); + bytes[5] = (pb_byte_t)((val >> 40) & 0xFF); + bytes[6] = (pb_byte_t)((val >> 48) & 0xFF); + bytes[7] = (pb_byte_t)((val >> 56) & 0xFF); + return pb_write(stream, bytes, 8); +} + +bool checkreturn pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number) +{ + uint64_t tag = ((uint64_t)field_number << 3) | wiretype; + return pb_encode_varint(stream, tag); +} + +bool checkreturn pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field) +{ + pb_wire_type_t wiretype; + switch (PB_LTYPE(field->type)) + { + case PB_LTYPE_VARINT: + case PB_LTYPE_UVARINT: + case PB_LTYPE_SVARINT: + wiretype = PB_WT_VARINT; + break; + + case PB_LTYPE_FIXED32: + wiretype = PB_WT_32BIT; + break; + + case PB_LTYPE_FIXED64: + wiretype = PB_WT_64BIT; + break; + + case PB_LTYPE_BYTES: + case PB_LTYPE_STRING: + case PB_LTYPE_SUBMESSAGE: + case PB_LTYPE_FIXED_LENGTH_BYTES: + wiretype = PB_WT_STRING; + break; + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } + + return pb_encode_tag(stream, wiretype, field->tag); +} + +bool checkreturn pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size) +{ + if (!pb_encode_varint(stream, (uint64_t)size)) + return false; + + return pb_write(stream, buffer, size); +} + +bool checkreturn pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct) +{ + /* First calculate the message size using a non-writing substream. */ + pb_ostream_t substream = PB_OSTREAM_SIZING; + size_t size; + bool status; + + if (!pb_encode(&substream, fields, src_struct)) + { +#ifndef PB_NO_ERRMSG + stream->errmsg = substream.errmsg; +#endif + return false; + } + + size = substream.bytes_written; + + if (!pb_encode_varint(stream, (uint64_t)size)) + return false; + + if (stream->callback == NULL) + return pb_write(stream, NULL, size); /* Just sizing */ + + if (stream->bytes_written + size > stream->max_size) + PB_RETURN_ERROR(stream, "stream full"); + + /* Use a substream to verify that a callback doesn't write more than + * what it did the first time. */ + substream.callback = stream->callback; + substream.state = stream->state; + substream.max_size = size; + substream.bytes_written = 0; +#ifndef PB_NO_ERRMSG + substream.errmsg = NULL; +#endif + + status = pb_encode(&substream, fields, src_struct); + + stream->bytes_written += substream.bytes_written; + stream->state = substream.state; +#ifndef PB_NO_ERRMSG + stream->errmsg = substream.errmsg; +#endif + + if (substream.bytes_written != size) + PB_RETURN_ERROR(stream, "submsg size changed"); + + return status; +} + +/* Field encoders */ + +static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + int64_t value = 0; + + if (field->data_size == sizeof(int_least8_t)) + value = *(const int_least8_t*)src; + else if (field->data_size == sizeof(int_least16_t)) + value = *(const int_least16_t*)src; + else if (field->data_size == sizeof(int32_t)) + value = *(const int32_t*)src; + else if (field->data_size == sizeof(int64_t)) + value = *(const int64_t*)src; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + return pb_encode_varint(stream, (uint64_t)value); +} + +static bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + uint64_t value = 0; + + if (field->data_size == sizeof(uint_least8_t)) + value = *(const uint_least8_t*)src; + else if (field->data_size == sizeof(uint_least16_t)) + value = *(const uint_least16_t*)src; + else if (field->data_size == sizeof(uint32_t)) + value = *(const uint32_t*)src; + else if (field->data_size == sizeof(uint64_t)) + value = *(const uint64_t*)src; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + return pb_encode_varint(stream, value); +} + +static bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + int64_t value = 0; + + if (field->data_size == sizeof(int_least8_t)) + value = *(const int_least8_t*)src; + else if (field->data_size == sizeof(int_least16_t)) + value = *(const int_least16_t*)src; + else if (field->data_size == sizeof(int32_t)) + value = *(const int32_t*)src; + else if (field->data_size == sizeof(int64_t)) + value = *(const int64_t*)src; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + return pb_encode_svarint(stream, value); +} + +static bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + PB_UNUSED(field); + return pb_encode_fixed64(stream, src); +} + +static bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + PB_UNUSED(field); + return pb_encode_fixed32(stream, src); +} + +static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + const pb_bytes_array_t *bytes = NULL; + + bytes = (const pb_bytes_array_t*)src; + + if (src == NULL) + { + /* Treat null pointer as an empty bytes field */ + return pb_encode_string(stream, NULL, 0); + } + + if (PB_ATYPE(field->type) == PB_ATYPE_STATIC && + PB_BYTES_ARRAY_T_ALLOCSIZE(bytes->size) > field->data_size) + { + PB_RETURN_ERROR(stream, "bytes size exceeded"); + } + + return pb_encode_string(stream, bytes->bytes, bytes->size); +} + +static bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + size_t size = 0; + size_t max_size = field->data_size; + const char *p = (const char*)src; + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + max_size = (size_t)-1; + + if (src == NULL) + { + size = 0; /* Treat null pointer as an empty string */ + } + else + { + /* strnlen() is not always available, so just use a loop */ + while (size < max_size && *p != '\0') + { + size++; + p++; + } + } + + return pb_encode_string(stream, (const pb_byte_t*)src, size); +} + +static bool checkreturn pb_enc_submessage(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + if (field->ptr == NULL) + PB_RETURN_ERROR(stream, "invalid field descriptor"); + + return pb_encode_submessage(stream, (const pb_field_t*)field->ptr, src); +} + +static bool checkreturn pb_enc_fixed_length_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + return pb_encode_string(stream, (const pb_byte_t*)src, field->data_size); +} + diff --git a/Verdnaturaventas/Pods/nanopb/pb_encode.h b/Verdnaturaventas/Pods/nanopb/pb_encode.h new file mode 100644 index 0000000..d9909fb --- /dev/null +++ b/Verdnaturaventas/Pods/nanopb/pb_encode.h @@ -0,0 +1,154 @@ +/* pb_encode.h: Functions to encode protocol buffers. Depends on pb_encode.c. + * The main function is pb_encode. You also need an output stream, and the + * field descriptions created by nanopb_generator.py. + */ + +#ifndef PB_ENCODE_H_INCLUDED +#define PB_ENCODE_H_INCLUDED + +#include "pb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Structure for defining custom output streams. You will need to provide + * a callback function to write the bytes to your storage, which can be + * for example a file or a network socket. + * + * The callback must conform to these rules: + * + * 1) Return false on IO errors. This will cause encoding to abort. + * 2) You can use state to store your own data (e.g. buffer pointer). + * 3) pb_write will update bytes_written after your callback runs. + * 4) Substreams will modify max_size and bytes_written. Don't use them + * to calculate any pointers. + */ +struct pb_ostream_s +{ +#ifdef PB_BUFFER_ONLY + /* Callback pointer is not used in buffer-only configuration. + * Having an int pointer here allows binary compatibility but + * gives an error if someone tries to assign callback function. + * Also, NULL pointer marks a 'sizing stream' that does not + * write anything. + */ + int *callback; +#else + bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); +#endif + void *state; /* Free field for use by callback implementation. */ + size_t max_size; /* Limit number of output bytes written (or use SIZE_MAX). */ + size_t bytes_written; /* Number of bytes written so far. */ + +#ifndef PB_NO_ERRMSG + const char *errmsg; +#endif +}; + +/*************************** + * Main encoding functions * + ***************************/ + +/* Encode a single protocol buffers message from C structure into a stream. + * Returns true on success, false on any failure. + * The actual struct pointed to by src_struct must match the description in fields. + * All required fields in the struct are assumed to have been filled in. + * + * Example usage: + * MyMessage msg = {}; + * uint8_t buffer[64]; + * pb_ostream_t stream; + * + * msg.field1 = 42; + * stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); + * pb_encode(&stream, MyMessage_fields, &msg); + */ +bool pb_encode(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); + +/* Same as pb_encode, but prepends the length of the message as a varint. + * Corresponds to writeDelimitedTo() in Google's protobuf API. + */ +bool pb_encode_delimited(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); + +/* Encode the message to get the size of the encoded data, but do not store + * the data. */ +bool pb_get_encoded_size(size_t *size, const pb_field_t fields[], const void *src_struct); + +/************************************** + * Functions for manipulating streams * + **************************************/ + +/* Create an output stream for writing into a memory buffer. + * The number of bytes written can be found in stream.bytes_written after + * encoding the message. + * + * Alternatively, you can use a custom stream that writes directly to e.g. + * a file or a network socket. + */ +pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize); + +/* Pseudo-stream for measuring the size of a message without actually storing + * the encoded data. + * + * Example usage: + * MyMessage msg = {}; + * pb_ostream_t stream = PB_OSTREAM_SIZING; + * pb_encode(&stream, MyMessage_fields, &msg); + * printf("Message size is %d\n", stream.bytes_written); + */ +#ifndef PB_NO_ERRMSG +#define PB_OSTREAM_SIZING {0,0,0,0,0} +#else +#define PB_OSTREAM_SIZING {0,0,0,0} +#endif + +/* Function to write into a pb_ostream_t stream. You can use this if you need + * to append or prepend some custom headers to the message. + */ +bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); + + +/************************************************ + * Helper functions for writing field callbacks * + ************************************************/ + +/* Encode field header based on type and field number defined in the field + * structure. Call this from the callback before writing out field contents. */ +bool pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field); + +/* Encode field header by manually specifing wire type. You need to use this + * if you want to write out packed arrays from a callback field. */ +bool pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number); + +/* Encode an integer in the varint format. + * This works for bool, enum, int32, int64, uint32 and uint64 field types. */ +bool pb_encode_varint(pb_ostream_t *stream, uint64_t value); + +/* Encode an integer in the zig-zagged svarint format. + * This works for sint32 and sint64. */ +bool pb_encode_svarint(pb_ostream_t *stream, int64_t value); + +/* Encode a string or bytes type field. For strings, pass strlen(s) as size. */ +bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size); + +/* Encode a fixed32, sfixed32 or float value. + * You need to pass a pointer to a 4-byte wide C variable. */ +bool pb_encode_fixed32(pb_ostream_t *stream, const void *value); + +/* Encode a fixed64, sfixed64 or double value. + * You need to pass a pointer to a 8-byte wide C variable. */ +bool pb_encode_fixed64(pb_ostream_t *stream, const void *value); + +/* Encode a submessage field. + * You need to pass the pb_field_t array and pointer to struct, just like + * with pb_encode(). This internally encodes the submessage twice, first to + * calculate message size and then to actually write it out. + */ +bool pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/Verdnaturaventas/Verdnaturaventas.xcodeproj/project.pbxproj b/Verdnaturaventas/Verdnaturaventas.xcodeproj/project.pbxproj index 6677213..9b7d427 100644 --- a/Verdnaturaventas/Verdnaturaventas.xcodeproj/project.pbxproj +++ b/Verdnaturaventas/Verdnaturaventas.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 2E0D74F00A1BCC22C5D7FD31 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D88084E26A228A358E419BD7 /* Pods.framework */; }; + 0A45919266B590CD2DD35235 /* Pods_Verdnaturaventas.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B647C6A9CB3F3C82972443BF /* Pods_Verdnaturaventas.framework */; }; A60259091C5901EB00A7695F /* CeldaArticulo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A60259081C5901EB00A7695F /* CeldaArticulo.swift */; }; A603401F1C3FE07100BDF2ED /* Login-01.jpg in Resources */ = {isa = PBXBuildFile; fileRef = A603401D1C3FE07100BDF2ED /* Login-01.jpg */; }; A60340201C3FE07100BDF2ED /* Login.png in Resources */ = {isa = PBXBuildFile; fileRef = A603401E1C3FE07100BDF2ED /* Login.png */; }; @@ -227,6 +227,7 @@ A6F5815A1C6B76BA0003D27F /* CmdCrearOrder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6F581591C6B76BA0003D27F /* CmdCrearOrder.swift */; }; EB6BE2B720D118AC00DB6694 /* CmdEliminarPendiente.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6BE2B620D118AC00DB6694 /* CmdEliminarPendiente.swift */; }; EB6BE2BA20D11B9100DB6694 /* ParserPending.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6BE2B920D11B9100DB6694 /* ParserPending.swift */; }; + EBE7D37920E20A5600A9DC0A /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = EBE7D37720E20A5500A9DC0A /* GoogleService-Info.plist */; }; EBF69B4A20CE82490015D1D8 /* Roboto-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EBF69B4920CE82440015D1D8 /* Roboto-Light.ttf */; }; EBF69B4C20CE82530015D1D8 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EBF69B4B20CE824F0015D1D8 /* Roboto-Bold.ttf */; }; EBF69B4E20CE82620015D1D8 /* Roboto-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EBF69B4D20CE825D0015D1D8 /* Roboto-Regular.ttf */; }; @@ -293,8 +294,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 7E3B7176697597B33B41997D /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - 99526864B48B202434FA66B1 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 4AEE336D24F6131EBB40CD26 /* Pods-Verdnaturaventas.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Verdnaturaventas.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.debug.xcconfig"; sourceTree = ""; }; + 65C3D40422DD9517BCA79409 /* Pods-Verdnaturaventas.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Verdnaturaventas.release.xcconfig"; path = "Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas.release.xcconfig"; sourceTree = ""; }; A60259081C5901EB00A7695F /* CeldaArticulo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CeldaArticulo.swift; path = Celdas/CeldaArticulo.swift; sourceTree = ""; }; A603401D1C3FE07100BDF2ED /* Login-01.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = "Login-01.jpg"; path = "Images/Login-01.jpg"; sourceTree = ""; }; A603401E1C3FE07100BDF2ED /* Login.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Login.png; path = Images/Login.png; sourceTree = ""; }; @@ -519,9 +520,11 @@ A6F581551C6B50AE0003D27F /* CeldaPrecios.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CeldaPrecios.swift; path = Celdas/CeldaPrecios.swift; sourceTree = ""; }; A6F581571C6B6AF50003D27F /* DatosCompra.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DatosCompra.swift; path = Model/DatosCompra.swift; sourceTree = ""; }; A6F581591C6B76BA0003D27F /* CmdCrearOrder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CmdCrearOrder.swift; path = Command/CmdCrearOrder.swift; sourceTree = ""; }; + B647C6A9CB3F3C82972443BF /* Pods_Verdnaturaventas.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Verdnaturaventas.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D88084E26A228A358E419BD7 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EB6BE2B620D118AC00DB6694 /* CmdEliminarPendiente.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CmdEliminarPendiente.swift; sourceTree = ""; }; EB6BE2B920D11B9100DB6694 /* ParserPending.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParserPending.swift; sourceTree = ""; }; + EBE7D37720E20A5500A9DC0A /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; EBF69B4920CE82440015D1D8 /* Roboto-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Light.ttf"; sourceTree = ""; }; EBF69B4B20CE824F0015D1D8 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Bold.ttf"; sourceTree = ""; }; EBF69B4D20CE825D0015D1D8 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Regular.ttf"; sourceTree = ""; }; @@ -534,7 +537,7 @@ buildActionMask = 2147483647; files = ( A6BABFD71C33F90D0082BADE /* BaseLibrary.framework in Frameworks */, - 2E0D74F00A1BCC22C5D7FD31 /* Pods.framework in Frameworks */, + 0A45919266B590CD2DD35235 /* Pods_Verdnaturaventas.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -555,11 +558,21 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3DF33426BC10B5D07D3FE23F /* Pods */ = { + isa = PBXGroup; + children = ( + 4AEE336D24F6131EBB40CD26 /* Pods-Verdnaturaventas.debug.xcconfig */, + 65C3D40422DD9517BCA79409 /* Pods-Verdnaturaventas.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 56E782CA5E1B7AB8B51DE749 /* Frameworks */ = { isa = PBXGroup; children = ( A68E7F611C75A18E009ED57C /* EVReflection.framework */, D88084E26A228A358E419BD7 /* Pods.framework */, + B647C6A9CB3F3C82972443BF /* Pods_Verdnaturaventas.framework */, ); name = Frameworks; sourceTree = ""; @@ -916,11 +929,11 @@ children = ( A6BABFCE1C33F9000082BADE /* BaseLibrary.xcodeproj */, 56E782CA5E1B7AB8B51DE749 /* Frameworks */, - C5CFAE020BA80A08A82A3E4F /* Pods */, A6BABF811C33F8A00082BADE /* Products */, A6BABF821C33F8A00082BADE /* Verdnaturaventas */, A6BABF971C33F8A00082BADE /* VerdnaturaventasTests */, A6BABFA21C33F8A00082BADE /* VerdnaturaventasUITests */, + 3DF33426BC10B5D07D3FE23F /* Pods */, ); sourceTree = ""; }; @@ -944,6 +957,7 @@ A65F5E701C47BDF2004FEAE1 /* Main.storyboard */, A6BABF831C33F8A00082BADE /* AppDelegate.swift */, A6BABF8A1C33F8A00082BADE /* Assets.xcassets */, + EBE7D37720E20A5500A9DC0A /* GoogleService-Info.plist */, A6876E8C1C77102B009C3C56 /* Alerts */, A6A95AE51C4D1AAE00C8559C /* Celdas */, A6BABFE41C3412220082BADE /* Command */, @@ -1028,15 +1042,6 @@ name = Command; sourceTree = ""; }; - C5CFAE020BA80A08A82A3E4F /* Pods */ = { - isa = PBXGroup; - children = ( - 7E3B7176697597B33B41997D /* Pods.debug.xcconfig */, - 99526864B48B202434FA66B1 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; EBF69B4720CE82320015D1D8 /* fonts */ = { isa = PBXGroup; children = ( @@ -1054,13 +1059,12 @@ isa = PBXNativeTarget; buildConfigurationList = A6BABFA81C33F8A00082BADE /* Build configuration list for PBXNativeTarget "Verdnaturaventas" */; buildPhases = ( - AF02D8DB6E6B1D118A959FA5 /* Check Pods Manifest.lock */, + 6A379A34D9B90837B23735B7 /* [CP] Check Pods Manifest.lock */, A6BABF7C1C33F8A00082BADE /* Sources */, A6BABF7D1C33F8A00082BADE /* Frameworks */, A6BABF7E1C33F8A00082BADE /* Resources */, A6BABFE11C33F9AA0082BADE /* Embed Frameworks */, - 54259F0919E1254B694028C9 /* Embed Pods Frameworks */, - A9A92DCF155DDF5F6A7878A2 /* Copy Pods Resources */, + 789C066B85132E1D81F7DED3 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -1236,6 +1240,7 @@ A676F1321C917D1000C0D751 /* mispagos75.png in Resources */, A676F1181C914B8B00C0D751 /* carrito_fill25.png in Resources */, A6366C841C90507000EF8470 /* Raleway-Thin.ttf in Resources */, + EBE7D37920E20A5600A9DC0A /* GoogleService-Info.plist in Resources */, A6AB5A291C4F9461004F068F /* confeccion.png in Resources */, A676F1491C91802C00C0D751 /* buscar50.png in Resources */, A676F1371C917D1000C0D751 /* salir50.png in Resources */, @@ -1298,49 +1303,44 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 54259F0919E1254B694028C9 /* Embed Pods Frameworks */ = { + 6A379A34D9B90837B23735B7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); - name = "Embed Pods Frameworks"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Verdnaturaventas-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - A9A92DCF155DDF5F6A7878A2 /* Copy Pods Resources */ = { + 789C066B85132E1D81F7DED3 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/FSCalendar/FSCalendar.framework", + "${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", ); - name = "Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FSCalendar.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - AF02D8DB6E6B1D118A959FA5 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Verdnaturaventas/Pods-Verdnaturaventas-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -1655,7 +1655,7 @@ }; A6BABFA91C33F8A00082BADE /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7E3B7176697597B33B41997D /* Pods.debug.xcconfig */; + baseConfigurationReference = 4AEE336D24F6131EBB40CD26 /* Pods-Verdnaturaventas.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -1679,7 +1679,7 @@ }; A6BABFAA1C33F8A00082BADE /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 99526864B48B202434FA66B1 /* Pods.release.xcconfig */; + baseConfigurationReference = 65C3D40422DD9517BCA79409 /* Pods-Verdnaturaventas.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; diff --git a/Verdnaturaventas/Verdnaturaventas.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist b/Verdnaturaventas/Verdnaturaventas.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist index fde443d..a90b300 100644 --- a/Verdnaturaventas/Verdnaturaventas.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Verdnaturaventas/Verdnaturaventas.xcodeproj/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,12 @@ Verdnaturaventas.xcscheme orderHint - 1 + 5 + + Verdnaturaventas.xcscheme_^#shared#^_ + + orderHint + 5 diff --git a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/IDEFindNavigatorScopes.plist b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/IDEFindNavigatorScopes.plist new file mode 100644 index 0000000..5dd5da8 --- /dev/null +++ b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/IDEFindNavigatorScopes.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/UserInterfaceState.xcuserstate b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/UserInterfaceState.xcuserstate index 1e21273..4f6ba86 100644 Binary files a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/UserInterfaceState.xcuserstate and b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..dc8e0fe --- /dev/null +++ b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/enriqueblascoblanquer.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,16 @@ + + + + + SchemeUserState + + Pruebas (Playground).xcscheme + + isShown + + orderHint + 7 + + + + diff --git a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/nelo.xcuserdatad/UserInterfaceState.xcuserstate b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/nelo.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index a51b13f..0000000 Binary files a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/nelo.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/nelo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/nelo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index 41ae946..0000000 --- a/Verdnaturaventas/Verdnaturaventas.xcworkspace/xcuserdata/nelo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/Verdnaturaventas/Verdnaturaventas/.DS_Store b/Verdnaturaventas/Verdnaturaventas/.DS_Store new file mode 100644 index 0000000..6037dcb Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/AppDelegate.swift b/Verdnaturaventas/Verdnaturaventas/AppDelegate.swift index d695bff..b18bc77 100644 --- a/Verdnaturaventas/Verdnaturaventas/AppDelegate.swift +++ b/Verdnaturaventas/Verdnaturaventas/AppDelegate.swift @@ -8,6 +8,7 @@ import UIKit import BaseLibrary +import Firebase @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -20,6 +21,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Override point for customization after application launch createOrder() removeData() + FirebaseApp.configure() + return true } diff --git a/Verdnaturaventas/Verdnaturaventas/Assets.xcassets/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Assets.xcassets/.DS_Store new file mode 100644 index 0000000..f8cb2b7 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Assets.xcassets/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Celdas/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Celdas/.DS_Store new file mode 100644 index 0000000..2e54be7 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Celdas/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Certificate/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Certificate/.DS_Store new file mode 100644 index 0000000..6bf9286 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Certificate/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Controller/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Controller/.DS_Store new file mode 100644 index 0000000..ba0868c Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Controller/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Core/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Core/.DS_Store new file mode 100644 index 0000000..81d8c9d Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Core/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Dialog/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Dialog/.DS_Store new file mode 100644 index 0000000..0fefbf0 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Dialog/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Facade/FacadeVentasClient.swift b/Verdnaturaventas/Verdnaturaventas/Facade/FacadeVentasClient.swift index 580d37c..c4b68ed 100644 --- a/Verdnaturaventas/Verdnaturaventas/Facade/FacadeVentasClient.swift +++ b/Verdnaturaventas/Verdnaturaventas/Facade/FacadeVentasClient.swift @@ -15,9 +15,9 @@ class FacadeVentasClient: FacadeClient, URLSessionDelegate { static let instance = FacadeVentasClient() - //let HOST = "https://app.verdnatura.es/" + let HOST = "https://app.verdnatura.es/" //let HOST = "http://www.verdnatura.es/pruebas/" - let HOST = "http://172.16.119.95:8080/" + //let HOST = "http://172.16.198.221:8080/" override func WriteResponseToStream(_ facade: String, command: String, argsMessage: String!, datos: inout AnyObject?) throws{ diff --git a/Verdnaturaventas/Verdnaturaventas/Fonts/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Fonts/.DS_Store new file mode 100644 index 0000000..6b65690 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Fonts/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Fonts/raleway/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Fonts/raleway/.DS_Store new file mode 100644 index 0000000..8ed157a Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Fonts/raleway/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/GoogleService-Info.plist b/Verdnaturaventas/Verdnaturaventas/GoogleService-Info.plist new file mode 100644 index 0000000..2527445 --- /dev/null +++ b/Verdnaturaventas/Verdnaturaventas/GoogleService-Info.plist @@ -0,0 +1,40 @@ + + + + + AD_UNIT_ID_FOR_BANNER_TEST + ca-app-pub-3940256099942544/2934735716 + AD_UNIT_ID_FOR_INTERSTITIAL_TEST + ca-app-pub-3940256099942544/4411468910 + CLIENT_ID + 902772583166-u2qjbt7rhsmihd2clrpom2jnm50c7v21.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.902772583166-u2qjbt7rhsmihd2clrpom2jnm50c7v21 + API_KEY + AIzaSyDUGmCsQR_Ty6HmSZBAUxivVlln7ewlZhI + GCM_SENDER_ID + 902772583166 + PLIST_VERSION + 1 + BUNDLE_ID + com.verdnatura.Verdnaturaventas + PROJECT_ID + verdnatura-2942d + STORAGE_BUCKET + verdnatura-2942d.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:902772583166:ios:d409422d5c2e19bd + DATABASE_URL + https://verdnatura-2942d.firebaseio.com + + \ No newline at end of file diff --git a/Verdnaturaventas/Verdnaturaventas/Images/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Images/.DS_Store new file mode 100644 index 0000000..d37cacd Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Images/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Info.plist b/Verdnaturaventas/Verdnaturaventas/Info.plist index 95d1536..52189b7 100644 --- a/Verdnaturaventas/Verdnaturaventas/Info.plist +++ b/Verdnaturaventas/Verdnaturaventas/Info.plist @@ -26,11 +26,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.6 + 1.0.7 CFBundleSignature ???? CFBundleVersion - 9 + 11 LSApplicationCategoryType LSRequiresIPhoneOS diff --git a/Verdnaturaventas/Verdnaturaventas/Main.storyboard b/Verdnaturaventas/Verdnaturaventas/Main.storyboard index 3406c95..d2e0cf2 100644 --- a/Verdnaturaventas/Verdnaturaventas/Main.storyboard +++ b/Verdnaturaventas/Verdnaturaventas/Main.storyboard @@ -2030,7 +2030,7 @@ - + @@ -2584,7 +2584,7 @@ - - + + diff --git a/Verdnaturaventas/Verdnaturaventas/Model/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Model/.DS_Store new file mode 100644 index 0000000..268ab3e Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Model/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Parser/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Parser/.DS_Store new file mode 100644 index 0000000..3253221 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Parser/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Static/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Static/.DS_Store new file mode 100644 index 0000000..a10056e Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Static/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Static/Values.swift b/Verdnaturaventas/Verdnaturaventas/Static/Values.swift index b8e6538..74879f1 100644 --- a/Verdnaturaventas/Verdnaturaventas/Static/Values.swift +++ b/Verdnaturaventas/Verdnaturaventas/Static/Values.swift @@ -12,7 +12,7 @@ class Values: NSObject { static let BASE_URL_FULL: String = "http://verdnatura.es/vn-image-data/catalog/full/" static let BASE_URL_SMALL: String = "http://verdnatura.es/vn-image-data/catalog/200x200/" - static let BASE_URL_LARGE: String = "http://verdnatura.es/vn-image-data/catalog/900x900/" + static let BASE_URL_LARGE: String = "http://verdnatura.es/vn-image-data/catalog/1600x900/" static let FLORES = 1 static let PLANTAS = 2 diff --git a/Verdnaturaventas/Verdnaturaventas/Strings/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Strings/.DS_Store new file mode 100644 index 0000000..eda28f9 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Strings/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Strings/ca.lproj/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Strings/ca.lproj/.DS_Store new file mode 100644 index 0000000..801cdce Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Strings/ca.lproj/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Strings/en.lproj/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Strings/en.lproj/.DS_Store new file mode 100644 index 0000000..6e16ac8 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Strings/en.lproj/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Strings/es.lproj/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Strings/es.lproj/.DS_Store new file mode 100644 index 0000000..801cdce Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Strings/es.lproj/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Strings/pt.lproj/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Strings/pt.lproj/.DS_Store new file mode 100644 index 0000000..801cdce Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Strings/pt.lproj/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Views/.DS_Store b/Verdnaturaventas/Verdnaturaventas/Views/.DS_Store new file mode 100644 index 0000000..d952332 Binary files /dev/null and b/Verdnaturaventas/Verdnaturaventas/Views/.DS_Store differ diff --git a/Verdnaturaventas/Verdnaturaventas/Views/ViewArticulos.swift b/Verdnaturaventas/Verdnaturaventas/Views/ViewArticulos.swift index a609179..2ea0677 100644 --- a/Verdnaturaventas/Verdnaturaventas/Views/ViewArticulos.swift +++ b/Verdnaturaventas/Verdnaturaventas/Views/ViewArticulos.swift @@ -8,6 +8,7 @@ import UIKit import BaseLibrary +import Firebase class ViewArticulos: MyViewVentas, UITableViewDelegate, UITableViewDataSource { @@ -95,6 +96,7 @@ class ViewArticulos: MyViewVentas, UITableViewDelegate, UITableViewDataSource { } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + launchSegue("segueDetalleArticulo", sender: indexPath.row as AnyObject?) } @@ -106,7 +108,13 @@ class ViewArticulos: MyViewVentas, UITableViewDelegate, UITableViewDataSource { override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if(segue.identifier == "segueDetalleArticulo") { + let articulo = articulos[sender as! Int] + print("ENTRA \(articulo.Article!)") + + Analytics.logEvent("detalle_articulo", parameters: [ + "articulo": articulo.Article! + ]) let viewDetalle = segue.destination as! ViewDetalleArticulo viewDetalle.articulo = articulo } diff --git a/Verdnaturaventas/Verdnaturaventas/Views/ViewDetalleArticulo.swift b/Verdnaturaventas/Verdnaturaventas/Views/ViewDetalleArticulo.swift index 913eedf..b7e4079 100644 --- a/Verdnaturaventas/Verdnaturaventas/Views/ViewDetalleArticulo.swift +++ b/Verdnaturaventas/Verdnaturaventas/Views/ViewDetalleArticulo.swift @@ -8,6 +8,7 @@ import UIKit import BaseLibrary +import Firebase class ViewDetalleArticulo: MyViewVentas, UITableViewDelegate, UITableViewDataSource { @@ -144,6 +145,11 @@ class ViewDetalleArticulo: MyViewVentas, UITableViewDelegate, UITableViewDataSou override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if(segue.identifier == "seguePrecios") { + let nombre = articulo?.Article! + print("ENTRA \(nombre!)") + Analytics.logEvent("boton_comprar", parameters: [ + "articulo": nombre! + ]) let viewPrecios = segue.destination as! DialogPrecios viewPrecios.articulo = articulo } diff --git a/Verdnaturaventas/Verdnaturaventas/Views/ViewFamilias.swift b/Verdnaturaventas/Verdnaturaventas/Views/ViewFamilias.swift index d60f2cb..d167af8 100644 --- a/Verdnaturaventas/Verdnaturaventas/Views/ViewFamilias.swift +++ b/Verdnaturaventas/Verdnaturaventas/Views/ViewFamilias.swift @@ -8,6 +8,7 @@ import UIKit import BaseLibrary +import Firebase class ViewFamilias: MyViewVentas, UITableViewDelegate, UITableViewDataSource { @@ -117,6 +118,12 @@ class ViewFamilias: MyViewVentas, UITableViewDelegate, UITableViewDataSource { viewArticulos.tipo = dictionary["tipo"] as! Int viewArticulos.cadena = dictionary["cadena"] as! String viewArticulos.tipoNombre = dictionary["tipoNombre"] as! String + + print("ENTRA \(dictionary["tipoNombre"] as! String)") + + Analytics.logEvent("Familia", parameters: [ + "familia": dictionary["tipoNombre"] as! String + ]) } } diff --git a/Verdnaturaventas/Verdnaturaventas/Views/ViewLogin.swift b/Verdnaturaventas/Verdnaturaventas/Views/ViewLogin.swift index 9583773..5703d68 100644 --- a/Verdnaturaventas/Verdnaturaventas/Views/ViewLogin.swift +++ b/Verdnaturaventas/Verdnaturaventas/Views/ViewLogin.swift @@ -8,6 +8,7 @@ import UIKit import BaseLibrary +import Firebase class ViewLogin: MyViewVentas, UITextFieldDelegate { @@ -64,6 +65,11 @@ class ViewLogin: MyViewVentas, UITextFieldDelegate { cmd.callbacks = CommandCallbacks( handlerStart: {}, handlerFinish: { + let nombre = cmd.Cliente?.Cliente! + print("ENTRA \(nombre!)") + Analytics.logEvent("cliente", parameters: [ + "name": nombre! + ]) self.aplication.cliente = cmd.Cliente self.launchSegue("segueMain") }, diff --git a/Verdnaturaventas/Verdnaturaventas/Views/ViewMain.swift b/Verdnaturaventas/Verdnaturaventas/Views/ViewMain.swift index 356ef12..d3f4acc 100644 --- a/Verdnaturaventas/Verdnaturaventas/Views/ViewMain.swift +++ b/Verdnaturaventas/Verdnaturaventas/Views/ViewMain.swift @@ -8,6 +8,7 @@ import UIKit import BaseLibrary +import Firebase class ViewMain: MyViewVentas, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout{ @@ -102,6 +103,10 @@ class ViewMain: MyViewVentas, UICollectionViewDelegate, UICollectionViewDataSour func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { if(ControllerPedido.comprobarSeleccionCliente()) { if (aplication.pedido?.agencia != nil){ + print("ENTRA \(titles[indexPath.row])") + Analytics.logEvent("family", parameters: [ + "name": titles[indexPath.row] + ]) let parametros = verFamilia(ids[indexPath.row], nombre: titles[indexPath.row], cadena: "") launchSegue("segueFamilias", sender: parametros) }