From d6516740ed30b6c516e9a8abbd336826bd8c2fcd Mon Sep 17 00:00:00 2001 From: Nick Zitzmann Date: Mon, 24 Aug 2020 00:05:57 -0500 Subject: [PATCH] Add a testing app --- RainingCubes.xcodeproj/project.pbxproj | 171 +++++ RainingCubes/RainingCubesView.m | 1 + RainingCubesTest/AppDelegate.swift | 29 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 58 ++ .../Assets.xcassets/Contents.json | 6 + RainingCubesTest/Base.lproj/Main.storyboard | 722 ++++++++++++++++++ RainingCubesTest/BridgingHeader.h | 9 + RainingCubesTest/Info.plist | 32 + .../RainingCubesTest.entitlements | 10 + RainingCubesTest/ViewController.swift | 35 + 11 files changed, 1084 insertions(+) create mode 100644 RainingCubesTest/AppDelegate.swift create mode 100644 RainingCubesTest/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 RainingCubesTest/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 RainingCubesTest/Assets.xcassets/Contents.json create mode 100644 RainingCubesTest/Base.lproj/Main.storyboard create mode 100644 RainingCubesTest/BridgingHeader.h create mode 100644 RainingCubesTest/Info.plist create mode 100644 RainingCubesTest/RainingCubesTest.entitlements create mode 100644 RainingCubesTest/ViewController.swift diff --git a/RainingCubes.xcodeproj/project.pbxproj b/RainingCubes.xcodeproj/project.pbxproj index 9c388d9..ffdeffd 100644 --- a/RainingCubes.xcodeproj/project.pbxproj +++ b/RainingCubes.xcodeproj/project.pbxproj @@ -17,6 +17,16 @@ E0DE1ED31BB376230010DDF0 /* thumbnail.png in Resources */ = {isa = PBXBuildFile; fileRef = E0DE1ED21BB376230010DDF0 /* thumbnail.png */; }; E0DE1ED61BB378450010DDF0 /* RainingCubes.strings in Resources */ = {isa = PBXBuildFile; fileRef = E0DE1ED81BB378450010DDF0 /* RainingCubes.strings */; }; E0DE1ED91BB378740010DDF0 /* RainingCubesConfigureWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0DE1EDB1BB378740010DDF0 /* RainingCubesConfigureWindowController.xib */; }; + E0E6813824F32BF200D79B49 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E6813724F32BF200D79B49 /* AppDelegate.swift */; }; + E0E6813A24F32BF200D79B49 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E6813924F32BF200D79B49 /* ViewController.swift */; }; + E0E6813C24F32BF300D79B49 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E0E6813B24F32BF300D79B49 /* Assets.xcassets */; }; + E0E6813F24F32BF300D79B49 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E0E6813D24F32BF300D79B49 /* Main.storyboard */; }; + E0E6814524F32C1A00D79B49 /* FallingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E0767CEB1B9281A7007A9DE1 /* FallingObject.m */; }; + E0E6814624F32C2200D79B49 /* RainingCubesConfigureWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = E0EEC3EC1BA140B300E061D2 /* RainingCubesConfigureWindowController.m */; }; + E0E6814724F32C2600D79B49 /* RainingCubesConfigureWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0DE1EDB1BB378740010DDF0 /* RainingCubesConfigureWindowController.xib */; }; + E0E6814824F32C2A00D79B49 /* RainingCubesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E0767CDE1B925C4C007A9DE1 /* RainingCubesView.m */; }; + E0E6814924F32C2F00D79B49 /* RainingCubes.strings in Resources */ = {isa = PBXBuildFile; fileRef = E0DE1ED81BB378450010DDF0 /* RainingCubes.strings */; }; + E0E6814A24F32C3200D79B49 /* Shaders.metal in Sources */ = {isa = PBXBuildFile; fileRef = E0767CEE1B928398007A9DE1 /* Shaders.metal */; }; E0EEC3EE1BA140B300E061D2 /* RainingCubesConfigureWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = E0EEC3EB1BA140B300E061D2 /* RainingCubesConfigureWindowController.h */; }; E0EEC3EF1BA140B300E061D2 /* RainingCubesConfigureWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = E0EEC3EC1BA140B300E061D2 /* RainingCubesConfigureWindowController.m */; }; /* End PBXBuildFile section */ @@ -34,6 +44,14 @@ E0DE1ED21BB376230010DDF0 /* thumbnail.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = thumbnail.png; sourceTree = ""; }; E0DE1ED71BB378450010DDF0 /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/RainingCubes.strings; sourceTree = ""; }; E0E6813024F30E5400D79B49 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/RainingCubesConfigureWindowController.xib; sourceTree = ""; }; + E0E6813524F32BF200D79B49 /* RainingCubesTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RainingCubesTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E0E6813724F32BF200D79B49 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + E0E6813924F32BF200D79B49 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + E0E6813B24F32BF300D79B49 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + E0E6813E24F32BF300D79B49 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + E0E6814024F32BF300D79B49 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E0E6814124F32BF300D79B49 /* RainingCubesTest.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RainingCubesTest.entitlements; sourceTree = ""; }; + E0E6814B24F32D3900D79B49 /* BridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BridgingHeader.h; sourceTree = ""; }; E0EEC3EB1BA140B300E061D2 /* RainingCubesConfigureWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RainingCubesConfigureWindowController.h; sourceTree = ""; }; E0EEC3EC1BA140B300E061D2 /* RainingCubesConfigureWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RainingCubesConfigureWindowController.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -46,6 +64,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E0E6813224F32BF200D79B49 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -53,6 +78,7 @@ isa = PBXGroup; children = ( E0767CDB1B925C4C007A9DE1 /* RainingCubes */, + E0E6813624F32BF200D79B49 /* RainingCubesTest */, E0767CDA1B925C4C007A9DE1 /* Products */, ); sourceTree = ""; @@ -61,6 +87,7 @@ isa = PBXGroup; children = ( E0767CD91B925C4C007A9DE1 /* RainingCubes.saver */, + E0E6813524F32BF200D79B49 /* RainingCubesTest.app */, ); name = Products; sourceTree = ""; @@ -85,6 +112,20 @@ path = RainingCubes; sourceTree = ""; }; + E0E6813624F32BF200D79B49 /* RainingCubesTest */ = { + isa = PBXGroup; + children = ( + E0E6813724F32BF200D79B49 /* AppDelegate.swift */, + E0E6813924F32BF200D79B49 /* ViewController.swift */, + E0E6813B24F32BF300D79B49 /* Assets.xcassets */, + E0E6813D24F32BF300D79B49 /* Main.storyboard */, + E0E6814024F32BF300D79B49 /* Info.plist */, + E0E6814124F32BF300D79B49 /* RainingCubesTest.entitlements */, + E0E6814B24F32D3900D79B49 /* BridgingHeader.h */, + ); + path = RainingCubesTest; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -121,17 +162,41 @@ productReference = E0767CD91B925C4C007A9DE1 /* RainingCubes.saver */; productType = "com.apple.product-type.bundle"; }; + E0E6813424F32BF200D79B49 /* RainingCubesTest */ = { + isa = PBXNativeTarget; + buildConfigurationList = E0E6814224F32BF300D79B49 /* Build configuration list for PBXNativeTarget "RainingCubesTest" */; + buildPhases = ( + E0E6813124F32BF200D79B49 /* Sources */, + E0E6813224F32BF200D79B49 /* Frameworks */, + E0E6813324F32BF200D79B49 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RainingCubesTest; + productName = RainingCubesTest; + productReference = E0E6813524F32BF200D79B49 /* RainingCubesTest.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ E0767CD01B925C4C007A9DE1 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1200; LastUpgradeCheck = 1200; ORGANIZATIONNAME = "Nick Zitzmann"; TargetAttributes = { E0767CD81B925C4C007A9DE1 = { CreatedOnToolsVersion = 7.0; + DevelopmentTeam = 8D98N325TG; + ProvisioningStyle = Automatic; + }; + E0E6813424F32BF200D79B49 = { + CreatedOnToolsVersion = 12.0; + ProvisioningStyle = Automatic; }; }; }; @@ -149,6 +214,7 @@ projectRoot = ""; targets = ( E0767CD81B925C4C007A9DE1 /* RainingCubes */, + E0E6813424F32BF200D79B49 /* RainingCubesTest */, ); }; /* End PBXProject section */ @@ -164,6 +230,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E0E6813324F32BF200D79B49 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E0E6813C24F32BF300D79B49 /* Assets.xcassets in Resources */, + E0E6814724F32C2600D79B49 /* RainingCubesConfigureWindowController.xib in Resources */, + E0E6814924F32C2F00D79B49 /* RainingCubes.strings in Resources */, + E0E6813F24F32BF300D79B49 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -178,6 +255,19 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E0E6813124F32BF200D79B49 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E0E6814A24F32C3200D79B49 /* Shaders.metal in Sources */, + E0E6813A24F32BF200D79B49 /* ViewController.swift in Sources */, + E0E6813824F32BF200D79B49 /* AppDelegate.swift in Sources */, + E0E6814624F32C2200D79B49 /* RainingCubesConfigureWindowController.m in Sources */, + E0E6814524F32C1A00D79B49 /* FallingObject.m in Sources */, + E0E6814824F32C2A00D79B49 /* RainingCubesView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ @@ -197,6 +287,14 @@ name = RainingCubesConfigureWindowController.xib; sourceTree = ""; }; + E0E6813D24F32BF300D79B49 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E0E6813E24F32BF300D79B49 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -305,11 +403,15 @@ E0767CE41B925C4C007A9DE1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 8D98N325TG; INFOPLIST_FILE = RainingCubes/Info.plist; INSTALL_PATH = "$(HOME)/Library/Screen Savers"; PRODUCT_BUNDLE_IDENTIFIER = net.comcast.home.seiryu.RainingCubes; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; WRAPPER_EXTENSION = saver; }; name = Debug; @@ -317,15 +419,75 @@ E0767CE51B925C4C007A9DE1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 8D98N325TG; INFOPLIST_FILE = RainingCubes/Info.plist; INSTALL_PATH = "$(HOME)/Library/Screen Savers"; PRODUCT_BUNDLE_IDENTIFIER = net.comcast.home.seiryu.RainingCubes; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; WRAPPER_EXTENSION = saver; }; name = Release; }; + E0E6814324F32BF300D79B49 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = RainingCubesTest/RainingCubesTest.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = RainingCubesTest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = net.comcast.home.seiryu.RainingCubesTest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OBJC_BRIDGING_HEADER = RainingCubesTest/BridgingHeader.h; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + E0E6814424F32BF300D79B49 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = RainingCubesTest/RainingCubesTest.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = RainingCubesTest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = net.comcast.home.seiryu.RainingCubesTest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = RainingCubesTest/BridgingHeader.h; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -347,6 +509,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + E0E6814224F32BF300D79B49 /* Build configuration list for PBXNativeTarget "RainingCubesTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E0E6814324F32BF300D79B49 /* Debug */, + E0E6814424F32BF300D79B49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = E0767CD01B925C4C007A9DE1 /* Project object */; diff --git a/RainingCubes/RainingCubesView.m b/RainingCubes/RainingCubesView.m index 46ab676..fbef238 100644 --- a/RainingCubes/RainingCubesView.m +++ b/RainingCubes/RainingCubesView.m @@ -238,6 +238,7 @@ - (void)startAnimation CVDisplayLinkCreateWithCGDisplay(screensID, &_timer); CVDisplayLinkSetOutputCallback(_timer, DisplayLinkCallback, (__bridge void *)self); } + [self rc_reshape]; CVDisplayLinkStart(_timer); _firstDrawOccurred = NO; // reset the draw timer every time the animation restarts } diff --git a/RainingCubesTest/AppDelegate.swift b/RainingCubesTest/AppDelegate.swift new file mode 100644 index 0000000..f8b9768 --- /dev/null +++ b/RainingCubesTest/AppDelegate.swift @@ -0,0 +1,29 @@ +// +// AppDelegate.swift +// RainingCubesTest +// +// Created by Nick Zitzmann on 8/23/20. +// Copyright © 2020 Nick Zitzmann. All rights reserved. +// + +import Cocoa + +@main +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet var window: NSWindow! + + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} + diff --git a/RainingCubesTest/Assets.xcassets/AccentColor.colorset/Contents.json b/RainingCubesTest/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/RainingCubesTest/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RainingCubesTest/Assets.xcassets/AppIcon.appiconset/Contents.json b/RainingCubesTest/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..3f00db4 --- /dev/null +++ b/RainingCubesTest/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RainingCubesTest/Assets.xcassets/Contents.json b/RainingCubesTest/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/RainingCubesTest/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RainingCubesTest/Base.lproj/Main.storyboard b/RainingCubesTest/Base.lproj/Main.storyboard new file mode 100644 index 0000000..caf87a8 --- /dev/null +++ b/RainingCubesTest/Base.lproj/Main.storyboard @@ -0,0 +1,722 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RainingCubesTest/BridgingHeader.h b/RainingCubesTest/BridgingHeader.h new file mode 100644 index 0000000..e9da20b --- /dev/null +++ b/RainingCubesTest/BridgingHeader.h @@ -0,0 +1,9 @@ +// +// BridgingHeader.h +// RainingCubesTest +// +// Created by Nick Zitzmann on 8/23/20. +// Copyright © 2020 Nick Zitzmann. All rights reserved. +// + +#import "RainingCubesView.h" diff --git a/RainingCubesTest/Info.plist b/RainingCubesTest/Info.plist new file mode 100644 index 0000000..1502eb8 --- /dev/null +++ b/RainingCubesTest/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 Nick Zitzmann. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + diff --git a/RainingCubesTest/RainingCubesTest.entitlements b/RainingCubesTest/RainingCubesTest.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/RainingCubesTest/RainingCubesTest.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/RainingCubesTest/ViewController.swift b/RainingCubesTest/ViewController.swift new file mode 100644 index 0000000..50d1e58 --- /dev/null +++ b/RainingCubesTest/ViewController.swift @@ -0,0 +1,35 @@ +// +// ViewController.swift +// RainingCubesTest +// +// Created by Nick Zitzmann on 8/23/20. +// Copyright © 2020 Nick Zitzmann. All rights reserved. +// + +import Cocoa + +class ViewController: NSViewController { + var rainingCubesView : RainingCubesView! + + override func viewDidAppear() { + rainingCubesView = RainingCubesView.init(frame: CGRect(x: 0.0, y: 0.0, width: self.view.frame.size.width, height: self.view.frame.size.height), isPreview: false) + + super.viewDidAppear() + rainingCubesView!.translatesAutoresizingMaskIntoConstraints = false + self.view.addSubview(rainingCubesView!) + self.view.leadingAnchor.constraint(equalTo: rainingCubesView!.leadingAnchor).isActive = true + self.view.trailingAnchor.constraint(equalTo: rainingCubesView!.trailingAnchor).isActive = true + self.view.topAnchor.constraint(equalTo: rainingCubesView!.topAnchor).isActive = true + self.view.bottomAnchor.constraint(equalTo: rainingCubesView!.bottomAnchor).isActive = true + rainingCubesView?.startAnimation() + } + + @IBAction func preferencesAction(sender: NSMenuItem) { + guard let configureSheet = rainingCubesView.configureSheet else { + return + } + + self.view.window?.beginSheet(configureSheet, completionHandler: nil) + } +} +