Sales app ios

This commit is contained in:
quique 2018-06-07 13:33:34 +02:00
commit 796698a018
408 changed files with 23671 additions and 0 deletions

View File

@ -0,0 +1,621 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
A60259071C58FFE500A7695F /* UIImageViewAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = A60259061C58FFE500A7695F /* UIImageViewAsync.swift */; };
A649BF311C96ED5F00024538 /* LocalizableBase.strings in Resources */ = {isa = PBXBuildFile; fileRef = A649BF261C96ED5F00024538 /* LocalizableBase.strings */; };
A649BF321C96ED5F00024538 /* LocalizableBase.strings in Resources */ = {isa = PBXBuildFile; fileRef = A649BF291C96ED5F00024538 /* LocalizableBase.strings */; };
A649BF331C96ED5F00024538 /* LocalizableBase.strings in Resources */ = {isa = PBXBuildFile; fileRef = A649BF2C1C96ED5F00024538 /* LocalizableBase.strings */; };
A649BF341C96ED5F00024538 /* LocalizableBase.strings in Resources */ = {isa = PBXBuildFile; fileRef = A649BF2F1C96ED5F00024538 /* LocalizableBase.strings */; };
A66EDF391C8985ED008EF663 /* CommandBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF2F1C8985ED008EF663 /* CommandBase.swift */; };
A66EDF3C1C8985ED008EF663 /* FacadeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF331C8985ED008EF663 /* FacadeBase.swift */; };
A66EDF3D1C8985ED008EF663 /* FacadeClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF341C8985ED008EF663 /* FacadeClient.swift */; };
A66EDF3E1C8985ED008EF663 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF351C8985ED008EF663 /* Parser.swift */; };
A66EDF3F1C8985ED008EF663 /* ParserBool.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF361C8985ED008EF663 /* ParserBool.swift */; };
A66EDF401C8985ED008EF663 /* ParserVoid.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF371C8985ED008EF663 /* ParserVoid.swift */; };
A66EDF421C89861E008EF663 /* Ejecutador.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF411C89861E008EF663 /* Ejecutador.swift */; };
A66EDF441C899CDB008EF663 /* CommandCallbacks.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF431C899CDB008EF663 /* CommandCallbacks.swift */; };
A66EDF461C899F07008EF663 /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66EDF451C899F07008EF663 /* Reachability.swift */; };
A69B43061C6CA8E3009F69B4 /* UtilsNumbers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69B43051C6CA8E3009F69B4 /* UtilsNumbers.swift */; };
A69CEE5A1C3A9E4D00482F9B /* MyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69CEE591C3A9E4D00482F9B /* MyView.swift */; };
A6B028581C574F2900D679EF /* UtilsIos.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6B028571C574F2900D679EF /* UtilsIos.swift */; };
A6BABF571C33F80B0082BADE /* BaseLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = A6BABF561C33F80B0082BADE /* BaseLibrary.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6BABF5E1C33F80B0082BADE /* BaseLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6BABF531C33F80B0082BADE /* BaseLibrary.framework */; };
A6BABF631C33F80B0082BADE /* BaseLibraryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6BABF621C33F80B0082BADE /* BaseLibraryTests.swift */; };
A6CC9CE01C633117009BD820 /* ModelBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6CC9CDF1C633117009BD820 /* ModelBase.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
A6BABF5F1C33F80B0082BADE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A6BABF4A1C33F80B0082BADE /* Project object */;
proxyType = 1;
remoteGlobalIDString = A6BABF521C33F80B0082BADE;
remoteInfo = BaseLibrary;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
A60259061C58FFE500A7695F /* UIImageViewAsync.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIImageViewAsync.swift; path = Core/UIImageViewAsync.swift; sourceTree = "<group>"; };
A649BF271C96ED5F00024538 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = LocalizableBase.strings; sourceTree = "<group>"; };
A649BF2A1C96ED5F00024538 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = LocalizableBase.strings; sourceTree = "<group>"; };
A649BF2D1C96ED5F00024538 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = LocalizableBase.strings; sourceTree = "<group>"; };
A649BF301C96ED5F00024538 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = LocalizableBase.strings; sourceTree = "<group>"; };
A66EDF2F1C8985ED008EF663 /* CommandBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandBase.swift; sourceTree = "<group>"; };
A66EDF331C8985ED008EF663 /* FacadeBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FacadeBase.swift; sourceTree = "<group>"; };
A66EDF341C8985ED008EF663 /* FacadeClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FacadeClient.swift; sourceTree = "<group>"; };
A66EDF351C8985ED008EF663 /* Parser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = "<group>"; };
A66EDF361C8985ED008EF663 /* ParserBool.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParserBool.swift; sourceTree = "<group>"; };
A66EDF371C8985ED008EF663 /* ParserVoid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParserVoid.swift; sourceTree = "<group>"; };
A66EDF411C89861E008EF663 /* Ejecutador.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Ejecutador.swift; sourceTree = "<group>"; };
A66EDF431C899CDB008EF663 /* CommandCallbacks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandCallbacks.swift; sourceTree = "<group>"; };
A66EDF451C899F07008EF663 /* Reachability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };
A69B43051C6CA8E3009F69B4 /* UtilsNumbers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UtilsNumbers.swift; path = Core/UtilsNumbers.swift; sourceTree = "<group>"; };
A69CEE591C3A9E4D00482F9B /* MyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MyView.swift; path = Views/MyView.swift; sourceTree = "<group>"; };
A6B028571C574F2900D679EF /* UtilsIos.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UtilsIos.swift; path = Core/UtilsIos.swift; sourceTree = "<group>"; };
A6BABF531C33F80B0082BADE /* BaseLibrary.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BaseLibrary.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A6BABF561C33F80B0082BADE /* BaseLibrary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseLibrary.h; sourceTree = "<group>"; };
A6BABF581C33F80B0082BADE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = BaseLibrary/Info.plist; sourceTree = "<group>"; };
A6BABF5D1C33F80B0082BADE /* BaseLibraryTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BaseLibraryTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
A6BABF621C33F80B0082BADE /* BaseLibraryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseLibraryTests.swift; sourceTree = "<group>"; };
A6BABF641C33F80B0082BADE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A6CC9CDF1C633117009BD820 /* ModelBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ModelBase.swift; path = Model/ModelBase.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
A6BABF4F1C33F80B0082BADE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
A6BABF5A1C33F80B0082BADE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A6BABF5E1C33F80B0082BADE /* BaseLibrary.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
A649BF251C96ED5F00024538 /* ca.lproj */ = {
isa = PBXGroup;
children = (
A649BF261C96ED5F00024538 /* LocalizableBase.strings */,
);
name = ca.lproj;
path = Resources/Strings/ca.lproj;
sourceTree = "<group>";
};
A649BF281C96ED5F00024538 /* en.lproj */ = {
isa = PBXGroup;
children = (
A649BF291C96ED5F00024538 /* LocalizableBase.strings */,
);
name = en.lproj;
path = Resources/Strings/en.lproj;
sourceTree = "<group>";
};
A649BF2B1C96ED5F00024538 /* es.lproj */ = {
isa = PBXGroup;
children = (
A649BF2C1C96ED5F00024538 /* LocalizableBase.strings */,
);
name = es.lproj;
path = Resources/Strings/es.lproj;
sourceTree = "<group>";
};
A649BF2E1C96ED5F00024538 /* pt.lproj */ = {
isa = PBXGroup;
children = (
A649BF2F1C96ED5F00024538 /* LocalizableBase.strings */,
);
name = pt.lproj;
path = Resources/Strings/pt.lproj;
sourceTree = "<group>";
};
A65F5E7C1C47D107004FEAE1 /* Core */ = {
isa = PBXGroup;
children = (
A60259061C58FFE500A7695F /* UIImageViewAsync.swift */,
A6B028571C574F2900D679EF /* UtilsIos.swift */,
A69B43051C6CA8E3009F69B4 /* UtilsNumbers.swift */,
);
name = Core;
sourceTree = "<group>";
};
A66EDF2C1C8985ED008EF663 /* Communicacion */ = {
isa = PBXGroup;
children = (
A66EDF2D1C8985ED008EF663 /* Command */,
A66EDF321C8985ED008EF663 /* Facade */,
A66EDF411C89861E008EF663 /* Ejecutador.swift */,
);
path = Communicacion;
sourceTree = "<group>";
};
A66EDF2D1C8985ED008EF663 /* Command */ = {
isa = PBXGroup;
children = (
A66EDF2F1C8985ED008EF663 /* CommandBase.swift */,
A66EDF431C899CDB008EF663 /* CommandCallbacks.swift */,
A66EDF451C899F07008EF663 /* Reachability.swift */,
);
path = Command;
sourceTree = "<group>";
};
A66EDF321C8985ED008EF663 /* Facade */ = {
isa = PBXGroup;
children = (
A66EDF331C8985ED008EF663 /* FacadeBase.swift */,
A66EDF341C8985ED008EF663 /* FacadeClient.swift */,
A66EDF351C8985ED008EF663 /* Parser.swift */,
A66EDF361C8985ED008EF663 /* ParserBool.swift */,
A66EDF371C8985ED008EF663 /* ParserVoid.swift */,
);
path = Facade;
sourceTree = "<group>";
};
A66EDF471C89A443008EF663 /* Resources */ = {
isa = PBXGroup;
children = (
A66EDF481C89A44B008EF663 /* Strings.bundle */,
);
name = Resources;
sourceTree = "<group>";
};
A66EDF481C89A44B008EF663 /* Strings.bundle */ = {
isa = PBXGroup;
children = (
A649BF251C96ED5F00024538 /* ca.lproj */,
A649BF281C96ED5F00024538 /* en.lproj */,
A649BF2B1C96ED5F00024538 /* es.lproj */,
A649BF2E1C96ED5F00024538 /* pt.lproj */,
);
name = Strings.bundle;
sourceTree = "<group>";
};
A69CEE581C3A9E3700482F9B /* Views */ = {
isa = PBXGroup;
children = (
A69CEE591C3A9E4D00482F9B /* MyView.swift */,
);
name = Views;
sourceTree = "<group>";
};
A6B1E91D1C60BA6B00D3A0A5 /* Model */ = {
isa = PBXGroup;
children = (
A6CC9CDF1C633117009BD820 /* ModelBase.swift */,
);
name = Model;
sourceTree = "<group>";
};
A6BABF491C33F80B0082BADE = {
isa = PBXGroup;
children = (
A6BABF551C33F80B0082BADE /* BaseLibrary */,
A6BABF581C33F80B0082BADE /* Info.plist */,
A6BABF611C33F80B0082BADE /* BaseLibraryTests */,
A6BABF541C33F80B0082BADE /* Products */,
);
sourceTree = "<group>";
};
A6BABF541C33F80B0082BADE /* Products */ = {
isa = PBXGroup;
children = (
A6BABF531C33F80B0082BADE /* BaseLibrary.framework */,
A6BABF5D1C33F80B0082BADE /* BaseLibraryTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
A6BABF551C33F80B0082BADE /* BaseLibrary */ = {
isa = PBXGroup;
children = (
A66EDF471C89A443008EF663 /* Resources */,
A66EDF2C1C8985ED008EF663 /* Communicacion */,
A6BABF561C33F80B0082BADE /* BaseLibrary.h */,
A65F5E7C1C47D107004FEAE1 /* Core */,
A6B1E91D1C60BA6B00D3A0A5 /* Model */,
A69CEE581C3A9E3700482F9B /* Views */,
);
path = BaseLibrary;
sourceTree = "<group>";
};
A6BABF611C33F80B0082BADE /* BaseLibraryTests */ = {
isa = PBXGroup;
children = (
A6BABF621C33F80B0082BADE /* BaseLibraryTests.swift */,
A6BABF641C33F80B0082BADE /* Info.plist */,
);
path = BaseLibraryTests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
A6BABF501C33F80B0082BADE /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
A6BABF571C33F80B0082BADE /* BaseLibrary.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
A6BABF521C33F80B0082BADE /* BaseLibrary */ = {
isa = PBXNativeTarget;
buildConfigurationList = A6BABF671C33F80B0082BADE /* Build configuration list for PBXNativeTarget "BaseLibrary" */;
buildPhases = (
A6BABF4E1C33F80B0082BADE /* Sources */,
A6BABF4F1C33F80B0082BADE /* Frameworks */,
A6BABF501C33F80B0082BADE /* Headers */,
A6BABF511C33F80B0082BADE /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = BaseLibrary;
productName = BaseLibrary;
productReference = A6BABF531C33F80B0082BADE /* BaseLibrary.framework */;
productType = "com.apple.product-type.framework";
};
A6BABF5C1C33F80B0082BADE /* BaseLibraryTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = A6BABF6A1C33F80B0082BADE /* Build configuration list for PBXNativeTarget "BaseLibraryTests" */;
buildPhases = (
A6BABF591C33F80B0082BADE /* Sources */,
A6BABF5A1C33F80B0082BADE /* Frameworks */,
A6BABF5B1C33F80B0082BADE /* Resources */,
);
buildRules = (
);
dependencies = (
A6BABF601C33F80B0082BADE /* PBXTargetDependency */,
);
name = BaseLibraryTests;
productName = BaseLibraryTests;
productReference = A6BABF5D1C33F80B0082BADE /* BaseLibraryTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
A6BABF4A1C33F80B0082BADE /* Project object */ = {
isa = PBXProject;
attributes = {
KnownAssetTags = (
New,
);
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = "Nelo Sanchez Gomiz";
TargetAttributes = {
A6BABF521C33F80B0082BADE = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0820;
};
A6BABF5C1C33F80B0082BADE = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = A6BABF4D1C33F80B0082BADE /* Build configuration list for PBXProject "BaseLibrary" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
es,
Base,
ca,
pt,
);
mainGroup = A6BABF491C33F80B0082BADE;
productRefGroup = A6BABF541C33F80B0082BADE /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
A6BABF521C33F80B0082BADE /* BaseLibrary */,
A6BABF5C1C33F80B0082BADE /* BaseLibraryTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
A6BABF511C33F80B0082BADE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A649BF311C96ED5F00024538 /* LocalizableBase.strings in Resources */,
A649BF341C96ED5F00024538 /* LocalizableBase.strings in Resources */,
A649BF331C96ED5F00024538 /* LocalizableBase.strings in Resources */,
A649BF321C96ED5F00024538 /* LocalizableBase.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A6BABF5B1C33F80B0082BADE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
A6BABF4E1C33F80B0082BADE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A66EDF461C899F07008EF663 /* Reachability.swift in Sources */,
A69CEE5A1C3A9E4D00482F9B /* MyView.swift in Sources */,
A66EDF421C89861E008EF663 /* Ejecutador.swift in Sources */,
A66EDF3D1C8985ED008EF663 /* FacadeClient.swift in Sources */,
A66EDF3C1C8985ED008EF663 /* FacadeBase.swift in Sources */,
A66EDF401C8985ED008EF663 /* ParserVoid.swift in Sources */,
A66EDF391C8985ED008EF663 /* CommandBase.swift in Sources */,
A60259071C58FFE500A7695F /* UIImageViewAsync.swift in Sources */,
A66EDF3F1C8985ED008EF663 /* ParserBool.swift in Sources */,
A66EDF441C899CDB008EF663 /* CommandCallbacks.swift in Sources */,
A6B028581C574F2900D679EF /* UtilsIos.swift in Sources */,
A66EDF3E1C8985ED008EF663 /* Parser.swift in Sources */,
A69B43061C6CA8E3009F69B4 /* UtilsNumbers.swift in Sources */,
A6CC9CE01C633117009BD820 /* ModelBase.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A6BABF591C33F80B0082BADE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A6BABF631C33F80B0082BADE /* BaseLibraryTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
A6BABF601C33F80B0082BADE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = A6BABF521C33F80B0082BADE /* BaseLibrary */;
targetProxy = A6BABF5F1C33F80B0082BADE /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
A649BF261C96ED5F00024538 /* LocalizableBase.strings */ = {
isa = PBXVariantGroup;
children = (
A649BF271C96ED5F00024538 /* ca */,
);
name = LocalizableBase.strings;
sourceTree = "<group>";
};
A649BF291C96ED5F00024538 /* LocalizableBase.strings */ = {
isa = PBXVariantGroup;
children = (
A649BF2A1C96ED5F00024538 /* en */,
);
name = LocalizableBase.strings;
sourceTree = "<group>";
};
A649BF2C1C96ED5F00024538 /* LocalizableBase.strings */ = {
isa = PBXVariantGroup;
children = (
A649BF2D1C96ED5F00024538 /* es */,
);
name = LocalizableBase.strings;
sourceTree = "<group>";
};
A649BF2F1C96ED5F00024538 /* LocalizableBase.strings */ = {
isa = PBXVariantGroup;
children = (
A649BF301C96ED5F00024538 /* pt */,
);
name = LocalizableBase.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
A6BABF651C33F80B0082BADE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
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_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = 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;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
A6BABF661C33F80B0082BADE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
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_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = 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;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
A6BABF681C33F80B0082BADE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = BaseLibrary/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = nelosan.BaseLibrary;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
A6BABF691C33F80B0082BADE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = BaseLibrary/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = nelosan.BaseLibrary;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
A6BABF6B1C33F80B0082BADE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = BaseLibraryTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = nelosan.BaseLibraryTests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
A6BABF6C1C33F80B0082BADE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = BaseLibraryTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = nelosan.BaseLibraryTests;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
A6BABF4D1C33F80B0082BADE /* Build configuration list for PBXProject "BaseLibrary" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A6BABF651C33F80B0082BADE /* Debug */,
A6BABF661C33F80B0082BADE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A6BABF671C33F80B0082BADE /* Build configuration list for PBXNativeTarget "BaseLibrary" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A6BABF681C33F80B0082BADE /* Debug */,
A6BABF691C33F80B0082BADE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A6BABF6A1C33F80B0082BADE /* Build configuration list for PBXNativeTarget "BaseLibraryTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A6BABF6B1C33F80B0082BADE /* Debug */,
A6BABF6C1C33F80B0082BADE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = A6BABF4A1C33F80B0082BADE /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:BaseLibrary.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>BaseLibrary.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6BABF521C33F80B0082BADE"
BuildableName = "BaseLibrary.framework"
BlueprintName = "BaseLibrary"
ReferencedContainer = "container:BaseLibrary.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6BABF5C1C33F80B0082BADE"
BuildableName = "BaseLibraryTests.xctest"
BlueprintName = "BaseLibraryTests"
ReferencedContainer = "container:BaseLibrary.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6BABF521C33F80B0082BADE"
BuildableName = "BaseLibrary.framework"
BlueprintName = "BaseLibrary"
ReferencedContainer = "container:BaseLibrary.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6BABF521C33F80B0082BADE"
BuildableName = "BaseLibrary.framework"
BlueprintName = "BaseLibrary"
ReferencedContainer = "container:BaseLibrary.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A6BABF521C33F80B0082BADE"
BuildableName = "BaseLibrary.framework"
BlueprintName = "BaseLibrary"
ReferencedContainer = "container:BaseLibrary.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>BaseLibrary.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>A6BABF521C33F80B0082BADE</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>A6BABF5C1C33F80B0082BADE</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,19 @@
//
// BaseLibrary.h
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 30/12/15.
// Copyright © 2015 Nelo Sanchez Gomiz. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for BaseLibrary.
FOUNDATION_EXPORT double BaseLibraryVersionNumber;
//! Project version string for BaseLibrary.
FOUNDATION_EXPORT const unsigned char BaseLibraryVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <BaseLibrary/PublicHeader.h>

View File

@ -0,0 +1,135 @@
//
// CommandBase.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 29/12/15.
// Copyright © 2015 Nelo Sanchez Gomiz. All rights reserved.
//
//
// FacadeClient.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 29/12/15.
// Copyright © 2015 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
import CoreLocation
open class CommandBase: NSObject {
open var succesMessage: String = ""
open var needInternet: Bool = true
open var cancel = false
open var cancelable = true
open var error: String = ""
open var errorMessage: String = ""
open var view: UIViewController?
open var callbacks: CommandCallbacks?
var ejecutador = Ejecutador.getInstance()
open func executeTask(_ view: UIViewController)
{
self.view = view
//LANZA UNA TAREA EN SEGUNDO PLANO
DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async(execute: {
do{
try self.execute()
}
catch let error as NSError {
self.error = error.description
}
self.onPostExecute()
});
}
open func execute() throws {}
open func onPostExecute()
{
//EJECUTA LA FUNCIONALIDAD EN EL HILO PRINCIPAL
DispatchQueue.main.async(execute: {
if(!self.cancel)
{
if(self.error != "" && self.errorMessage != "")
{
self.mostrarAviso(self.errorMessage, showRetry: true)
}
else
{
self.Finished()
}
}
});
}
open func isNeedInternet() -> Bool {
return needInternet
}
func mostrarAviso(_ msg: String, showRetry: Bool)
{
let alert = UIAlertController(title: NSLocalizedString("error", comment: ""), message: msg, preferredStyle: UIAlertControllerStyle.alert)
let retry: UIAlertAction = UIAlertAction(title: NSLocalizedString("retry", comment: ""), style: .default) { action -> Void in
self.retry()
}
let accept: UIAlertAction = UIAlertAction(title: NSLocalizedString("accept", comment: ""), style: .default) { action -> Void in
self.accept()
}
alert.addAction(retry)
alert.addAction(accept)
view!.present(alert, animated: true, completion: nil)
}
open func onCancelled() {
if(cancelable)
{
cancel = true
}
}
open func Finished(){
if(callbacks != nil)
{
callbacks!.onFinish()
}
}
open func Start(){
if(callbacks != nil)
{
callbacks!.onStart()
}
}
open func retry()
{
if(callbacks != nil)
{
callbacks!.onRetry()
}
}
open func accept()
{
if(callbacks != nil)
{
callbacks!.onAccept()
}
}
}

View File

@ -0,0 +1,50 @@
//
// CommandCallbacks.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 4/3/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class CommandCallbacks {
var retry: (() -> Void)?
var accept: (() -> Void)?
var start: (() -> Void)?
var finish: (() -> Void)?
open func onRetry(){
if let _ = self.retry {
retry!()
}
}
open func onAccept(){
if let _ = self.accept {
accept!()
}
}
open func onFinish(){
if let _ = self.finish {
finish!()
}
}
open func onStart(){
if let _ = self.start {
start!()
}
}
public init(handlerStart: @escaping (() -> Void), handlerFinish: @escaping (() -> Void), handlerRetry: @escaping (() -> Void), handlerAccept: @escaping (() -> Void))
{
self.retry = handlerRetry
self.accept = handlerAccept
self.start = handlerStart
self.finish = handlerFinish
}
}

View File

@ -0,0 +1,40 @@
//
// Reachability.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 4/3/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import Foundation
import SystemConfiguration
open class Reachability {
class func isConnectedToNetwork() -> Bool {
var zeroAddress = sockaddr_in(sin_len: 0, sin_family: 0, sin_port: 0, sin_addr: in_addr(s_addr: 0), sin_zero: (0, 0, 0, 0, 0, 0, 0, 0))
zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
zeroAddress.sin_family = sa_family_t(AF_INET)
guard let defaultRouteReachability = withUnsafePointer(to: &zeroAddress, {
$0.withMemoryRebound(to: sockaddr.self, capacity: 1) {
SCNetworkReachabilityCreateWithAddress(nil, $0)
}
}) else {
return false
}
var flags: SCNetworkReachabilityFlags = SCNetworkReachabilityFlags(rawValue: 0)
if SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags) == false {
return false
}
let isReachable = flags == .reachable
let needsConnection = flags == .connectionRequired
return isReachable && !needsConnection
}
}

View File

@ -0,0 +1,73 @@
//
// Ejecutador.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 4/3/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class Ejecutador: NSObject {
var commands = Array<CommandBase>()
static var INSTANCE: Ejecutador? = nil
override init (){}
static func createInstance() {
if (INSTANCE == nil) {
INSTANCE = Ejecutador()
}
}
open static func getInstance() -> Ejecutador {
if (INSTANCE == nil)
{
createInstance()
}
return INSTANCE!
}
open func exeute(_ cmd: CommandBase, view: UIViewController)
{
var existe = false
for c in commands
{
if(c == cmd)
{
existe = true
break
}
}
if(!existe)
{
commands.append(cmd)
}
cmd.executeTask(view)
}
func cancelCommad(_ cmd: CommandBase)
{
cmd.cancel = true
removeCommand(cmd)
}
open func removeCommand(_ cmd: CommandBase)
{
let index = commands.index(of: cmd)
commands.remove(at: index!)
}
open func removeCommands()
{
for cmd in commands{
cancelCommad(cmd)
}
}
}

View File

@ -0,0 +1,21 @@
//
// FacadeBase.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 30/12/15.
// Copyright © 2015 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class FacadeBase: NSObject {
open var facadeName = ""
open var facade: FacadeClient?
open func Execute<T:Parser>(_ parser: T?, command: String, args: AnyObject...) throws -> AnyObject?
{
return try facade!.Execute(parser, facade: facadeName, command: command, args: args as AnyObject)
}
}

View File

@ -0,0 +1,79 @@
//
// FacadeClient.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 29/12/15.
// Copyright © 2015 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class FacadeClient: NSObject
{
open let POST = "POST"
open let GET = "GET"
public enum ErrorFacade: Error {
case errorServidor(String)
}
func Execute<T:Parser>(_ parser: T?, facade: String, command: String, args: AnyObject...) throws -> AnyObject?
{
let jsonObject = try InnerExecute(facade, command: command, args: (args as AnyObject) as! Array<Any>, file: nil)
var data: AnyObject? = nil
if(parser != nil && jsonObject != nil)
{
data = parser!.parse(jsonObject!) as? AnyObject
}
else{
data = jsonObject
}
return data
}
fileprivate func InnerExecute(_ facade: String, command: String , args: Array<Any>, file: String?) throws -> AnyObject?
{
//FALTA CODIGO FICHEROS
var argsMessage: String? = ""
var datos: AnyObject? = nil
do {
let data = try JSONSerialization.data(withJSONObject: args[0], options: JSONSerialization.WritingOptions(rawValue: 0))
argsMessage = String(data: data, encoding: String.Encoding.utf8)
}catch let error as NSError{
print(error.description)
throw ErrorFacade.errorServidor(error.description)
}
do{
try WriteResponseToStream(facade, command: command, argsMessage: argsMessage, datos: &datos)
}
catch let error as NSError
{
throw ErrorFacade.errorServidor(error.description)
}
return datos
}
open func tratarJson(_ datos: Data) -> AnyObject?
{
do{
if let json = try JSONSerialization.jsonObject(with: datos, options: JSONSerialization.ReadingOptions.allowFragments) as AnyObject?
{
return json
}
}catch
{
return nil
}
return nil
}
open func WriteResponseToStream(_ facade: String, command: String, argsMessage: String!, datos: inout AnyObject?) throws {}
}

View File

@ -0,0 +1,18 @@
//
// Parser.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 4/1/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
public protocol Parser
{
associatedtype T
func parse(_: AnyObject) -> T
}

View File

@ -0,0 +1,24 @@
//
// ParserDictionary.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 17/2/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class ParserBool: Parser {
public typealias T = Bool
public init(){}
open func parse(_ jsonObject: AnyObject) -> Bool
{
return jsonObject as! Bool
}
}

View File

@ -0,0 +1,20 @@
//
// ParserDefault.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 11/1/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class ParserVoid: Parser {
public typealias T = Void
public init(){}
open func parse(_ jsonObject: AnyObject) -> Void
{
}
}

View File

@ -0,0 +1,60 @@
//
// UIImageViewAsync.swift
// ElTiempo
//
// Created by Jordi on 10/7/15.
// Copyright (c) 2015 EPSA UPV. All rights reserved.
//
import Foundation
import UIKit
open class UIImageViewAsync :UIImageView
{
override init(frame:CGRect)
{
super.init(frame:frame)
}
required public init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
}
open func getDataFromUrl(_ url:String, completion: @escaping ((_ data: Data?) -> Void)) {
if(verifyUrl(url)){
URLSession.shared.dataTask(with: URL(string: url)!, completionHandler: { (data, response, error) in
if(data != nil)
{
completion(NSData(data: data!) as Data)
}
}) .resume()
}
}
open func downloadImage(_ url:String){
getDataFromUrl(url) { data in
self.completion(data)
}
}
open func completion(_ data: Data?)
{
DispatchQueue.main.async {
self.contentMode = self.contentMode
self.image = UIImage(data: data!)
}
}
open func verifyUrl (_ urlString: String?) -> Bool {
//Check for nil
if let urlString = urlString {
// create NSURL instance
if let url = URL(string: urlString) {
// check if your application can open the NSURL instance
return UIApplication.shared.canOpenURL(url)
}
}
return false
}
}

View File

@ -0,0 +1,69 @@
//
// UtilsIos.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 26/1/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class UtilsIos: NSObject {
open static func registerNib(_ table: UITableView, cell: String)
{
let nib = UINib(nibName: cell, bundle: nil)
table.register(nib, forCellReuseIdentifier: cell)
}
open static func registerNibCollection(_ collection: UICollectionView, cell: String)
{
let nib = UINib(nibName: cell, bundle: nil)
collection.register(nib, forCellWithReuseIdentifier: cell)
}
open static func getColor(_ rgbValue: UInt) -> UIColor {
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
alpha: CGFloat(1.0)
)
}
open static func getColor(_ rgbValue: UInt, alpha: CGFloat) -> UIColor {
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
alpha: CGFloat(alpha)
)
}
open static func nullToNil(_ value : AnyObject?) -> AnyObject? {
if value is NSNull {
return nil
} else {
return value
}
}
open static func toString(_ value: AnyObject) -> String{
return "\(value)"
}
open static func toBool(_ value: String) -> Bool? {
switch (value){
case "True", "true", "yes", "1":
return true
case "False", "false", "no", "0":
return false
default:
return nil
}
}
}

View File

@ -0,0 +1,19 @@
//
// UtilsNumbers.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 11/2/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class UtilsNumbers: NSObject {
open static func roundDouble(_ number: NSNumber, decimals: Int) -> Double
{
let dec = "%.\(decimals)f"
return Double(String(format: dec, number.doubleValue))!
}
}

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleLocalizations</key>
<array>
<string>Portugues</string>
<string>Catalan</string>
<string>en</string>
<string>Spanish</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,112 @@
//
// ModelBase.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 4/2/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class ModelBase: NSObject {
open func parseJson(_ json: NSDictionary)
{
let dictionary = generateDictionary()
for (key, value) in dictionary{
if let val = json[key]
{
castType(value, value: val as AnyObject?, property: key)
}
}
}
func generateDictionary() -> Dictionary<String,String>{
var dictionary = Dictionary<String, String>()
let mirror = Mirror(reflecting: self)
for child in mirror.children {
dictionary[child.label!] = String(describing: type(of: (child.value)))
if((dictionary[child.label!]?.lowercased().contains("optional")) != nil){
let typeArr = dictionary[child.label!]!.characters.split{$0 == "<"}.map(String.init)
let typeArr2 = typeArr[1].characters.split{$0 == ">"}.map(String.init)
dictionary[child.label!] = typeArr2[0]
}
}
return dictionary
}
func castType(_ type: String, value: AnyObject?, property: String){
let v = nullToNil(value)
if(v != nil){
var val = toString(value!)
switch(type){
case "String":
setValue(val, forKey: property)
break
case "String, String":
val = val.replacingOccurrences(of: "{\n", with: "")
val = val.replacingOccurrences(of: "\n}", with: "")
val = val.replacingOccurrences(of: " ", with: "")
let array = val.components(separatedBy: ";\n")
var dictionary: Dictionary<String, String> = Dictionary()
for a in array{
let data = a.components(separatedBy: " = ")
dictionary[data[0].replacingOccurrences(of: ";", with: "")] = data[1].replacingOccurrences(of: ";", with: "")
}
print(dictionary)
break
case "NSNumber":
let nVal = Double(val)!
if(nVal.truncatingRemainder(dividingBy: 1) == 0)
{
setValue(NSNumber(value: Int(nVal) as Int), forKey: property)
}
else{
setValue(NSNumber(value: nVal as Double), forKey: property)
}
break
default:
break
}
}
}
func nullToNil(_ value : AnyObject?) -> AnyObject? {
if value is NSNull {
return nil
} else {
return value
}
}
func toString(_ value: AnyObject) -> String{
return "\(value)"
}
func toBool(_ value: String) -> Bool? {
switch (value){
case "True", "true", "yes", "1":
return true
case "False", "false", "no", "0":
return false
default:
return nil
}
}
}

View File

@ -0,0 +1,20 @@
/*
Localizable.strings
BaseLibrary
Created by Nelo Sanchez Gomiz on 4/3/16.
Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
*/
/* */
"error" = "Error";
/* */
"accept" = "Aceptar";
/* */
"retry" = "Reintentar";
/* */
"no_internet" = "No hi ha connexió a internet";

View File

@ -0,0 +1,20 @@
/*
Localizable.strings
BaseLibrary
Created by Nelo Sanchez Gomiz on 4/3/16.
Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
*/
/* */
"error" = "Error";
/* */
"accept" = "Acept";
/* */
"retry" = "Retry";
/* */
"no_internet" = "No internet";

View File

@ -0,0 +1,20 @@
/*
Localizable.strings
BaseLibrary
Created by Nelo Sanchez Gomiz on 4/3/16.
Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
*/
/* */
"error" = "Error";
/* */
"accept" = "Aceptar";
/* */
"retry" = "Reintentar";
/* */
"no_internet" = "No hay conexión a internet";

View File

@ -0,0 +1,20 @@
/*
Localizable.strings
BaseLibrary
Created by Nelo Sanchez Gomiz on 4/3/16.
Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
*/
/* */
"error" = "Error";
/* */
"accept" = "Aceptar";
/* */
"retry" = "Reintentar";
/* */
"no_internet" = "Sem conexão à Internet";

View File

@ -0,0 +1,88 @@
//
// MyView.swift
// BaseLibrary
//
// Created by Nelo Sanchez Gomiz on 4/1/16.
// Copyright © 2016 Nelo Sanchez Gomiz. All rights reserved.
//
import UIKit
open class MyView: UIViewController {
open var progress: UIActivityIndicatorView?
open var contenedor: UIView?
open var ejecutador: Ejecutador?
open override func viewDidLoad() {
ejecutador = Ejecutador.getInstance()
createView()
}
open override func viewWillAppear(_ animated: Bool) {
prepareView()
}
open override func viewWillDisappear(_ animated: Bool) {
ejecutador!.removeCommands()
}
open func showProgress(_ show: Bool) {
showProgressBar(show)
showContenedor(show)
}
open func showProgressBar(_ show: Bool)
{
if(progress != nil)
{
if(show)
{
progress!.startAnimating()
progress!.isHidden = false
}
else
{
progress!.stopAnimating()
progress!.isHidden = true
}
}
}
open func showContenedor(_ show: Bool)
{
if(contenedor != nil)
{
contenedor!.isHidden = show
}
}
open func createView(){
showProgress(false)
setTitles()
}
open func prepareView(){}
open func setTitles(){}
open func execute(_ cmd: CommandBase)
{
ejecutador!.exeute(cmd, view: self)
}
open func launchSegue(_ segue: String){
performSegue(withIdentifier: segue, sender: self)
}
open func launchSegue(_ segue: String, sender: AnyObject?)
{
performSegue(withIdentifier: segue, sender: sender)
}
}

View File

@ -0,0 +1,36 @@
//
// BaseLibraryTests.swift
// BaseLibraryTests
//
// Created by Nelo Sanchez Gomiz on 30/12/15.
// Copyright © 2015 Nelo Sanchez Gomiz. All rights reserved.
//
import XCTest
@testable import BaseLibrary
class BaseLibraryTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}
}

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

6
Verdnaturaventas/Podfile Normal file
View File

@ -0,0 +1,6 @@
use_frameworks!
platform :ios, '8.0'
pod 'FSCalendar'

View File

@ -0,0 +1,10 @@
PODS:
- FSCalendar (2.0.1)
DEPENDENCIES:
- FSCalendar
SPEC CHECKSUMS:
FSCalendar: 18117308f5876a8f6f0fe572085d543580c2c5e5
COCOAPODS: 0.39.0

View File

@ -0,0 +1,21 @@
//
// CALayer+FSExtension.h
// FSCalendar
//
// Created by dingwenchao on 2/3/16.
// Copyright © 2016 wenchaoios. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
@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

View File

@ -0,0 +1,73 @@
//
// 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

View File

@ -0,0 +1,55 @@
//
// 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

View File

@ -0,0 +1,378 @@
//
// 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

View File

@ -0,0 +1,598 @@
//
// FSCalendar.h
// FSCalendar
//
// Created by Wenchao Ding on 29/1/15.
// Copyright © 2016 Wenchao Ding. All rights reserved.
//
// https://github.com/WenchaoD
//
#import <UIKit/UIKit.h>
#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
*/
//! Project version number for FSCalendar.
FOUNDATION_EXPORT double FSCalendarVersionNumber;
//! Project version string for FSCalendar.
FOUNDATION_EXPORT const unsigned char FSCalendarVersionString[];
typedef NS_ENUM(NSUInteger, FSCalendarScope) {
FSCalendarScopeMonth,
FSCalendarScopeWeek
};
typedef NS_ENUM(NSUInteger, FSCalendarScrollDirection) {
FSCalendarScrollDirectionVertical,
FSCalendarScrollDirectionHorizontal
};
typedef NS_ENUM(NSUInteger, FSCalendarUnit) {
FSCalendarUnitMonth = NSCalendarUnitMonth,
FSCalendarUnitWeekOfYear = NSCalendarUnitWeekOfYear,
FSCalendarUnitDay = NSCalendarUnitDay
};
NS_ASSUME_NONNULL_BEGIN
@class FSCalendar;
/**
* FSCalendarDataSource is a source set of FSCalendar. The basic job is to provide eventsubtitle and min/max day to display for calendar.
*/
@protocol FSCalendarDataSource <NSObject>
@optional
/**
* Asks the dataSource for a subtitle for the specific date under the day text.
*/
- (nullable NSString *)calendar:(FSCalendar *)calendar subtitleForDate:(NSDate *)date;
/**
* Asks the dataSource for an image for the specific date.
*/
- (nullable UIImage *)calendar:(FSCalendar *)calendar imageForDate:(NSDate *)date;
/**
* Asks the dataSource the minimum date to display.
*/
- (NSDate *)minimumDateForCalendar:(FSCalendar *)calendar;
/**
* Asks the dataSource the maximum date to display.
*/
- (NSDate *)maximumDateForCalendar:(FSCalendar *)calendar;
/**
* 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;
*/
- (NSInteger)calendar:(FSCalendar *)calendar numberOfEventsForDate:(NSDate *)date;
/**
* This function is deprecated
*/
- (BOOL)calendar:(FSCalendar *)calendar hasEventForDate:(NSDate *)date FSCalendarDeprecated(-calendar:numberOfEventsForDate:);
@end
/**
* The delegate of a FSCalendar object must adopt the FSCalendarDelegate protocol. The optional methods of FSCalendarDelegate manage selections user events and help to manager the frame of the calendar.
*/
@protocol FSCalendarDelegate <NSObject>
@optional
/**
* Asks the delegate whether the specific date is allowed to be selected by tapping.
*/
- (BOOL)calendar:(FSCalendar *)calendar shouldSelectDate:(NSDate *)date;
/**
* Tells the delegate a date in the calendar is selected by tapping.
*/
- (void)calendar:(FSCalendar *)calendar didSelectDate:(NSDate *)date;
/**
* Asks the delegate whether the specific date is allowed to be deselected by tapping.
*/
- (BOOL)calendar:(FSCalendar *)calendar shouldDeselectDate:(NSDate *)date;
/**
* Tells the delegate a date in the calendar is deselected by tapping.
*/
- (void)calendar:(FSCalendar *)calendar didDeselectDate:(NSDate *)date;
/**
* 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.
*/
- (void)calendarCurrentPageDidChange:(FSCalendar *)calendar;
/**
* These functions are deprecated
*/
- (void)calendarCurrentScopeWillChange:(FSCalendar *)calendar animated:(BOOL)animated FSCalendarDeprecated(-calendar:boundingRectWillChange:animated:);
- (void)calendarCurrentMonthDidChange:(FSCalendar *)calendar FSCalendarDeprecated(-calendarCurrentPageDidChange:);
@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.
*
* @see FSCalendarAppearance
*/
@protocol FSCalendarDelegateAppearance <NSObject>
@optional
/**
* 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;
/**
* Asks the delegate for day text color in unselected state for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance titleDefaultColorForDate:(NSDate *)date;
/**
* Asks the delegate for day text color in selected state for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance titleSelectionColorForDate:(NSDate *)date;
/**
* Asks the delegate for subtitle text color in unselected state for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance subtitleDefaultColorForDate:(NSDate *)date;
/**
* Asks the delegate for subtitle text color in selected state for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance subtitleSelectionColorForDate:(NSDate *)date;
/**
* Asks the delegate for single event color for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorForDate:(NSDate *)date;
/**
* Asks the delegate for multiple event colors for the specific date.
*/
- (nullable NSArray *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance eventColorsForDate:(NSDate *)date;
/**
* Asks the delegate for a border color in unselected state for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance borderDefaultColorForDate:(NSDate *)date;
/**
* Asks the delegate for a border color in selected state for the specific date.
*/
- (nullable UIColor *)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance borderSelectionColorForDate:(NSDate *)date;
/**
* Asks the delegate for a shape for the specific date.
*/
- (FSCalendarCellShape)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance cellShapeForDate:(NSDate *)date;
/**
* This function is deprecated
*/
- (FSCalendarCellStyle)calendar:(FSCalendar *)calendar appearance:(FSCalendarAppearance *)appearance cellStyleForDate:(NSDate *)date FSCalendarDeprecated(-calendar:appearance:cellShapeForDate:);
@end
#pragma mark - Primary
IB_DESIGNABLE
@interface FSCalendar : UIView
/**
* The object that acts as the delegate of the calendar.
*/
@property (weak, nonatomic) IBOutlet id<FSCalendarDelegate> delegate;
/**
* The object that acts as the data source of the calendar.
*/
@property (weak, nonatomic) IBOutlet id<FSCalendarDataSource> dataSource;
/**
* A special mark will be put on today of the calendar
*/
@property (strong, nonatomic) NSDate *today;
/**
* The current page of calendar
*
* @desc In week mode, current page represents the current visible week; In month mode, it means current visible month.
*/
@property (strong, nonatomic) NSDate *currentPage;
/**
* The locale of month and weekday symbols. Change it to display them in your own language.
*
* e.g. To display them in Chinese:
*
* 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;
/**
* The scroll direction of FSCalendar.
*
* e.g. To make the calendar scroll vertically
*
* calendar.scrollDirection = FSCalendarScrollDirectionVertical;
*/
@property (assign, nonatomic) FSCalendarScrollDirection scrollDirection;
/**
* The scope of calendar, change scope will trigger an inner frame change, make sure the frame has been correctly adjusted in
*
* - (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated;
*/
@property (assign, nonatomic) FSCalendarScope scope;
/**
* 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.
*/
@property (assign, nonatomic) IBInspectable CGFloat headerHeight;
/**
* 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.
*/
@property (assign, nonatomic) IBInspectable BOOL allowsSelection;
/**
* 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.
*/
@property (assign, nonatomic) IBInspectable BOOL pagingEnabled;
/**
* 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.
*/
@property (assign, nonatomic) IBInspectable BOOL focusOnSingleSelectedDate;
/**
* A Boolean value that determines whether the calendar should show days out of month. Default is YES.
*/
@property (assign, nonatomic) IBInspectable BOOL showsPlaceholders;
@property (readonly, nonatomic) FSCalendarAppearance *appearance;
/**
* A date object representing the minimum day enablevisible and selectable. (read-only)
*/
@property (readonly, nonatomic) NSDate *minimumDate;
/**
* A date object representing the maximum day enablevisible and selectable. (read-only)
*/
@property (readonly, nonatomic) NSDate *maximumDate;
/**
* A date object identifying the section of the selected date. (read-only)
*/
@property (readonly, nonatomic) NSDate *selectedDate;
/**
* The dates representing the selected dates. (read-only)
*/
@property (readonly, nonatomic) NSArray *selectedDates;
/**
* 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.
*/
- (void)setScope:(FSCalendarScope)scope animated:(BOOL)animated;
/**
* Selects a given date in the calendar.
*
* @param date A date in the calendar.
*/
- (void)selectDate:(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.
*/
- (void)selectDate:(NSDate *)date scrollToDate:(BOOL)scrollToDate;
/**
* 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.
*/
- (void)setCurrentPage:(NSDate *)currentPage animated:(BOOL)animated;
@end
#pragma mark - DateTools
/**
* Job for this category:
*
* 1. Manage date object simplierfaster
* 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)
/**
* Returns the number of year of the given date
*/
- (NSInteger)yearOfDate:(NSDate *)date;
/**
* Returns the number of month of the given date
*/
- (NSInteger)monthOfDate:(NSDate *)date;
/**
* Returns the number of day of the given date
*/
- (NSInteger)dayOfDate:(NSDate *)date;
/**
* Returns the number of weekday of the given date
*/
- (NSInteger)weekdayOfDate:(NSDate *)date;
/**
* Returns the number of weekOfYear of the given date
*/
- (NSInteger)weekOfDate:(NSDate *)date;
/**
* Returns the number of hour of the given date
*/
- (NSInteger)hourOfDate:(NSDate *)date;
/**
* Returns the number of minite of the given date
*/
- (NSInteger)miniuteOfDate:(NSDate *)date;
/**
* Returns the number of seconds of the given date
*/
- (NSInteger)secondOfDate:(NSDate *)date;
/**
* Returns the number of rows of the given month
*/
- (NSInteger)numberOfRowsInMonth:(NSDate *)month;
/**
* Zeronizing hourminute and second components of the given date
*/
- (NSDate *)dateByIgnoringTimeComponentsOfDate:(NSDate *)date;
/**
* 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 yearmonth 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;
@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);
@end
NS_ASSUME_NONNULL_END

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
//
// FSCalendarAnimator.h
// FSCalendar
//
// Created by dingwenchao on 3/13/16.
// Copyright © 2016 wenchaoios. All rights reserved.
//
#import <Foundation/Foundation.h>
#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

View File

@ -0,0 +1,394 @@
//
// FSCalendarAnimator.m
// FSCalendar
//
// Created by Wenchao Ding on 3/13/16.
// Copyright © 2016 Wenchao Ding. All rights reserved.
//
#import "FSCalendarAnimator.h"
#import <objc/runtime.h>
#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

View File

@ -0,0 +1,241 @@
//
// FSCalendarAppearance.h
// Pods
//
// Created by DingWenchao on 6/29/15.
// Copyright © 2016 Wenchao Ding. All rights reserved.
//
// https://github.com/WenchaoD
//
#import "FSCalendarConstance.h"
@class FSCalendar;
typedef NS_ENUM(NSInteger, FSCalendarCellState) {
FSCalendarCellStateNormal = 0,
FSCalendarCellStateSelected = 1,
FSCalendarCellStatePlaceholder = 1 << 1,
FSCalendarCellStateDisabled = 1 << 2,
FSCalendarCellStateToday = 1 << 3,
FSCalendarCellStateWeekend = 1 << 4,
FSCalendarCellStateTodaySelected = FSCalendarCellStateToday|FSCalendarCellStateSelected
};
typedef NS_ENUM(NSUInteger, FSCalendarCellShape) {
FSCalendarCellShapeCircle = 0,
FSCalendarCellShapeRectangle = 1
};
typedef NS_OPTIONS(NSUInteger, FSCalendarCaseOptions) {
FSCalendarCaseOptionsHeaderUsesDefaultCase = 0,
FSCalendarCaseOptionsHeaderUsesUpperCase = 1,
FSCalendarCaseOptionsWeekdayUsesDefaultCase = 0 << 4,
FSCalendarCaseOptionsWeekdayUsesUpperCase = 1 << 4,
FSCalendarCaseOptionsWeekdayUsesSingleUpperCase = 2 << 4,
};
/**
* FSCalendarAppearance determines the fonts and colors of components in the calendar.
*
* @see FSCalendarDelegateAppearance
*/
@interface FSCalendarAppearance : NSObject
/**
* 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.
*/
@property (assign, nonatomic) CGFloat titleVerticalOffset;
/**
* The vertical offset of the suntitle text from default position.
*/
@property (assign, nonatomic) CGFloat subtitleVerticalOffset;
/**
* The color of event dots.
*/
@property (strong, nonatomic) UIColor *eventColor;
/**
* The color of weekday text.
*/
@property (strong, nonatomic) UIColor *weekdayTextColor;
/**
* The color of month header text.
*/
@property (strong, nonatomic) UIColor *headerTitleColor;
/**
* The date format of the month header.
*/
@property (strong, nonatomic) NSString *headerDateFormat;
/**
* The alpha value of month label staying on the fringes.
*/
@property (assign, nonatomic) CGFloat headerMinimumDissolvedAlpha;
/**
* The day text color for unselected state.
*/
@property (strong, nonatomic) UIColor *titleDefaultColor;
/**
* The day text color for selected state.
*/
@property (strong, nonatomic) UIColor *titleSelectionColor;
/**
* The day text color for today in the calendar.
*/
@property (strong, nonatomic) UIColor *titleTodayColor;
/**
* The day text color for days out of current month.
*/
@property (strong, nonatomic) UIColor *titlePlaceholderColor;
/**
* The day text color for weekend.
*/
@property (strong, nonatomic) UIColor *titleWeekendColor;
/**
* The subtitle text color for unselected state.
*/
@property (strong, nonatomic) UIColor *subtitleDefaultColor;
/**
* The subtitle text color for selected state.
*/
@property (strong, nonatomic) UIColor *subtitleSelectionColor;
/**
* The subtitle text color for today in the calendar.
*/
@property (strong, nonatomic) UIColor *subtitleTodayColor;
/**
* The subtitle text color for days out of current month.
*/
@property (strong, nonatomic) UIColor *subtitlePlaceholderColor;
/**
* The subtitle text color for weekend.
*/
@property (strong, nonatomic) UIColor *subtitleWeekendColor;
/**
* The fill color of the shape for selected state.
*/
@property (strong, nonatomic) UIColor *selectionColor;
/**
* The fill color of the shape for today.
*/
@property (strong, nonatomic) UIColor *todayColor;
/**
* The fill color of the shape for today and selected state.
*/
@property (strong, nonatomic) UIColor *todaySelectionColor;
/**
* The border color of the shape for unselected state.
*/
@property (strong, nonatomic) UIColor *borderDefaultColor;
/**
* The border color of the shape for selected state.
*/
@property (strong, nonatomic) UIColor *borderSelectionColor;
/**
* The shape appears when a day is selected or today.
*
* @see FSCalendarCellShape
*/
@property (assign, nonatomic) FSCalendarCellShape cellShape;
/**
* The case options manage the case of month label and weekday symbols.
*
* @see FSCalendarCaseOptions
*/
@property (assign, nonatomic) FSCalendarCaseOptions caseOptions;
/**
* A Boolean value indicates whether the calendar should adjust font size by its content size.
*
* @see titleFont
* @see subtitleFont
* @see weekdayFont
* @see headerTitleFont
*/
@property (assign, nonatomic) BOOL adjustsFontSizeToFitContentSize;
#if TARGET_INTERFACE_BUILDER
// For preview only
@property (assign, nonatomic) BOOL fakeSubtitles;
@property (assign, nonatomic) NSInteger fakedSelectedDay;
#endif
/**
* Triggers an appearance update.
*/
- (void)invalidateAppearance;
@end
/**
* These functions and attributes are deprecated.
*/
@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');
@end

View File

@ -0,0 +1,745 @@
//
// FSCalendarAppearance.m
// Pods
//
// Created by DingWenchao on 6/29/15.
// Copyright © 2016 Wenchao Ding. All rights reserved.
//
// https://github.com/WenchaoD
//
#import "FSCalendarAppearance.h"
#import "FSCalendarDynamicHeader.h"
#import "UIView+FSExtension.h"
@interface FSCalendarAppearance ()
@property (weak , nonatomic) FSCalendar *calendar;
@property (strong, nonatomic) NSMutableDictionary *backgroundColors;
@property (strong, nonatomic) NSMutableDictionary *titleColors;
@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
- (instancetype)init
{
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;
_headerTitleColor = FSCalendarStandardTitleTextColor;
_headerDateFormat = @"MMMM yyyy";
_headerMinimumDissolvedAlpha = 0.2;
_weekdayTextColor = FSCalendarStandardTitleTextColor;
_caseOptions = FSCalendarCaseOptionsHeaderUsesDefaultCase|FSCalendarCaseOptionsWeekdayUsesDefaultCase;
_backgroundColors = [NSMutableDictionary dictionaryWithCapacity:5];
_backgroundColors[@(FSCalendarCellStateNormal)] = [UIColor clearColor];
_backgroundColors[@(FSCalendarCellStateSelected)] = FSCalendarStandardSelectionColor;
_backgroundColors[@(FSCalendarCellStateDisabled)] = [UIColor clearColor];
_backgroundColors[@(FSCalendarCellStatePlaceholder)] = [UIColor clearColor];
_backgroundColors[@(FSCalendarCellStateToday)] = FSCalendarStandardTodayColor;
_titleColors = [NSMutableDictionary dictionaryWithCapacity:5];
_titleColors[@(FSCalendarCellStateNormal)] = [UIColor blackColor];
_titleColors[@(FSCalendarCellStateSelected)] = [UIColor whiteColor];
_titleColors[@(FSCalendarCellStateDisabled)] = [UIColor grayColor];
_titleColors[@(FSCalendarCellStatePlaceholder)] = [UIColor lightGrayColor];
_titleColors[@(FSCalendarCellStateToday)] = [UIColor whiteColor];
_subtitleColors = [NSMutableDictionary dictionaryWithCapacity:5];
_subtitleColors[@(FSCalendarCellStateNormal)] = [UIColor darkGrayColor];
_subtitleColors[@(FSCalendarCellStateSelected)] = [UIColor whiteColor];
_subtitleColors[@(FSCalendarCellStateDisabled)] = [UIColor lightGrayColor];
_subtitleColors[@(FSCalendarCellStatePlaceholder)] = [UIColor lightGrayColor];
_subtitleColors[@(FSCalendarCellStateToday)] = [UIColor whiteColor];
_borderColors[@(FSCalendarCellStateSelected)] = [UIColor clearColor];
_borderColors[@(FSCalendarCellStateNormal)] = [UIColor clearColor];
_cellShape = FSCalendarCellShapeCircle;
_eventColor = FSCalendarStandardEventDotColor;
_borderColors = [NSMutableDictionary dictionaryWithCapacity:2];
}
return self;
}
- (void)setTitleFont:(UIFont *)titleFont
{
BOOL needsInvalidating = NO;
if (![_titleFontName isEqualToString:titleFont.fontName]) {
_titleFontName = titleFont.fontName;
needsInvalidating = YES;
}
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 (_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 (_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];
}
}
- (void)setTitleVerticalOffset:(CGFloat)titleVerticalOffset
{
if (_titleVerticalOffset != titleVerticalOffset) {
_titleVerticalOffset = titleVerticalOffset;
[_calendar.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)];
}
}
- (void)setSubtitleVerticalOffset:(CGFloat)subtitleVerticalOffset
{
if (_subtitleVerticalOffset != subtitleVerticalOffset) {
_subtitleVerticalOffset = subtitleVerticalOffset;
[_calendar.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)];
}
}
- (UIFont *)headerTitleFont
{
return [UIFont fontWithName:_headerTitleFontName size:_headerTitleFontSize];
}
- (void)setTitleDefaultColor:(UIColor *)color
{
if (color) {
_titleColors[@(FSCalendarCellStateNormal)] = color;
} else {
[_titleColors removeObjectForKey:@(FSCalendarCellStateNormal)];
}
[self invalidateTitleTextColor];
}
- (UIColor *)titleDefaultColor
{
return _titleColors[@(FSCalendarCellStateNormal)];
}
- (void)setTitleSelectionColor:(UIColor *)color
{
if (color) {
_titleColors[@(FSCalendarCellStateSelected)] = color;
} else {
[_titleColors removeObjectForKey:@(FSCalendarCellStateSelected)];
}
[self invalidateTitleTextColor];
}
- (UIColor *)titleSelectionColor
{
return _titleColors[@(FSCalendarCellStateSelected)];
}
- (void)setTitleTodayColor:(UIColor *)color
{
if (color) {
_titleColors[@(FSCalendarCellStateToday)] = color;
} else {
[_titleColors removeObjectForKey:@(FSCalendarCellStateToday)];
}
[self invalidateTitleTextColor];
}
- (UIColor *)titleTodayColor
{
return _titleColors[@(FSCalendarCellStateToday)];
}
- (void)setTitlePlaceholderColor:(UIColor *)color
{
if (color) {
_titleColors[@(FSCalendarCellStatePlaceholder)] = color;
} else {
[_titleColors removeObjectForKey:@(FSCalendarCellStatePlaceholder)];
}
[self invalidateTitleTextColor];
}
- (UIColor *)titlePlaceholderColor
{
return _titleColors[@(FSCalendarCellStatePlaceholder)];
}
- (void)setTitleWeekendColor:(UIColor *)color
{
if (color) {
_titleColors[@(FSCalendarCellStateWeekend)] = color;
} else {
[_titleColors removeObjectForKey:@(FSCalendarCellStateWeekend)];
}
[self invalidateTitleTextColor];
}
- (UIColor *)titleWeekendColor
{
return _titleColors[@(FSCalendarCellStateWeekend)];
}
- (void)setSubtitleDefaultColor:(UIColor *)color
{
if (color) {
_subtitleColors[@(FSCalendarCellStateNormal)] = color;
} else {
[_subtitleColors removeObjectForKey:@(FSCalendarCellStateNormal)];
}
[self invalidateSubtitleTextColor];
}
-(UIColor *)subtitleDefaultColor
{
return _subtitleColors[@(FSCalendarCellStateNormal)];
}
- (void)setSubtitleSelectionColor:(UIColor *)color
{
if (color) {
_subtitleColors[@(FSCalendarCellStateSelected)] = color;
} else {
[_subtitleColors removeObjectForKey:@(FSCalendarCellStateSelected)];
}
[self invalidateSubtitleTextColor];
}
- (UIColor *)subtitleSelectionColor
{
return _subtitleColors[@(FSCalendarCellStateSelected)];
}
- (void)setSubtitleTodayColor:(UIColor *)color
{
if (color) {
_subtitleColors[@(FSCalendarCellStateToday)] = color;
} else {
[_subtitleColors removeObjectForKey:@(FSCalendarCellStateToday)];
}
[self invalidateSubtitleTextColor];
}
- (UIColor *)subtitleTodayColor
{
return _subtitleColors[@(FSCalendarCellStateToday)];
}
- (void)setSubtitlePlaceholderColor:(UIColor *)color
{
if (color) {
_subtitleColors[@(FSCalendarCellStatePlaceholder)] = color;
} else {
[_subtitleColors removeObjectForKey:@(FSCalendarCellStatePlaceholder)];
}
[self invalidateSubtitleTextColor];
}
- (UIColor *)subtitlePlaceholderColor
{
return _subtitleColors[@(FSCalendarCellStatePlaceholder)];
}
- (void)setSubtitleWeekendColor:(UIColor *)color
{
if (color) {
_subtitleColors[@(FSCalendarCellStateWeekend)] = color;
} else {
[_subtitleColors removeObjectForKey:@(FSCalendarCellStateWeekend)];
}
[self invalidateSubtitleTextColor];
}
- (UIColor *)subtitleWeekendColor
{
return _subtitleColors[@(FSCalendarCellStateWeekend)];
}
- (void)setSelectionColor:(UIColor *)color
{
if (color) {
_backgroundColors[@(FSCalendarCellStateSelected)] = color;
} else {
[_backgroundColors removeObjectForKey:@(FSCalendarCellStateSelected)];
}
[self invalidateBackgroundColors];
}
- (UIColor *)selectionColor
{
return _backgroundColors[@(FSCalendarCellStateSelected)];
}
- (void)setTodayColor:(UIColor *)todayColor
{
if (todayColor) {
_backgroundColors[@(FSCalendarCellStateToday)] = todayColor;
} else {
[_backgroundColors removeObjectForKey:@(FSCalendarCellStateToday)];
}
[self invalidateBackgroundColors];
}
- (UIColor *)todayColor
{
return _backgroundColors[@(FSCalendarCellStateToday)];
}
- (void)setTodaySelectionColor:(UIColor *)todaySelectionColor
{
if (todaySelectionColor) {
_backgroundColors[@(FSCalendarCellStateToday|FSCalendarCellStateSelected)] = todaySelectionColor;
} else {
[_backgroundColors removeObjectForKey:@(FSCalendarCellStateToday|FSCalendarCellStateSelected)];
}
[self invalidateBackgroundColors];
}
- (UIColor *)todaySelectionColor
{
return _backgroundColors[@(FSCalendarCellStateToday|FSCalendarCellStateSelected)];
}
- (void)setEventColor:(UIColor *)eventColor
{
if (![_eventColor isEqual:eventColor]) {
_eventColor = eventColor;
[self invalidateEventColors];
}
}
- (void)setBorderDefaultColor:(UIColor *)color
{
if (color) {
_borderColors[@(FSCalendarCellStateNormal)] = color;
} else {
[_borderColors removeObjectForKey:@(FSCalendarCellStateNormal)];
}
[self invalidateBorderColors];
}
- (UIColor *)borderDefaultColor
{
return _borderColors[@(FSCalendarCellStateNormal)];
}
- (void)setBorderSelectionColor:(UIColor *)color
{
if (color) {
_borderColors[@(FSCalendarCellStateSelected)] = color;
} else {
[_borderColors removeObjectForKey:@(FSCalendarCellStateSelected)];
}
[self invalidateBorderColors];
}
- (UIColor *)borderSelectionColor
{
return _borderColors[@(FSCalendarCellStateSelected)];
}
- (void)setCellShape:(FSCalendarCellShape)cellShape
{
if (_cellShape != cellShape) {
_cellShape = cellShape;
[self invalidateCellShapes];
}
}
- (void)setWeekdayTextColor:(UIColor *)weekdayTextColor
{
if (![_weekdayTextColor isEqual:weekdayTextColor]) {
_weekdayTextColor = weekdayTextColor;
[self invalidateWeekdayTextColor];
}
}
- (void)setHeaderTitleColor:(UIColor *)color
{
if (![_headerTitleColor isEqual:color]) {
_headerTitleColor = color;
[self invalidateHeaderTextColor];
}
}
- (void)setHeaderMinimumDissolvedAlpha:(CGFloat)headerMinimumDissolvedAlpha
{
if (_headerMinimumDissolvedAlpha != headerMinimumDissolvedAlpha) {
_headerMinimumDissolvedAlpha = headerMinimumDissolvedAlpha;
[_calendar.header.collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)];
[_calendar.visibleStickyHeaders makeObjectsPerformSelector:@selector(setNeedsLayout)];
}
}
- (void)setHeaderDateFormat:(NSString *)headerDateFormat
{
if (![_headerDateFormat isEqual:headerDateFormat]) {
_headerDateFormat = headerDateFormat;
[_calendar invalidateHeaders];
}
}
- (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];
}
}
- (void)invalidateAppearance
{
[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];
}
@end
@implementation FSCalendarAppearance (Deprecated)
- (void)setCellStyle:(FSCalendarCellStyle)cellStyle
{
self.cellShape = (FSCalendarCellShape)cellStyle;
}
- (FSCalendarCellStyle)cellStyle
{
return (FSCalendarCellStyle)self.cellShape;
}
- (void)setUseVeryShortWeekdaySymbols:(BOOL)useVeryShortWeekdaySymbols
{
_caseOptions &= 15;
self.caseOptions |= (useVeryShortWeekdaySymbols*FSCalendarCaseOptionsWeekdayUsesSingleUpperCase);
}
- (BOOL)useVeryShortWeekdaySymbols
{
return (_caseOptions & (15<<4) ) == FSCalendarCaseOptionsWeekdayUsesSingleUpperCase;
}
- (void)setAutoAdjustTitleSize:(BOOL)autoAdjustTitleSize
{
self.adjustsFontSizeToFitContentSize = autoAdjustTitleSize;
}
- (BOOL)autoAdjustTitleSize
{
return self.adjustsFontSizeToFitContentSize;
}
- (void)setTitleTextSize:(CGFloat)titleTextSize
{
self.titleFont = [UIFont fontWithName:_titleFontName size:titleTextSize];
}
- (CGFloat)titleTextSize
{
return _titleFontSize;
}
- (void)setSubtitleTextSize:(CGFloat)subtitleTextSize
{
self.subtitleFont = [UIFont fontWithName:_subtitleFontName size:subtitleTextSize];
}
- (CGFloat)subtitleTextSize
{
return _subtitleFontSize;
}
- (void)setWeekdayTextSize:(CGFloat)weekdayTextSize
{
self.weekdayFont = [UIFont fontWithName:_weekdayFontName size:weekdayTextSize];
}
- (CGFloat)weekdayTextSize
{
return _weekdayFontSize;
}
- (void)setHeaderTitleTextSize:(CGFloat)headerTitleTextSize
{
self.headerTitleFont = [UIFont fontWithName:_headerTitleFontName size:headerTitleTextSize];
}
- (CGFloat)headerTitleTextSize
{
return _headerTitleFontSize;
}
- (void)setAdjustsFontSizeToFitCellSize:(BOOL)adjustsFontSizeToFitCellSize
{
self.adjustsFontSizeToFitContentSize = adjustsFontSizeToFitCellSize;
}
- (BOOL)adjustsFontSizeToFitCellSize
{
return self.adjustsFontSizeToFitContentSize;
}
@end

View File

@ -0,0 +1,63 @@
//
// FSCalendarCell.h
// Pods
//
// Created by Wenchao Ding on 12/3/15.
//
//
#import <UIKit/UIKit.h>
#import "FSCalendar.h"
#import "FSCalendarEventIndicator.h"
@interface FSCalendarCell : UICollectionViewCell
@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) BOOL needsAdjustingViewFrame;
@property (assign, nonatomic) NSInteger numberOfEvents;
@property (assign, nonatomic) BOOL dateIsPlaceholder;
@property (assign, nonatomic) BOOL dateIsSelected;
@property (assign, nonatomic) BOOL dateIsToday;
@property (readonly, nonatomic) BOOL weekend;
@property (strong, nonatomic) UIColor *preferredSelectionColor;
@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;
- (void)invalidateTitleFont;
- (void)invalidateSubtitleFont;
- (void)invalidateTitleTextColor;
- (void)invalidateSubtitleTextColor;
- (void)invalidateBorderColors;
- (void)invalidateBackgroundColors;
- (void)invalidateEventColors;
- (void)invalidateCellShapes;
- (void)invalidateImage;
- (UIColor *)colorForCurrentStateInDictionary:(NSDictionary *)dictionary;
- (void)performSelecting;
@end

View File

@ -0,0 +1,377 @@
//
// FSCalendarCell.m
// Pods
//
// Created by Wenchao Ding on 12/3/15.
//
//
#import "FSCalendarCell.h"
#import "FSCalendar.h"
#import "UIView+FSExtension.h"
#import "FSCalendarDynamicHeader.h"
#import "FSCalendarConstance.h"
@interface FSCalendarCell ()
@property (readonly, nonatomic) UIColor *colorForBackgroundLayer;
@property (readonly, nonatomic) UIColor *colorForTitleLabel;
@property (readonly, nonatomic) UIColor *colorForSubtitleLabel;
@property (readonly, nonatomic) UIColor *colorForCellBorder;
@property (readonly, nonatomic) FSCalendarCellShape cellShape;
@end
@implementation FSCalendarCell
#pragma mark - Life cycle
- (instancetype)initWithFrame:(CGRect)frame
{
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;
}
return self;
}
- (void)setBounds:(CGRect)bounds
{
[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;
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];
}
- (void)prepareForReuse
{
[super prepareForReuse];
[CATransaction setDisableActions:YES];
_backgroundLayer.hidden = YES;
[self.contentView.layer removeAnimationForKey:@"opacity"];
}
#pragma mark - Public
- (void)performSelecting
{
_backgroundLayer.hidden = NO;
#define kAnimationDuration FSCalendarDefaultBounceAnimationDuration
CAAnimationGroup *group = [CAAnimationGroup animation];
CABasicAnimation *zoomOut = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
zoomOut.fromValue = @0.3;
zoomOut.toValue = @1.2;
zoomOut.duration = kAnimationDuration/4*3;
CABasicAnimation *zoomIn = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
zoomIn.fromValue = @1.2;
zoomIn.toValue = @1.0;
zoomIn.beginTime = kAnimationDuration/4*3;
zoomIn.duration = kAnimationDuration/4;
group.duration = kAnimationDuration;
group.animations = @[zoomOut, zoomIn];
[_backgroundLayer addAnimation:group forKey:@"bounce"];
[self configureCell];
#undef kAnimationDuration
}
#pragma mark - Private
- (void)configureCell
{
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;
}
if (_subtitle) {
textColor = self.colorForSubtitleLabel;
if (![textColor isEqual:_subtitleLabel.textColor]) {
_subtitleLabel.textColor = textColor;
}
}
UIColor *borderColor = self.colorForCellBorder;
BOOL shouldHiddenBackgroundLayer = !self.selected && !self.dateIsToday && !self.dateIsSelected && !borderColor;
if (_backgroundLayer.hidden != shouldHiddenBackgroundLayer) {
_backgroundLayer.hidden = shouldHiddenBackgroundLayer;
}
if (!shouldHiddenBackgroundLayer) {
CGPathRef path = self.cellShape == FSCalendarCellShapeCircle ?
[UIBezierPath bezierPathWithOvalInRect:_backgroundLayer.bounds].CGPath :
[UIBezierPath bezierPathWithRect:_backgroundLayer.bounds].CGPath;
if (!CGPathEqualToPath(_backgroundLayer.path,path)) {
_backgroundLayer.path = path;
}
CGColorRef backgroundColor = self.colorForBackgroundLayer.CGColor;
if (!CGColorEqualToColor(_backgroundLayer.fillColor, backgroundColor)) {
_backgroundLayer.fillColor = backgroundColor;
}
CGColorRef borderColor = self.colorForCellBorder.CGColor;
if (!CGColorEqualToColor(_backgroundLayer.strokeColor, borderColor)) {
_backgroundLayer.strokeColor = borderColor;
}
}
if (![_image isEqual:_imageView.image]) {
[self invalidateImage];
}
if (_eventIndicator.hidden == (_numberOfEvents > 0)) {
_eventIndicator.hidden = !_numberOfEvents;
}
_eventIndicator.numberOfEvents = self.numberOfEvents;
_eventIndicator.color = self.preferredEventColor ?: _appearance.eventColor;
}
- (BOOL)isWeekend
{
return _date && ([_calendar weekdayOfDate:_date] == 1 || [_calendar weekdayOfDate:_date] == 7);
}
- (UIColor *)colorForCurrentStateInDictionary:(NSDictionary *)dictionary
{
if (self.isSelected || self.dateIsSelected) {
if (self.dateIsToday) {
return dictionary[@(FSCalendarCellStateSelected|FSCalendarCellStateToday)] ?: dictionary[@(FSCalendarCellStateSelected)];
}
return dictionary[@(FSCalendarCellStateSelected)];
}
if (self.dateIsToday && [[dictionary allKeys] containsObject:@(FSCalendarCellStateToday)]) {
return dictionary[@(FSCalendarCellStateToday)];
}
if (self.dateIsPlaceholder && [[dictionary allKeys] containsObject:@(FSCalendarCellStatePlaceholder)]) {
return dictionary[@(FSCalendarCellStatePlaceholder)];
}
if (self.isWeekend && [[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
{
if (self.dateIsSelected || self.isSelected) {
return self.preferredSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.backgroundColors];
}
return [self colorForCurrentStateInDictionary:_appearance.backgroundColors];
}
- (UIColor *)colorForTitleLabel
{
if (self.dateIsSelected || self.isSelected) {
return self.preferredTitleSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.titleColors];
}
return self.preferredTitleDefaultColor ?: [self colorForCurrentStateInDictionary:_appearance.titleColors];
}
- (UIColor *)colorForSubtitleLabel
{
if (self.dateIsSelected || self.isSelected) {
return self.preferredSubtitleSelectionColor ?: [self colorForCurrentStateInDictionary:_appearance.subtitleColors];
}
return self.preferredSubtitleDefaultColor ?: [self colorForCurrentStateInDictionary:_appearance.subtitleColors];
}
- (UIColor *)colorForCellBorder
{
if (self.dateIsSelected || self.isSelected) {
return _preferredBorderSelectionColor ?: _appearance.borderSelectionColor;
}
return _preferredBorderDefaultColor ?: _appearance.borderDefaultColor;
}
- (FSCalendarCellShape)cellShape
{
return _preferredCellShape ?: _appearance.cellShape;
}
- (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];
}
}
- (void)setSubtitle:(NSString *)subtitle
{
if (![_subtitle isEqualToString:subtitle]) {
_needsAdjustingViewFrame = !(_subtitle.length && subtitle.length);
_subtitle = subtitle;
if (_needsAdjustingViewFrame) {
[self setNeedsLayout];
}
}
}
- (void)setNeedsAdjustingViewFrame:(BOOL)needsAdjustingViewFrame
{
if (_needsAdjustingViewFrame != needsAdjustingViewFrame) {
_needsAdjustingViewFrame = needsAdjustingViewFrame;
_eventIndicator.needsAdjustingViewFrame = needsAdjustingViewFrame;
}
}
@end

View File

@ -0,0 +1,13 @@
//
// FSCalendarCollectionView.h
// FSCalendar
//
// Created by Wenchao Ding on 10/25/15.
// Copyright (c) 2015 wenchaoios. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FSCalendarCollectionView : UICollectionView
@end

View File

@ -0,0 +1,62 @@
//
// FSCalendarCollectionView.m
// FSCalendar
//
// Created by Wenchao Ding on 10/25/15.
// Copyright (c) 2015 wenchaoios. All rights reserved.
//
#import "FSCalendarCollectionView.h"
#import "FSCalendarCell.h"
@interface FSCalendarCollectionView ()
- (void)initialize;
@end
@implementation FSCalendarCollectionView
@synthesize scrollsToTop = _scrollsToTop, contentInset = _contentInset;
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout
{
self = [super initWithFrame:frame collectionViewLayout:layout];
if (self) {
[self initialize];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initialize];
}
return self;
}
- (void)initialize
{
self.scrollsToTop = NO;
self.contentInset = UIEdgeInsetsZero;
#ifdef __IPHONE_9_0
if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) {
self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
#endif
}
- (void)setContentInset:(UIEdgeInsets)contentInset
{
[super setContentInset:UIEdgeInsetsZero];
}
- (void)setScrollsToTop:(BOOL)scrollsToTop
{
[super setScrollsToTop:NO];
}
@end

View File

@ -0,0 +1,61 @@
//
// FSCalendarConstane.h
// FSCalendar
//
// Created by dingwenchao on 8/28/15.
// Copyright © 2016 Wenchao Ding. All rights reserved.
//
// https://github.com/WenchaoD
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#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
};

View File

@ -0,0 +1,27 @@
//
// FSCalendarConstane.m
// FSCalendar
//
// Created by dingwenchao on 8/28/15.
// Copyright © 2016 Wenchao Ding. All rights reserved.
//
// https://github.com/WenchaoD
//
#import "FSCalendarConstance.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 FSCalendarAutomaticDimension = -1;
CGFloat const FSCalendarDefaultBounceAnimationDuration = 0.15;
CGFloat const FSCalendarStandardRowHeight = 38+1.0/3;
CGFloat const FSCalendarStandardTitleTextSize = 13.5;
CGFloat const FSCalendarStandardSubtitleTextSize = 10;
CGFloat const FSCalendarStandardWeekdayTextSize = 14;
CGFloat const FSCalendarStandardHeaderTextSize = 16.5;
CGFloat const FSCalendarMaximumEventDotDiameter = 4.8;
NSInteger const FSCalendarDefaultHourComponent = 0;

View File

@ -0,0 +1,88 @@
//
// FSCalendarDynamicHeader.h
// Pods
//
// Created by DingWenchao on 6/29/15.
//
// 动感头文件,仅供框架内部使用。
// Private header, don't use it.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "FSCalendar.h"
#import "FSCalendarCell.h"
#import "FSCalendarHeader.h"
#import "FSCalendarStickyHeader.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) 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) 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;
- (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;
- (CGSize)sizeThatFits:(CGSize)size scope:(FSCalendarScope)scope;
@end
@interface FSCalendarAppearance (Dynamic)
@property (readwrite, nonatomic) FSCalendar *calendar;
@property (readonly, nonatomic) NSDictionary *backgroundColors;
@property (readonly, nonatomic) NSDictionary *titleColors;
@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;
- (void)adjustTitleIfNecessary;
- (void)invalidateFonts;
@end
@interface FSCalendarHeader (Dynamic)
@property (readonly, nonatomic) UICollectionView *collectionView;
@end

View File

@ -0,0 +1,17 @@
//
// FSCalendarEventView.h
// FSCalendar
//
// Created by dingwenchao on 2/3/16.
// Copyright © 2016 wenchaoios. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FSCalendarEventIndicator : UIView
@property (assign, nonatomic) NSInteger numberOfEvents;
@property (strong, nonatomic) id color;
@property (assign, nonatomic) BOOL needsAdjustingViewFrame;
@end

View File

@ -0,0 +1,143 @@
//
// 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

View File

@ -0,0 +1,20 @@
//
// FSCalendarAnimationLayout.h
// FSCalendar
//
// Created by dingwenchao on 1/3/16.
// Copyright © 2016 wenchaoios. All rights reserved.
//
#import <UIKit/UIKit.h>
@class FSCalendar;
typedef NS_ENUM(NSUInteger, FSCalendarScope);
@interface FSCalendarFlowLayout : UICollectionViewFlowLayout <UICollectionViewDelegateFlowLayout>
@property (weak, nonatomic) FSCalendar *calendar;
@end

View File

@ -0,0 +1,86 @@
//
// 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 <objc/runtime.h>
@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

View File

@ -0,0 +1,46 @@
//
// FSCalendarHeader.h
// Pods
//
// Created by Wenchao Ding on 29/1/15.
//
//
#import <UIKit/UIKit.h>
#import "FSCalendarCollectionView.h"
@class FSCalendar,FSCalendarAppearance;
@interface FSCalendarHeader : UIView
@property (weak, nonatomic) FSCalendarCollectionView *collectionView;
@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;
- (void)reloadData;
@end
@interface FSCalendarHeaderCell : UICollectionViewCell
@property (weak, nonatomic) UILabel *titleLabel;
@property (weak, nonatomic) FSCalendarHeader *header;
- (void)invalidateHeaderFont;
- (void)invalidateHeaderTextColor;
@end
@interface FSCalendarHeaderTouchDeliver : UIView
@property (weak, nonatomic) FSCalendar *calendar;
@property (weak, nonatomic) FSCalendarHeader *header;
@end

View File

@ -0,0 +1,321 @@
//
// FSCalendarHeader.m
// Pods
//
// Created by Wenchao Ding on 29/1/15.
//
//
#import "FSCalendar.h"
#import "UIView+FSExtension.h"
#import "FSCalendarHeader.h"
#import "FSCalendarCollectionView.h"
#import "FSCalendarDynamicHeader.h"
@interface FSCalendarHeader ()<UICollectionViewDataSource,UICollectionViewDelegate>
@property (weak, nonatomic) UICollectionViewFlowLayout *collectionViewLayout;
@property (assign, nonatomic) BOOL needsAdjustingMonthPosition;
@end
@implementation FSCalendarHeader
#pragma mark - Life cycle
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initialize];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
[self initialize];
}
return self;
}
- (void)initialize
{
_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);
self.collectionViewLayout = collectionViewLayout;
FSCalendarCollectionView *collectionView = [[FSCalendarCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:collectionViewLayout];
collectionView.scrollEnabled = NO;
collectionView.userInteractionEnabled = NO;
collectionView.backgroundColor = [UIColor clearColor];
collectionView.dataSource = self;
collectionView.delegate = self;
collectionView.showsHorizontalScrollIndicator = NO;
collectionView.showsVerticalScrollIndicator = NO;
[self addSubview:collectionView];
[collectionView registerClass:[FSCalendarHeaderCell class] forCellWithReuseIdentifier:@"cell"];
self.collectionView = collectionView;
}
- (void)layoutSubviews
{
[super layoutSubviews];
if (_needsAdjustingViewFrame) {
_needsAdjustingViewFrame = NO;
_collectionViewLayout.itemSize = CGSizeMake(1, 1);
_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];
}
};
}
- (void)dealloc
{
_collectionView.dataSource = nil;
_collectionView.delegate = nil;
}
#pragma mark - <UICollectionViewDataSource>
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
return 1;
}
- (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;
}
}
return 0;
}
- (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];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
[cell setNeedsLayout];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[_collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)];
}
#pragma mark - Properties
- (void)setCalendar:(FSCalendar *)calendar
{
if (![_calendar isEqual:calendar]) {
_calendar = calendar;
_appearance = calendar.appearance;
}
}
- (void)setScrollOffset:(CGFloat)scrollOffset
{
if (_scrollOffset != scrollOffset) {
_scrollOffset = scrollOffset;
}
_needsAdjustingMonthPosition = YES;
[self setNeedsLayout];
}
- (void)setScrollDirection:(UICollectionViewScrollDirection)scrollDirection
{
if (_scrollDirection != scrollDirection) {
_scrollDirection = scrollDirection;
_collectionViewLayout.scrollDirection = scrollDirection;
_needsAdjustingMonthPosition = YES;
_needsAdjustingViewFrame = YES;
[self setNeedsLayout];
}
}
- (void)setScrollEnabled:(BOOL)scrollEnabled
{
if (_scrollEnabled != scrollEnabled) {
_scrollEnabled = scrollEnabled;
[_collectionView.visibleCells makeObjectsPerformSelector:@selector(setNeedsLayout)];
}
}
#pragma mark - Public
- (void)reloadData
{
[_collectionView reloadData];
}
@end
@implementation FSCalendarHeaderCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
titleLabel.numberOfLines = 0;
[self.contentView addSubview:titleLabel];
self.titleLabel = titleLabel;
}
return self;
}
- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];
_titleLabel.frame = bounds;
}
- (void)layoutSubviews
{
[super layoutSubviews];
self.titleLabel.frame = self.contentView.bounds;
if (self.header.scrollDirection == UICollectionViewScrollDirectionHorizontal) {
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;
} else {
self.contentView.alpha = (position > 0 && 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;
}
}
- (void)invalidateHeaderFont
{
_titleLabel.font = self.header.appearance.preferredHeaderTitleFont;
}
- (void)invalidateHeaderTextColor
{
_titleLabel.textColor = self.header.appearance.headerTitleColor;
}
@end
@implementation FSCalendarHeaderTouchDeliver
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView *hitView = [super hitTest:point withEvent:event];
if (hitView == self) {
return _calendar.collectionView ?: hitView;
}
return hitView;
}
@end

View File

@ -0,0 +1,30 @@
//
// FSCalendarStaticHeader.h
// FSCalendar
//
// Created by dingwenchao on 9/17/15.
// Copyright (c) 2015 wenchaoios. All rights reserved.
//
#import <UIKit/UIKit.h>
@class FSCalendar,FSCalendarAppearance;
@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)invalidateWeekdaySymbols;
@end

View File

@ -0,0 +1,157 @@
//
// FSCalendarStaticHeader.m
// FSCalendar
//
// Created by dingwenchao on 9/17/15.
// Copyright (c) 2015 wenchaoios. All rights reserved.
//
#import "FSCalendarStickyHeader.h"
#import "FSCalendar.h"
#import "UIView+FSExtension.h"
#import "FSCalendarConstance.h"
#import "FSCalendarDynamicHeader.h"
@interface FSCalendarStickyHeader ()
@property (weak, nonatomic) UIView *contentView;
@property (weak, nonatomic) UIView *separator;
@property (assign, nonatomic) BOOL needsAdjustingViewFrame;
@end
@implementation FSCalendarStickyHeader
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
_needsAdjustingViewFrame = YES;
UIView *view;
UILabel *label;
view = [[UIView alloc] initWithFrame:CGRectZero];
view.backgroundColor = [UIColor clearColor];
[self addSubview:view];
self.contentView = view;
label = [[UILabel alloc] initWithFrame:CGRectZero];
label.textAlignment = NSTextAlignmentCenter;
label.numberOfLines = 0;
[_contentView addSubview:label];
self.titleLabel = label;
view = [[UIView alloc] initWithFrame:CGRectZero];
view.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.25];
[_contentView addSubview:view];
self.separator = 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;
}
return self;
}
- (void)layoutSubviews
{
[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);
}
[self reloadData];
}
#pragma mark - Properties
- (void)setCalendar:(FSCalendar *)calendar
{
if (![_calendar isEqual:calendar]) {
_calendar = calendar;
}
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
{
_titleLabel.font = _appearance.headerTitleFont;
}
- (void)invalidateHeaderTextColor
{
_titleLabel.textColor = _appearance.headerTitleColor;
}
- (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

View File

@ -0,0 +1,79 @@
//
// NSDate+FSExtension.h
// Pods
//
// Created by Wenchao Ding on 29/1/15.
//
//
#import <Foundation/Foundation.h>
/**
* 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

View File

@ -0,0 +1,344 @@
//
// 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

View File

@ -0,0 +1,16 @@
//
// NSString+FSExtension.h
// FSCalendar
//
// Created by Wenchao Ding on 8/29/15.
// Copyright (c) 2015 wenchaoios. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (FSExtension)
- (NSDate *)fs_dateWithFormat:(NSString *)format;
- (NSDate *)fs_date;
@end

View File

@ -0,0 +1,26 @@
//
// 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

View File

@ -0,0 +1,21 @@
//
// UIView+FSExtension.h
// Pods
//
// Created by Wenchao Ding on 29/1/15.
//
//
#import <UIKit/UIKit.h>
@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

View File

@ -0,0 +1,73 @@
//
// 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

19
Verdnaturaventas/Pods/FSCalendar/LICENSE generated Normal file
View File

@ -0,0 +1,19 @@
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.

149
Verdnaturaventas/Pods/FSCalendar/README.md generated Normal file
View File

@ -0,0 +1,149 @@
![fscalendar](https://cloud.githubusercontent.com/assets/5186464/6655324/213a814a-cb36-11e4-9add-f80515a83291.png)<br/><br/>
[![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)
# Screenshots
## iPhone
![fscalendar](https://cloud.githubusercontent.com/assets/5186464/10262249/4fabae40-69f2-11e5-97ab-afbacd0a3da2.jpg)
## 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)
# Installation
## CocoaPods:
* For iOS8+: 👍
```ruby
use_frameworks!
pod 'FSCalendar'
```
* For iOS7+:
```ruby
pod 'FSCalendar'
```
* Alternatively to give it a test run, run the command:
```ruby
pod try FSCalendar
```
## Carthage:
* For iOS8+
```ruby
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)
# Setup
## Use Interface Builder
1. Drag an UIView object to ViewController Scene
2. Change the `Custom Class` to `FSCalendar`<br/>
3. Link `dataSource` and `delegate` to the ViewController <br/>
![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
## Or use code
```objc
@property (weak , nonatomic) FSCalendar *calendar;
```
```objc
// In loadView(Recommended) or viewDidLoad
FSCalendar *calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
calendar.dataSource = self;
calendar.delegate = self;
[self.view addSubview:calendar];
self.calendar = calendar;
```
<br/>
## Or swift
* To use `FSCalendar` in swift, you need to [Create Bridge Header](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html) first.
```swift
private weak var calendar: FSCalendar!
```
```swift
// In loadView or viewDidLoad
let calendar = FSCalendar(frame: CGRect(x: 0, y: 0, width: 320, height: 300))
calendar.dataSource = self
calendar.delegate = self
view.addSubview(calendar)
self.calendar = calendar
```
<br/>
## Hide placeholder dates
![fscalendar-showsplaceholder](https://cloud.githubusercontent.com/assets/5186464/13727902/21a90042-e940-11e5-9b9f-392f38cf007d.gif)
1. Set `calendar.showsPlaceholders = NO`;
2. <a id="implement_bounding_rect_will_change"></a> Implement `-calendar:boundingRectWillChange:animated:`
```objc
// For autoLayout
- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated
{
_calendarHeightConstraint.constant = CGRectGetHeight(bounds);
[self.view layoutIfNeeded];
}
```
```objc
// For manual layout
- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated
{
calendar.frame = (CGRect){calendar.frame.origin,bounds.size};
}
```
### <a id="roll_with_interface_builder"></a> 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/)
# If you like this repo
* ***Star*** this repo.
* Send your calendar screenshot or `itunes link address` [here](https://github.com/WenchaoD/FSCalendar/issues/2).
# 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&currency_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&currency_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&currency_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&currency_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`

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/CALayer+FSExtension.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendar+IBExtension.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendar.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarAnimator.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarAppearance.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarCell.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarCollectionView.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarConstance.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarDynamicHeader.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarEventIndicator.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarFlowLayout.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarHeader.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/FSCalendarStickyHeader.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/NSDate+FSExtension.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/NSString+FSExtension.h

View File

@ -0,0 +1 @@
../../../FSCalendar/FSCalendar/UIView+FSExtension.h

10
Verdnaturaventas/Pods/Manifest.lock generated Normal file
View File

@ -0,0 +1,10 @@
PODS:
- FSCalendar (2.0.1)
DEPENDENCIES:
- FSCalendar
SPEC CHECKSUMS:
FSCalendar: 18117308f5876a8f6f0fe572085d543580c2c5e5
COCOAPODS: 0.39.0

View File

@ -0,0 +1,628 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
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, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
650DFB32E50AFECE1EBB68208751A584 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
proxyType = 1;
remoteGlobalIDString = B2619B2813D910DBC9FE9714E0788D55;
remoteInfo = FSCalendar;
};
/* 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 = "<group>"; };
01C90B5BA1ED973CF81DA8D2E5651F43 /* FSCalendarHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarHeader.h; path = FSCalendar/FSCalendarHeader.h; sourceTree = "<group>"; };
0A612F8B03967A88706A41DBBCB40C2F /* FSCalendarEventIndicator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarEventIndicator.h; path = FSCalendar/FSCalendarEventIndicator.h; sourceTree = "<group>"; };
1524B94489B35EDB0193D2795F7AC857 /* FSCalendarAppearance.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarAppearance.m; path = FSCalendar/FSCalendarAppearance.m; sourceTree = "<group>"; };
18D0AC9847ACFE1E70FCA1815B8B6D61 /* FSCalendarCell.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCell.m; path = FSCalendar/FSCalendarCell.m; sourceTree = "<group>"; };
1BB28774480DA728F69EFCE55C620818 /* NSString+FSExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+FSExtension.h"; path = "FSCalendar/NSString+FSExtension.h"; sourceTree = "<group>"; };
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 = "<group>"; };
2CB0C45B63CC86C4C0837D6C3D9095F1 /* FSCalendarCollectionView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarCollectionView.m; path = FSCalendar/FSCalendarCollectionView.m; sourceTree = "<group>"; };
3B885DB0B763A1DCD70285647F631796 /* NSDate+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSDate+FSExtension.m"; path = "FSCalendar/NSDate+FSExtension.m"; sourceTree = "<group>"; };
3CD502FEBD83BB7C9A99531C9B8FF7AA /* FSCalendarHeader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarHeader.m; path = FSCalendar/FSCalendarHeader.m; sourceTree = "<group>"; };
4C016456080B824C14A47832D1EC2588 /* UIView+FSExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+FSExtension.h"; path = "FSCalendar/UIView+FSExtension.h"; sourceTree = "<group>"; };
5265AB2CFE48EE9C37E365DF67299F47 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
57A5F764D689F517AF0A280881C6A35E /* NSString+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+FSExtension.m"; path = "FSCalendar/NSString+FSExtension.m"; sourceTree = "<group>"; };
59A3A667EB647318A5CB7F633A9A7EE3 /* FSCalendarAppearance.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarAppearance.h; path = FSCalendar/FSCalendarAppearance.h; sourceTree = "<group>"; };
5C32D283AFF9767FE04FB3D27A2D93D5 /* FSCalendar.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = FSCalendar.modulemap; sourceTree = "<group>"; };
6026ABDBA74287306D2C9518D545B324 /* UIView+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+FSExtension.m"; path = "FSCalendar/UIView+FSExtension.m"; sourceTree = "<group>"; };
66A12E4D5C211678B2448F9E984899B4 /* FSCalendarConstance.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarConstance.h; path = FSCalendar/FSCalendarConstance.h; sourceTree = "<group>"; };
6C6E65A2E80A14F0FB803523C77B30C5 /* FSCalendarConstance.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarConstance.m; path = FSCalendar/FSCalendarConstance.m; sourceTree = "<group>"; };
6C87C1A5FB3D8DA8F4AD70BDA9D7B44A /* FSCalendar-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FSCalendar-dummy.m"; sourceTree = "<group>"; };
79A9DEDC89FE8336BF5FEDAAF75BF7FC /* Pods.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Pods.modulemap; sourceTree = "<group>"; };
7A73BF15FC5F8D84C8C1E89BC5012F8B /* FSCalendar+IBExtension.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "FSCalendar+IBExtension.h"; path = "FSCalendar/FSCalendar+IBExtension.h"; sourceTree = "<group>"; };
87B213035BAC5F75386F62D3C75D2342 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = "<group>"; };
894E5DA93A9F359521A89826BE6DA777 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = "<group>"; };
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 = "<group>"; };
977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = "<group>"; };
98CD1A2A02AB1888D0D56BE327D56429 /* FSCalendar.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendar.m; path = FSCalendar/FSCalendar.m; sourceTree = "<group>"; };
9B0AF2A7CE74D14448B0D5942BDFBA33 /* FSCalendarFlowLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarFlowLayout.h; path = FSCalendar/FSCalendarFlowLayout.h; sourceTree = "<group>"; };
9B61826B3D452DCC3B687F30A891F0D0 /* FSCalendar-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSCalendar-prefix.pch"; sourceTree = "<group>"; };
9D9EA616D8F785AFE57E49EB2EBB9199 /* FSCalendar+IBExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "FSCalendar+IBExtension.m"; path = "FSCalendar/FSCalendar+IBExtension.m"; sourceTree = "<group>"; };
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 = "<group>"; };
AF45E441F8C6E244BCFEA866579B5C5F /* FSCalendar-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FSCalendar-umbrella.h"; sourceTree = "<group>"; };
B17FE42DA526E38B1BAD0E640FAC0E67 /* FSCalendarEventIndicator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarEventIndicator.m; path = FSCalendar/FSCalendarEventIndicator.m; sourceTree = "<group>"; };
B49CDF768CA3F6526D472C8C650B8FAC /* FSCalendarCell.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCell.h; path = FSCalendar/FSCalendarCell.h; sourceTree = "<group>"; };
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 = "<group>"; };
C960DB8A2528D516D3A13FCCA82C3B66 /* FSCalendarCollectionView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarCollectionView.h; path = FSCalendar/FSCalendarCollectionView.h; sourceTree = "<group>"; };
CBC0F7C552B739C909B650A0F42F7F38 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = "<group>"; };
CC1E62AB45C7FE4D10390474B2FDE645 /* FSCalendar.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendar.h; path = FSCalendar/FSCalendar.h; sourceTree = "<group>"; };
D0405803033A2A777B8E4DFA0C1800ED /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = "<group>"; };
D49228A8363C97A98756ABE725AC608C /* FSCalendarDynamicHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarDynamicHeader.h; path = FSCalendar/FSCalendarDynamicHeader.h; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
E8446514FBAD26C0E18F24A5715AEF67 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
EAE96FA9099CE5E9A94A75A3F757BB9E /* FSCalendarStickyHeader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FSCalendarStickyHeader.h; path = FSCalendar/FSCalendarStickyHeader.h; sourceTree = "<group>"; };
F0D56D8E51D040808E96D623109D9677 /* CALayer+FSExtension.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+FSExtension.m"; path = "FSCalendar/CALayer+FSExtension.m"; sourceTree = "<group>"; };
F9180C6EAEB7510676867403C29B059D /* FSCalendarAnimator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarAnimator.m; path = FSCalendar/FSCalendarAnimator.m; sourceTree = "<group>"; };
F964C9BC17A31A59BCDAD81259391E99 /* FSCalendar.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FSCalendar.xcconfig; sourceTree = "<group>"; };
FF20F0CC674B99CCEC0A85786BDCDB05 /* FSCalendarFlowLayout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FSCalendarFlowLayout.m; path = FSCalendar/FSCalendarFlowLayout.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
24A6EBA9EAE5017F65E804F351F8C1E0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
30D2A77C4197DF77DEAF13D41D97FAB1 /* Foundation.framework in Frameworks */,
B4C6C827EDB0DF9F605FF4C2FA3626E0 /* QuartzCore.framework in Frameworks */,
4960C49802C172EF3469FEC6DCBC1318 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
AB7412433C3884CC52DB362959E37E08 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E20A253E8B32E3679DD1B13844709F26 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0FE21D7E9190CB8FF3DAA291EA7B46F2 /* 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 */,
);
name = "Support Files";
path = "../Target Support Files/FSCalendar";
sourceTree = "<group>";
};
122DA2E5084A4393C29BE363C764795C /* Frameworks */ = {
isa = PBXGroup;
children = (
DA23025FEDA7F7FE2AACB2532BD80D14 /* iOS */,
);
name = Frameworks;
sourceTree = "<group>";
};
1691A473B2A86C771E7F849527F3C2D0 /* Products */ = {
isa = PBXGroup;
children = (
9E3061880F7A3AACACCC69AB2DB69555 /* FSCalendar.framework */,
284826027086B1CAB0D7807EA166B824 /* Pods.framework */,
);
name = Products;
sourceTree = "<group>";
};
1B1414788D00FCDBBFC0ED4163A1B2E6 /* Pods */ = {
isa = PBXGroup;
children = (
5F7358C36BC3B85F670329793E837256 /* FSCalendar */,
);
name = Pods;
sourceTree = "<group>";
};
5F7358C36BC3B85F670329793E837256 /* FSCalendar */ = {
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 */,
);
path = FSCalendar;
sourceTree = "<group>";
};
75D98FF52E597A11900E131B6C4E1ADA /* Pods */ = {
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";
sourceTree = "<group>";
};
7DB346D0F39D3F0E887471402A8071AB = {
isa = PBXGroup;
children = (
BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */,
122DA2E5084A4393C29BE363C764795C /* Frameworks */,
1B1414788D00FCDBBFC0ED4163A1B2E6 /* Pods */,
1691A473B2A86C771E7F849527F3C2D0 /* Products */,
B7B80995527643776607AFFA75B91E24 /* Targets Support Files */,
);
sourceTree = "<group>";
};
B7B80995527643776607AFFA75B91E24 /* Targets Support Files */ = {
isa = PBXGroup;
children = (
75D98FF52E597A11900E131B6C4E1ADA /* Pods */,
);
name = "Targets Support Files";
sourceTree = "<group>";
};
DA23025FEDA7F7FE2AACB2532BD80D14 /* iOS */ = {
isa = PBXGroup;
children = (
91413329813FA6FE5A78842159E69621 /* Foundation.framework */,
E642B1A057ADA2ABEF90BE2417F349C1 /* QuartzCore.framework */,
D9DE615671731BF3AEFB3CB1F984FA8F /* UIKit.framework */,
);
name = iOS;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
848CAA779F22E44C4E79C91F9A46DA84 /* 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 */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FB4C9CC59F9DB94DD02038CB8A40C9A0 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
215F145235E6770BB3B93DD87D011579 /* Pods-umbrella.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
B2619B2813D910DBC9FE9714E0788D55 /* FSCalendar */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E66DDA4D9ACEE4559FE14589C5F582B /* Build configuration list for PBXNativeTarget "FSCalendar" */;
buildPhases = (
4C57AC1B079DBD5A5910873EA4FE09F2 /* Sources */,
24A6EBA9EAE5017F65E804F351F8C1E0 /* Frameworks */,
848CAA779F22E44C4E79C91F9A46DA84 /* Headers */,
);
buildRules = (
);
dependencies = (
);
name = FSCalendar;
productName = FSCalendar;
productReference = 9E3061880F7A3AACACCC69AB2DB69555 /* FSCalendar.framework */;
productType = "com.apple.product-type.framework";
};
DF9645A5A279AE409F149EBF9CA9FB28 /* Pods */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4F0B6230EA55BB6A0230F67E56A65BE6 /* Build configuration list for PBXNativeTarget "Pods" */;
buildPhases = (
FE36D06581A8E1BB3F0CC84A2024D03B /* Sources */,
AB7412433C3884CC52DB362959E37E08 /* Frameworks */,
FB4C9CC59F9DB94DD02038CB8A40C9A0 /* Headers */,
);
buildRules = (
);
dependencies = (
4044EAEAEFFE9E6B3AD494967CAFE787 /* PBXTargetDependency */,
);
name = Pods;
productName = Pods;
productReference = 284826027086B1CAB0D7807EA166B824 /* Pods.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D41D8CD98F00B204E9800998ECF8427E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
};
buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 7DB346D0F39D3F0E887471402A8071AB;
productRefGroup = 1691A473B2A86C771E7F849527F3C2D0 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
B2619B2813D910DBC9FE9714E0788D55 /* FSCalendar */,
DF9645A5A279AE409F149EBF9CA9FB28 /* Pods */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
4C57AC1B079DBD5A5910873EA4FE09F2 /* 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 */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FE36D06581A8E1BB3F0CC84A2024D03B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DF12D28003AF7562B560123341B2D2DB /* Pods-dummy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
4044EAEAEFFE9E6B3AD494967CAFE787 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = FSCalendar;
target = B2619B2813D910DBC9FE9714E0788D55 /* FSCalendar */;
targetProxy = 650DFB32E50AFECE1EBB68208751A584 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
2CF1A55FBC171828E9D217DE4D88EB80 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DA312349A49333542E6F4B36B329960E /* Pods.release.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;
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 = 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;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
9EDB52415BA19124A1FF9CC2D068E0CB /* Release */ = {
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 = NO;
PRODUCT_NAME = FSCalendar;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
};
name = Debug;
};
B3F62574337F328339EF101FE8A1164F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 977577C045EDA9D9D1F46E2598D19FC7 /* Pods.debug.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;
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;
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 = Debug;
};
FB45FFD90572718D82AB9092B750F0CA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A70CDAD61F90AC503C7D04CC22DA2923 /* Debug */,
FB45FFD90572718D82AB9092B750F0CA /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4F0B6230EA55BB6A0230F67E56A65BE6 /* Build configuration list for PBXNativeTarget "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
B3F62574337F328339EF101FE8A1164F /* Debug */,
2CF1A55FBC171828E9D217DE4D88EB80 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7E66DDA4D9ACEE4559FE14589C5F582B /* Build configuration list for PBXNativeTarget "FSCalendar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9A358E1EBC1FE863E275D45887146F83 /* Debug */,
9EDB52415BA19124A1FF9CC2D068E0CB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>FSCalendar.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Pods.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B2619B2813D910DBC9FE9714E0788D55"
BuildableName = "FSCalendar.framework"
BlueprintName = "FSCalendar"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B2619B2813D910DBC9FE9714E0788D55"
BuildableName = "FSCalendar.framework"
BlueprintName = "FSCalendar"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF9645A5A279AE409F149EBF9CA9FB28"
BuildableName = "Pods.framework"
BlueprintName = "Pods"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF9645A5A279AE409F149EBF9CA9FB28"
BuildableName = "Pods.framework"
BlueprintName = "Pods"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>FSCalendar.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
</dict>
<key>Pods.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>B2619B2813D910DBC9FE9714E0788D55</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>DF9645A5A279AE409F149EBF9CA9FB28</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_FSCalendar : NSObject
@end
@implementation PodsDummy_FSCalendar
@end

View File

@ -0,0 +1,4 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif

View File

@ -0,0 +1,22 @@
#import <UIKit/UIKit.h>
#import "CALayer+FSExtension.h"
#import "FSCalendar+IBExtension.h"
#import "FSCalendar.h"
#import "FSCalendarAnimator.h"
#import "FSCalendarAppearance.h"
#import "FSCalendarCell.h"
#import "FSCalendarCollectionView.h"
#import "FSCalendarConstance.h"
#import "FSCalendarDynamicHeader.h"
#import "FSCalendarEventIndicator.h"
#import "FSCalendarFlowLayout.h"
#import "FSCalendarHeader.h"
#import "FSCalendarStickyHeader.h"
#import "NSDate+FSExtension.h"
#import "NSString+FSExtension.h"
#import "UIView+FSExtension.h"
FOUNDATION_EXPORT double FSCalendarVersionNumber;
FOUNDATION_EXPORT const unsigned char FSCalendarVersionString[];

View File

@ -0,0 +1,6 @@
framework module FSCalendar {
umbrella header "FSCalendar-umbrella.h"
export *
module * { export * }
}

View File

@ -0,0 +1,5 @@
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_ROOT = ${SRCROOT}
SKIP_INSTALL = YES

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,26 @@
# 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

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>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.
</string>
<key>Title</key>
<string>FSCalendar</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - http://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>

View File

@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods : NSObject
@end
@implementation PodsDummy_Pods
@end

View File

@ -0,0 +1,91 @@
#!/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

View File

@ -0,0 +1,95 @@
#!/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

View File

@ -0,0 +1,6 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double PodsVersionNumber;
FOUNDATION_EXPORT const unsigned char PodsVersionString[];

View File

@ -0,0 +1,6 @@
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

Some files were not shown because too many files have changed in this diff Show More