Initial commit
This commit is contained in:
commit
165fef8bcd
19 changed files with 962 additions and 0 deletions
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## User settings
|
||||
xcuserdata/
|
||||
|
||||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
|
||||
*.xcscmblueprint
|
||||
*.xccheckout
|
||||
|
||||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
|
||||
build/
|
||||
DerivedData/
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
|
||||
.DS_Store
|
||||
377
holidaycalendar.xcodeproj/project.pbxproj
Normal file
377
holidaycalendar.xcodeproj/project.pbxproj
Normal file
|
|
@ -0,0 +1,377 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2E2E824021A666900059405A /* HolidayCalendarWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E2E823F21A666900059405A /* HolidayCalendarWindowController.swift */; };
|
||||
2E331C8F21A232DF00AD1DD3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E331C8E21A232DF00AD1DD3 /* AppDelegate.swift */; };
|
||||
2E331C9121A232DF00AD1DD3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2E331C9021A232DF00AD1DD3 /* Assets.xcassets */; };
|
||||
2E331C9D21A236B400AD1DD3 /* HolidayCalendarCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E331C9C21A236B400AD1DD3 /* HolidayCalendarCollectionViewController.swift */; };
|
||||
2E331C9F21A23F2C00AD1DD3 /* HolidayCalendarFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E331C9E21A23F2C00AD1DD3 /* HolidayCalendarFlowLayout.swift */; };
|
||||
2E9680AF21B4CC310083AA84 /* HolidayCalendarToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9680AE21B4CC310083AA84 /* HolidayCalendarToolbar.swift */; };
|
||||
2E9680B121B4CD300083AA84 /* HolidayCalendarCollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9680B021B4CD300083AA84 /* HolidayCalendarCollectionViewItem.swift */; };
|
||||
2E9680B521B4E84C0083AA84 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9680B421B4E84C0083AA84 /* Utils.swift */; };
|
||||
2E9680B721B4F63B0083AA84 /* HolidayCalendarHelpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9680B621B4F63B0083AA84 /* HolidayCalendarHelpViewController.swift */; };
|
||||
2E9680B921B4F7180083AA84 /* HolidayCalendarDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E9680B821B4F7180083AA84 /* HolidayCalendarDataSource.swift */; };
|
||||
2EF97EE321B41E670087AC41 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF97EE221B41E670087AC41 /* main.swift */; };
|
||||
2EF97EE521B425720087AC41 /* HolidayCalendarMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EF97EE421B425720087AC41 /* HolidayCalendarMenu.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2E2E823F21A666900059405A /* HolidayCalendarWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarWindowController.swift; sourceTree = "<group>"; };
|
||||
2E331C8B21A232DF00AD1DD3 /* holidaycalendar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = holidaycalendar.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2E331C8E21A232DF00AD1DD3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
2E331C9021A232DF00AD1DD3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
2E331C9521A232DF00AD1DD3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
2E331C9621A232DF00AD1DD3 /* holidaycalendar.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = holidaycalendar.entitlements; sourceTree = "<group>"; };
|
||||
2E331C9C21A236B400AD1DD3 /* HolidayCalendarCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarCollectionViewController.swift; sourceTree = "<group>"; };
|
||||
2E331C9E21A23F2C00AD1DD3 /* HolidayCalendarFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarFlowLayout.swift; sourceTree = "<group>"; };
|
||||
2E9680AE21B4CC310083AA84 /* HolidayCalendarToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarToolbar.swift; sourceTree = "<group>"; };
|
||||
2E9680B021B4CD300083AA84 /* HolidayCalendarCollectionViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarCollectionViewItem.swift; sourceTree = "<group>"; };
|
||||
2E9680B421B4E84C0083AA84 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
|
||||
2E9680B621B4F63B0083AA84 /* HolidayCalendarHelpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarHelpViewController.swift; sourceTree = "<group>"; };
|
||||
2E9680B821B4F7180083AA84 /* HolidayCalendarDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarDataSource.swift; sourceTree = "<group>"; };
|
||||
2EF97EE221B41E670087AC41 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
|
||||
2EF97EE421B425720087AC41 /* HolidayCalendarMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HolidayCalendarMenu.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2E331C8821A232DF00AD1DD3 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2E331C8221A232DF00AD1DD3 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2E331C8D21A232DF00AD1DD3 /* holidaycalendar */,
|
||||
2E331C8C21A232DF00AD1DD3 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2E331C8C21A232DF00AD1DD3 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2E331C8B21A232DF00AD1DD3 /* holidaycalendar.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2E331C8D21A232DF00AD1DD3 /* holidaycalendar */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2E9680BC21B4F7CB0083AA84 /* Toolbar */,
|
||||
2E9680BB21B4F7B80083AA84 /* HolidayCalendarView */,
|
||||
2E9680BA21B4F7930083AA84 /* Application */,
|
||||
2E331C9021A232DF00AD1DD3 /* Assets.xcassets */,
|
||||
2E331C9521A232DF00AD1DD3 /* Info.plist */,
|
||||
2E331C9621A232DF00AD1DD3 /* holidaycalendar.entitlements */,
|
||||
);
|
||||
path = holidaycalendar;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2E9680BA21B4F7930083AA84 /* Application */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2E9680B421B4E84C0083AA84 /* Utils.swift */,
|
||||
2E331C8E21A232DF00AD1DD3 /* AppDelegate.swift */,
|
||||
2E2E823F21A666900059405A /* HolidayCalendarWindowController.swift */,
|
||||
2EF97EE221B41E670087AC41 /* main.swift */,
|
||||
2EF97EE421B425720087AC41 /* HolidayCalendarMenu.swift */,
|
||||
);
|
||||
path = Application;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2E9680BB21B4F7B80083AA84 /* HolidayCalendarView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2E331C9C21A236B400AD1DD3 /* HolidayCalendarCollectionViewController.swift */,
|
||||
2E331C9E21A23F2C00AD1DD3 /* HolidayCalendarFlowLayout.swift */,
|
||||
2E9680B021B4CD300083AA84 /* HolidayCalendarCollectionViewItem.swift */,
|
||||
2E9680B821B4F7180083AA84 /* HolidayCalendarDataSource.swift */,
|
||||
);
|
||||
path = HolidayCalendarView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2E9680BC21B4F7CB0083AA84 /* Toolbar */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2E9680AE21B4CC310083AA84 /* HolidayCalendarToolbar.swift */,
|
||||
2E9680B621B4F63B0083AA84 /* HolidayCalendarHelpViewController.swift */,
|
||||
);
|
||||
path = Toolbar;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2E331C8A21A232DF00AD1DD3 /* holidaycalendar */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2E331C9921A232DF00AD1DD3 /* Build configuration list for PBXNativeTarget "holidaycalendar" */;
|
||||
buildPhases = (
|
||||
2E331C8721A232DF00AD1DD3 /* Sources */,
|
||||
2E331C8821A232DF00AD1DD3 /* Frameworks */,
|
||||
2E331C8921A232DF00AD1DD3 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = holidaycalendar;
|
||||
productName = holidaycalendar;
|
||||
productReference = 2E331C8B21A232DF00AD1DD3 /* holidaycalendar.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
2E331C8321A232DF00AD1DD3 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1010;
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = "Ryan McGrath";
|
||||
TargetAttributes = {
|
||||
2E331C8A21A232DF00AD1DD3 = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 2E331C8621A232DF00AD1DD3 /* Build configuration list for PBXProject "holidaycalendar" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 2E331C8221A232DF00AD1DD3;
|
||||
productRefGroup = 2E331C8C21A232DF00AD1DD3 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2E331C8A21A232DF00AD1DD3 /* holidaycalendar */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
2E331C8921A232DF00AD1DD3 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2E331C9121A232DF00AD1DD3 /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2E331C8721A232DF00AD1DD3 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2E9680B721B4F63B0083AA84 /* HolidayCalendarHelpViewController.swift in Sources */,
|
||||
2E9680B521B4E84C0083AA84 /* Utils.swift in Sources */,
|
||||
2E331C9F21A23F2C00AD1DD3 /* HolidayCalendarFlowLayout.swift in Sources */,
|
||||
2EF97EE321B41E670087AC41 /* main.swift in Sources */,
|
||||
2E2E824021A666900059405A /* HolidayCalendarWindowController.swift in Sources */,
|
||||
2E9680B921B4F7180083AA84 /* HolidayCalendarDataSource.swift in Sources */,
|
||||
2E331C8F21A232DF00AD1DD3 /* AppDelegate.swift in Sources */,
|
||||
2E9680B121B4CD300083AA84 /* HolidayCalendarCollectionViewItem.swift in Sources */,
|
||||
2E331C9D21A236B400AD1DD3 /* HolidayCalendarCollectionViewController.swift in Sources */,
|
||||
2EF97EE521B425720087AC41 /* HolidayCalendarMenu.swift in Sources */,
|
||||
2E9680AF21B4CC310083AA84 /* HolidayCalendarToolbar.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2E331C9721A232DF00AD1DD3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"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;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2E331C9821A232DF00AD1DD3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2E331C9A21A232DF00AD1DD3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = holidaycalendar/holidaycalendar.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = 8JNDBG9U79;
|
||||
INFOPLIST_FILE = holidaycalendar/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.rymc.holidaycalendar;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2E331C9B21A232DF00AD1DD3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = holidaycalendar/holidaycalendar.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = 8JNDBG9U79;
|
||||
INFOPLIST_FILE = holidaycalendar/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.rymc.holidaycalendar;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2E331C8621A232DF00AD1DD3 /* Build configuration list for PBXProject "holidaycalendar" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2E331C9721A232DF00AD1DD3 /* Debug */,
|
||||
2E331C9821A232DF00AD1DD3 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2E331C9921A232DF00AD1DD3 /* Build configuration list for PBXNativeTarget "holidaycalendar" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2E331C9A21A232DF00AD1DD3 /* Debug */,
|
||||
2E331C9B21A232DF00AD1DD3 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 2E331C8321A232DF00AD1DD3 /* Project object */;
|
||||
}
|
||||
7
holidaycalendar.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
holidaycalendar.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/laika/projects/holidaycalendar/holidaycalendar.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -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>
|
||||
24
holidaycalendar/Application/AppDelegate.swift
Normal file
24
holidaycalendar/Application/AppDelegate.swift
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// AppDelegate.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 11/18/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
var windowController: HolidayCalendarWindowController?
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
NSApp.mainMenu = HolidayCalendarMenu()
|
||||
windowController = HolidayCalendarWindowController()
|
||||
windowController?.window?.toolbar = HolidayCalendarToolbar()
|
||||
windowController?.contentViewController = HolidayCalendarCollectionViewController()
|
||||
windowController?.showWindow(self)
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
}
|
||||
}
|
||||
28
holidaycalendar/Application/HolidayCalendarMenu.swift
Normal file
28
holidaycalendar/Application/HolidayCalendarMenu.swift
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// HolidayCalendarMenu.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/2/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
fileprivate func configureApplicationMenu(_ menu: NSMenu) {
|
||||
let menuItem = menu.addItem(withTitle: "Application", action: nil, keyEquivalent: "")
|
||||
let submenu = NSMenu(title: "Application")
|
||||
|
||||
let title = NSLocalizedString("Quit", comment:"Quit menu item") //+ " " + applicationName
|
||||
let quitItem = submenu.addItem(withTitle:title, action:#selector(NSApplication.terminate(_:)), keyEquivalent:"q")
|
||||
quitItem.target = NSApp
|
||||
|
||||
menu.setSubmenu(submenu, for: menuItem)
|
||||
}
|
||||
|
||||
public func HolidayCalendarMenu() -> NSMenu {
|
||||
let menu = NSMenu(title: "MainMenu")
|
||||
|
||||
configureApplicationMenu(menu)
|
||||
|
||||
return menu
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// HolidayCalendarWindowController.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 11/21/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarWindowController: NSWindowController {
|
||||
convenience init() {
|
||||
let styleMask: NSWindow.StyleMask = [.resizable, .miniaturizable, .closable, .titled]
|
||||
let initialRect = CGRect(x: 100.0, y: 100.0, width: 600.0, height: 350.0)
|
||||
let appWindow = NSWindow(contentRect: initialRect, styleMask: styleMask, backing: .buffered, defer: false)
|
||||
appWindow.backgroundColor = Styles.windowBackgroundColor
|
||||
appWindow.contentMinSize = CGSize(width: 600.0, height: 350.0)
|
||||
appWindow.title = "Holiday Calendar"
|
||||
appWindow.titlebarAppearsTransparent = true
|
||||
appWindow.titleVisibility = .hidden
|
||||
appWindow.appearance = NSAppearance(named: .vibrantDark)
|
||||
|
||||
self.init(window: appWindow)
|
||||
}
|
||||
}
|
||||
26
holidaycalendar/Application/Utils.swift
Normal file
26
holidaycalendar/Application/Utils.swift
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// Utils.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/3/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import Foundation
|
||||
|
||||
struct Styles {
|
||||
static let windowBackgroundColor = NSColor(red: 26.0/255.0, green: 28.0/255.0, blue: 47.0/255.0, alpha: 1)
|
||||
static let presentBackgroundColor = NSColor(red: 236.0/255.0, green: 88.0/255.0, blue: 65.0/255.0, alpha: 1)
|
||||
static let openPresentBackgroundColor = NSColor(red: 60.0/255.0, green: 189.0/255.0, blue: 172.0/255.0, alpha: 1)
|
||||
}
|
||||
|
||||
enum Cells: String {
|
||||
case calendarDay
|
||||
|
||||
var reuseIdentifier: NSUserInterfaceItemIdentifier {
|
||||
switch self {
|
||||
case .calendarDay: return NSUserInterfaceItemIdentifier(rawValue: "LOL")
|
||||
}
|
||||
}
|
||||
}
|
||||
19
holidaycalendar/Application/main.swift
Normal file
19
holidaycalendar/Application/main.swift
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// main.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/2/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
autoreleasepool {
|
||||
let delegate = AppDelegate()
|
||||
withExtendedLifetime(delegate, {
|
||||
let application = NSApplication.shared
|
||||
application.delegate = delegate
|
||||
application.run()
|
||||
application.delegate = nil
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
6
holidaycalendar/Assets.xcassets/Contents.json
Normal file
6
holidaycalendar/Assets.xcassets/Contents.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// HolidayCalendarCollectionView.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 11/18/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarCollectionViewController: NSViewController {
|
||||
var layout = HolidayCalendarFlowLayout()
|
||||
var dataSource = HolidayCalendarDataSource()
|
||||
|
||||
override func loadView() {
|
||||
let collectionView = NSCollectionView(frame: .zero)
|
||||
collectionView.collectionViewLayout = layout
|
||||
collectionView.delegate = layout
|
||||
collectionView.dataSource = dataSource
|
||||
collectionView.register(HolidayCalendarCollectionViewItem.self, forItemWithIdentifier: Cells.calendarDay.reuseIdentifier)
|
||||
collectionView.allowsEmptySelection = true
|
||||
collectionView.allowsMultipleSelection = false
|
||||
collectionView.isSelectable = true
|
||||
collectionView.backgroundColors = [Styles.windowBackgroundColor]
|
||||
view = collectionView
|
||||
}
|
||||
|
||||
convenience init() {
|
||||
self.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
//
|
||||
// HolidayCalendarCollectionViewItem.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/3/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarCollectionViewItem: NSCollectionViewItem {
|
||||
public var leftAnchor: NSLayoutConstraint?
|
||||
public var initialTouchOne: NSTouch?
|
||||
public var initialTouchTwo: NSTouch?
|
||||
public var currentTouchOne: NSTouch?
|
||||
public var currentTouchTwo: NSTouch?
|
||||
public var initialPoint: CGPoint?
|
||||
public var isTracking = false
|
||||
|
||||
public lazy var contentView: NSView = {
|
||||
let view = NSView(frame: .zero)
|
||||
view.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.wantsLayer = true
|
||||
view.layer?.backgroundColor = Styles.presentBackgroundColor.cgColor
|
||||
return view
|
||||
}()
|
||||
|
||||
public lazy var dayLabel: NSTextField = {
|
||||
let label = NSTextField.init(labelWithString: "")
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
label.font = NSFont(name: "Impact", size: 32.0)
|
||||
label.alignment = .center
|
||||
return label
|
||||
}()
|
||||
|
||||
override func loadView() {
|
||||
let itemView = NSView(frame: .zero)
|
||||
itemView.postsFrameChangedNotifications = false
|
||||
itemView.postsBoundsChangedNotifications = false
|
||||
itemView.wantsLayer = true
|
||||
itemView.layer?.backgroundColor = Styles.openPresentBackgroundColor.cgColor
|
||||
itemView.allowedTouchTypes = [.direct, .indirect]
|
||||
|
||||
contentView.addSubview(dayLabel)
|
||||
itemView.addSubview(contentView)
|
||||
|
||||
leftAnchor = contentView.leftAnchor.constraint(equalTo: itemView.leftAnchor)
|
||||
NSLayoutConstraint.activate([
|
||||
dayLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 18.0),
|
||||
dayLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
|
||||
dayLabel.widthAnchor.constraint(equalTo: contentView.widthAnchor),
|
||||
|
||||
contentView.topAnchor.constraint(equalTo: itemView.topAnchor),
|
||||
leftAnchor!,
|
||||
contentView.bottomAnchor.constraint(equalTo: itemView.bottomAnchor),
|
||||
contentView.widthAnchor.constraint(equalTo: itemView.widthAnchor),
|
||||
])
|
||||
|
||||
view = itemView
|
||||
}
|
||||
|
||||
override func touchesBegan(with event: NSEvent) {
|
||||
if(isTracking) { return }
|
||||
|
||||
let initialTouches = event.touches(matching: .touching, in: view)
|
||||
if(initialTouches.count != 2) { return }
|
||||
|
||||
isTracking = true
|
||||
initialPoint = view.convert(event.locationInWindow, from: nil)
|
||||
|
||||
let touches = Array(initialTouches)
|
||||
initialTouchOne = touches[0]
|
||||
initialTouchTwo = touches[1]
|
||||
currentTouchOne = touches[0]
|
||||
currentTouchTwo = touches[1]
|
||||
}
|
||||
|
||||
override func touchesMoved(with event: NSEvent) {
|
||||
if(!isTracking) { return }
|
||||
|
||||
let currentTouches = event.touches(matching: .touching, in: view)
|
||||
if(currentTouches.count != 2) { return }
|
||||
|
||||
currentTouchOne = nil
|
||||
currentTouchTwo = nil
|
||||
|
||||
currentTouches.forEach { (touch: NSTouch) in
|
||||
if(touch.identity.isEqual(initialTouchOne?.identity)) {
|
||||
currentTouchOne = touch
|
||||
} else {
|
||||
currentTouchTwo = touch
|
||||
}
|
||||
}
|
||||
|
||||
let initialXPoint = [
|
||||
initialTouchOne?.normalizedPosition.x ?? 0.0,
|
||||
initialTouchTwo?.normalizedPosition.x ?? 0.0
|
||||
].min() ?? 0.0
|
||||
|
||||
let currentXPoint = [
|
||||
currentTouchOne?.normalizedPosition.x ?? 0.0,
|
||||
currentTouchTwo?.normalizedPosition.x ?? 0.0
|
||||
].min() ?? 0.0
|
||||
|
||||
let deviceWidth = initialTouchOne?.deviceSize.width ?? 0.0
|
||||
let oldX = (initialXPoint * deviceWidth).rounded(.up)
|
||||
let newX = (currentXPoint * deviceWidth).rounded(.up)
|
||||
|
||||
var delta: CGFloat = 0.0
|
||||
if(oldX > newX) { // Swiping left
|
||||
delta = (oldX - newX) * -1.0
|
||||
} else if(newX > oldX) { // Swiping right
|
||||
delta = newX - oldX
|
||||
}
|
||||
|
||||
NSAnimationContext.runAnimationGroup { [weak self] (context: NSAnimationContext) in
|
||||
context.timingFunction = CAMediaTimingFunction(name: .easeIn)
|
||||
context.duration = 0.2
|
||||
context.allowsImplicitAnimation = true
|
||||
self?.leftAnchor?.animator().constant = delta
|
||||
}
|
||||
}
|
||||
|
||||
func endTracking(_ delta: CGFloat) {
|
||||
initialTouchOne = nil
|
||||
initialTouchTwo = nil
|
||||
currentTouchOne = nil
|
||||
currentTouchTwo = nil
|
||||
isTracking = false
|
||||
|
||||
let leftThreshold: CGFloat = 50.0
|
||||
let rightThreshold: CGFloat = -50.0
|
||||
var to: CGFloat = 0.0
|
||||
|
||||
if(delta > leftThreshold) {
|
||||
to = leftThreshold
|
||||
} else if(delta < rightThreshold) {
|
||||
to = rightThreshold
|
||||
}
|
||||
|
||||
NSAnimationContext.runAnimationGroup { [weak self] (context: NSAnimationContext) in
|
||||
context.timingFunction = CAMediaTimingFunction(name: .easeIn)
|
||||
context.duration = 0.5
|
||||
context.allowsImplicitAnimation = true
|
||||
self?.leftAnchor?.animator().constant = to
|
||||
}
|
||||
}
|
||||
|
||||
override func touchesEnded(with event: NSEvent) {
|
||||
if(self.isTracking) {
|
||||
self.endTracking(leftAnchor?.constant ?? 0)
|
||||
}
|
||||
}
|
||||
|
||||
override func touchesCancelled(with event: NSEvent) {
|
||||
if(self.isTracking) {
|
||||
self.endTracking(leftAnchor?.constant ?? 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// HolidayCalendarDataSource.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/3/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarDataSource: NSObject, NSCollectionViewDataSource {
|
||||
func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return 25
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
|
||||
guard let item = collectionView.makeItem(withIdentifier: Cells.calendarDay.reuseIdentifier, for: indexPath) as? HolidayCalendarCollectionViewItem else {
|
||||
fatalError("Couldn't get a valid NSCollectionViewItem. Did the type change or something...?")
|
||||
}
|
||||
|
||||
item.dayLabel.stringValue = String(indexPath.item + 1)
|
||||
return item
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// HolidayCalendarFlowLayout.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 11/18/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarFlowLayout: NSCollectionViewFlowLayout, NSCollectionViewDelegateFlowLayout {
|
||||
override init() {
|
||||
super.init()
|
||||
sectionInset = NSEdgeInsetsMake(10, 10, 10, 10)
|
||||
minimumInteritemSpacing = 10.0
|
||||
minimumLineSpacing = 10.0
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: NSCollectionView, layout: NSCollectionViewLayout, sizeForItemAt: IndexPath) -> NSSize {
|
||||
return NSSize(width: 74.0, height: 74.0)
|
||||
}
|
||||
}
|
||||
|
||||
extension HolidayCalendarFlowLayout: NSCollectionViewDelegate {
|
||||
|
||||
}
|
||||
30
holidaycalendar/Info.plist
Normal file
30
holidaycalendar/Info.plist
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?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>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></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>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2018 Ryan McGrath. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// HolidayCalendarHelpViewController.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/3/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarHelpViewController: NSViewController {
|
||||
override func loadView() {
|
||||
let label = NSTextField(wrappingLabelWithString: "This is just a demo! Two-finger swipe right on a day with your trackpad.")
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
let rootView = NSView(frame: CGRect(x: 0.0, y: 0.0, width: 300.0, height: 150.0))
|
||||
rootView.addSubview(label)
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
label.topAnchor.constraint(equalTo: rootView.topAnchor, constant: 10.0),
|
||||
label.leadingAnchor.constraint(equalTo: rootView.leadingAnchor, constant: 10.0),
|
||||
label.trailingAnchor.constraint(equalTo: rootView.trailingAnchor, constant: -10.0),
|
||||
label.bottomAnchor.constraint(equalTo: rootView.bottomAnchor, constant: -10.0)
|
||||
])
|
||||
|
||||
view = rootView
|
||||
}
|
||||
}
|
||||
46
holidaycalendar/Toolbar/HolidayCalendarToolbar.swift
Normal file
46
holidaycalendar/Toolbar/HolidayCalendarToolbar.swift
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
//
|
||||
// HolidayCalendarToolbar.swift
|
||||
// holidaycalendar
|
||||
//
|
||||
// Created by Ryan McGrath on 12/3/18.
|
||||
// Copyright © 2018 Ryan McGrath. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class HolidayCalendarToolbar: NSToolbar {
|
||||
convenience init() {
|
||||
self.init(identifier: "DefaultToolbar")
|
||||
delegate = self
|
||||
}
|
||||
|
||||
lazy var helpButton: NSButton = {
|
||||
return NSButton(title: "Help", target: self, action: #selector(onHelpPressed))
|
||||
}()
|
||||
|
||||
@objc func onHelpPressed() {
|
||||
let popover = NSPopover()
|
||||
popover.behavior = .transient
|
||||
popover.contentSize = CGSize(width: 300.0, height: 150.0)
|
||||
popover.contentViewController = HolidayCalendarHelpViewController()
|
||||
popover.show(relativeTo: .zero, of: helpButton, preferredEdge: .maxY)
|
||||
}
|
||||
}
|
||||
|
||||
extension HolidayCalendarToolbar: NSToolbarDelegate {
|
||||
func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
|
||||
let item = NSToolbarItem(itemIdentifier: itemIdentifier)
|
||||
|
||||
if(itemIdentifier.rawValue == "HelpButton") {
|
||||
item.view = helpButton
|
||||
item.minSize = CGSize(width: 80.0, height: 24.0)
|
||||
item.maxSize = CGSize(width: 80.0, height: 24.0)
|
||||
}
|
||||
|
||||
return item
|
||||
}
|
||||
|
||||
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
|
||||
return [.flexibleSpace, NSToolbarItem.Identifier("HelpButton")]
|
||||
}
|
||||
}
|
||||
10
holidaycalendar/holidaycalendar.entitlements
Normal file
10
holidaycalendar/holidaycalendar.entitlements
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?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>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
Loading…
Add table
Add a link
Reference in a new issue