Complete Day 32

This commit is contained in:
CypherPoet 2019-10-25 20:24:45 -05:00
parent 21e2df3a1e
commit fceea42c96
16 changed files with 822 additions and 63 deletions

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<Group
location = "container:"
name = "Project 5 - WordScramble">
<FileRef
location = "group:day-029/Projects/WordScramble/WordScramble.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "Project 4 - BetterRest">
<FileRef
location = "group:day-026/Projects/BetterRest/BetterRest.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "Project 1 - WeSplit">
<FileRef
location = "group:day-016/projects/WeSplit/WeSplit.xcodeproj">
</FileRef>
<Group
location = "container:"
name = "WeSplit Refactor - Day 24">
<FileRef
location = "group:day-024/Challenges/Project1Refactor/WeSplit/WeSplit.xcodeproj">
</FileRef>
</Group>
</Group>
<Group
location = "container:"
name = "Project 2 - GuessTheFlag">
<Group
location = "container:"
name = "GuessTheFlag Refactor - Day 24">
<FileRef
location = "group:day-024/Challenges/Project2Refactor/GuessTheFlag/GuessTheFlag.xcodeproj">
</FileRef>
</Group>
<FileRef
location = "group:day-016/projects/WeSplit/../../../day-020/Projects/GuessTheFlag/GuessTheFlag.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "Project 3 - ViewsAndModifiers">
<FileRef
location = "group:day-023/Projects/ViewsAndModifiers/ViewsAndModifiers.xcodeproj">
</FileRef>
</Group>
<FileRef
location = "group:day-019/TheBestConverter/TheBestConverter.xcodeproj">
</FileRef>
<FileRef
location = "group:day-025/RockPaperQuizzers/RockPaperQuizzers.xcodeproj">
</FileRef>
<FileRef
location = "group:README.md">
</FileRef>
</Workspace>

View File

@ -34,10 +34,11 @@ Cheers! ✌️
- **Day 28:** [_Project 4: BetterRest_ (Part Three)](./day-028/)
- **Day 29:** [_Project 5: WordScramble_ (Part One)](./day-029/)
- **Day 30:** [_Project 5: WordScramble_ (Part Two)](./day-030/)
- **Day 31:** [_Project 5: WordScramble_ (Part Three)](./day-031/)
</details>
- **Day 31:** [_Project 5: WordScramble_ (Part Three)](./day-031/)
- **Day 32:** [_Project 6: Animation_ (Part One)](./day-032/)

View File

@ -0,0 +1,355 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
F374C3582363BFD20050A01B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F374C3572363BFD20050A01B /* AppDelegate.swift */; };
F374C35A2363BFD20050A01B /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F374C3592363BFD20050A01B /* SceneDelegate.swift */; };
F374C35E2363BFD40050A01B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F374C35D2363BFD40050A01B /* Assets.xcassets */; };
F374C3612363BFD40050A01B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F374C3602363BFD40050A01B /* Preview Assets.xcassets */; };
F374C3642363BFD40050A01B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F374C3622363BFD40050A01B /* LaunchScreen.storyboard */; };
F374C36D2363BFFE0050A01B /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F374C36C2363BFFE0050A01B /* MainView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
F374C3542363BFD20050A01B /* AnimationSandbox.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimationSandbox.app; sourceTree = BUILT_PRODUCTS_DIR; };
F374C3572363BFD20050A01B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F374C3592363BFD20050A01B /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
F374C35D2363BFD40050A01B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
F374C3602363BFD40050A01B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
F374C3632363BFD40050A01B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
F374C3652363BFD40050A01B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F374C36C2363BFFE0050A01B /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
F374C3512363BFD20050A01B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
F374C34B2363BFD20050A01B = {
isa = PBXGroup;
children = (
F374C3562363BFD20050A01B /* AnimationSandbox */,
F374C3552363BFD20050A01B /* Products */,
);
sourceTree = "<group>";
};
F374C3552363BFD20050A01B /* Products */ = {
isa = PBXGroup;
children = (
F374C3542363BFD20050A01B /* AnimationSandbox.app */,
);
name = Products;
sourceTree = "<group>";
};
F374C3562363BFD20050A01B /* AnimationSandbox */ = {
isa = PBXGroup;
children = (
F374C36B2363BFF50050A01B /* Scenes */,
F374C3572363BFD20050A01B /* AppDelegate.swift */,
F374C3592363BFD20050A01B /* SceneDelegate.swift */,
F374C35D2363BFD40050A01B /* Assets.xcassets */,
F374C3622363BFD40050A01B /* LaunchScreen.storyboard */,
F374C3652363BFD40050A01B /* Info.plist */,
F374C35F2363BFD40050A01B /* Preview Content */,
);
path = AnimationSandbox;
sourceTree = "<group>";
};
F374C35F2363BFD40050A01B /* Preview Content */ = {
isa = PBXGroup;
children = (
F374C3602363BFD40050A01B /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
F374C36B2363BFF50050A01B /* Scenes */ = {
isa = PBXGroup;
children = (
F374C36C2363BFFE0050A01B /* MainView.swift */,
);
path = Scenes;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
F374C3532363BFD20050A01B /* AnimationSandbox */ = {
isa = PBXNativeTarget;
buildConfigurationList = F374C3682363BFD40050A01B /* Build configuration list for PBXNativeTarget "AnimationSandbox" */;
buildPhases = (
F374C3502363BFD20050A01B /* Sources */,
F374C3512363BFD20050A01B /* Frameworks */,
F374C3522363BFD20050A01B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AnimationSandbox;
productName = AnimationSandbox;
productReference = F374C3542363BFD20050A01B /* AnimationSandbox.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
F374C34C2363BFD20050A01B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1120;
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = CypherPoet;
TargetAttributes = {
F374C3532363BFD20050A01B = {
CreatedOnToolsVersion = 11.2;
};
};
};
buildConfigurationList = F374C34F2363BFD20050A01B /* Build configuration list for PBXProject "AnimationSandbox" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = F374C34B2363BFD20050A01B;
productRefGroup = F374C3552363BFD20050A01B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
F374C3532363BFD20050A01B /* AnimationSandbox */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
F374C3522363BFD20050A01B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F374C3642363BFD40050A01B /* LaunchScreen.storyboard in Resources */,
F374C3612363BFD40050A01B /* Preview Assets.xcassets in Resources */,
F374C35E2363BFD40050A01B /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
F374C3502363BFD20050A01B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F374C3582363BFD20050A01B /* AppDelegate.swift in Sources */,
F374C36D2363BFFE0050A01B /* MainView.swift in Sources */,
F374C35A2363BFD20050A01B /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
F374C3622363BFD40050A01B /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
F374C3632363BFD40050A01B /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
F374C3662363BFD40050A01B /* 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;
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
F374C3672363BFD40050A01B /* 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;
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;
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
F374C3692363BFD40050A01B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"AnimationSandbox/Preview Content\"";
DEVELOPMENT_TEAM = QRXXH2RKAG;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = AnimationSandbox/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.cypherpoet.AnimationSandbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
F374C36A2363BFD40050A01B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"AnimationSandbox/Preview Content\"";
DEVELOPMENT_TEAM = QRXXH2RKAG;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = AnimationSandbox/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.cypherpoet.AnimationSandbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
F374C34F2363BFD20050A01B /* Build configuration list for PBXProject "AnimationSandbox" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F374C3662363BFD40050A01B /* Debug */,
F374C3672363BFD40050A01B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
F374C3682363BFD40050A01B /* Build configuration list for PBXNativeTarget "AnimationSandbox" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F374C3692363BFD40050A01B /* Debug */,
F374C36A2363BFD40050A01B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = F374C34C2363BFD20050A01B /* Project object */;
}

View File

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

View File

@ -0,0 +1,37 @@
//
// AppDelegate.swift
// AnimationSandbox
//
// Created by Brian Sipple on 10/25/19.
// Copyright © 2019 CypherPoet. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}

View File

@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,60 @@
<?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>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>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,68 @@
//
// SceneDelegate.swift
// AnimationSandbox
//
// Created by Brian Sipple on 10/25/19.
// Copyright © 2019 CypherPoet. All rights reserved.
//
import UIKit
import SwiftUI
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Use a UIHostingController as window root view controller.
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
// Create the SwiftUI view that provides the window contents.
let contentView = MainView()
.accentColor(.pink)
window.rootViewController = UIHostingController(rootView: contentView)
self.window = window
window.makeKeyAndVisible()
}
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}
func sceneWillResignActive(_ scene: UIScene) {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}
}

View File

@ -0,0 +1,98 @@
//
// MainView.swift
// AnimationSandbox
//
// Created by CypherPoet on 10/25/19.
//
//
import SwiftUI
struct MainView: View {
@State private var scaleDuration: Double = 0.4
@State private var currentBlurRadius: CGFloat = 0.0
@State private var buttonScale: CGFloat = 1.0
@State private var ringOpacity: Double = 1.0
@State private var ringScale: CGFloat = 0
@State private var buttonYRotation: Double = 0.0
}
// MARK: - Body
extension MainView {
var body: some View {
VStack(spacing: 60) {
Button(action: {
withAnimation(.easeInOut(duration: 1.0)) {
self.buttonYRotation += (2.0 * .pi)
}
}) {
Text("Tap Me")
.foregroundColor(.black)
.padding(100)
.background(Color.accentColor)
.clipShape(Circle())
}
.blur(radius: currentBlurRadius / 3)
// .animation(
// Animation.easeInOut(duration: duration)
// .delay(0.1)
// .repeatCount(3, autoreverses: true)
// )
.scaleEffect(buttonScale)
.animation(.easeOut(duration: scaleDuration))
.rotation3DEffect(.radians(buttonYRotation), axis: (x: 0, y: 1, z: 0))
.overlay(pulseRing)
.onAppear {
self.ringScale = 2
self.ringOpacity = 0
}
VStack {
Text("Button Scale")
Slider(
value: $buttonScale,
in: 0.1...1.0,
minimumValueLabel: Text("0.1"),
maximumValueLabel: Text("1")
) {
Text("Button Scale")
}
}
}
.padding()
}
}
// MARK: - View Variables
extension MainView {
var pulseRing: some View {
Circle()
.stroke(Color.accentColor, lineWidth: 4)
.opacity(ringOpacity)
.scaleEffect(ringScale)
.animation(
Animation
.easeOut(duration: 1.0)
.repeatForever(autoreverses: false)
)
}
}
// MARK: - Preview
struct MainView_Previews: PreviewProvider {
static var previews: some View {
MainView()
.accentColor(.pink)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

60
day-032/README.md Normal file
View File

@ -0,0 +1,60 @@
# Day 32: _Project 6: Animation_ (Part One)
_Follow along at https://www.hackingwithswift.com/100/swiftui/32_.
# 📒 Field Notes
This day covers Part One of _`Project 6: Animation`_ in the [100 Days of SwiftUI Challenge](https://www.hackingwithswift.com/100/swiftui/32).
It focuses on several specific topics:
- Animation: Introduction
- Creating implicit animations
- Customizing animations in SwiftUI
- Animating bindings
- Creating explicit animations
## Animation: Introduction
From the description:
> In this technique project were going to look at a range of animations and transitions with SwiftUI.
## Creating implicit animations
With the `.animation()` modifier, we can essentially place a "hook" into our composed view that tells SwiftUI to animate any animatable properties of this view declared _above_ the modifier. Pretty handy.
## Customizing animations in SwiftUI
The spirit of an animation lies in its easing function. Fortunately, SwiftUI gives us plenty of tools to craft easing functions in the argument that we pass to `.animation.`
## Animating bindings
SwiftUI animates by drawing a series of views that "interpolate" between the animation start and end state within a specified duration.
Naturally, this built-in view drawing is a perfect match for reactive view bindings.
# 📸 Screenshots
<div style="text-align: center;">
<img src="./Projects/AnimationSandbox/Screenshots/day-32-recording.gif" width="400px"/>
</div>
# 🔗 Additional Related Links
- One of My Favorite Books: _[The Animator's Survival Kit](http://www.theanimatorssurvivalkit.com/)_
- [Playing with SwiftUI Buttons](https://alejandromp.com/blog/2019/06/09/playing-with-swiftui-buttons/)