diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..01bc231 Binary files /dev/null and b/.DS_Store differ diff --git a/CustomScene.swift b/CustomScene.swift new file mode 100644 index 0000000..249184b --- /dev/null +++ b/CustomScene.swift @@ -0,0 +1,22 @@ +// +// CustomScene.swift +// Sprites +// +// Created by Rob Herold on 11/13/18. +// Copyright © 2018 Rob Herold. All rights reserved. +// + +import UIKit +import SpriteKit + +class CustomScene: SKScene { + public override func touchesBegan(_ touches: Set, with event: UIEvent?) { + guard !touches.isEmpty, let touch = touches.first + else { return } + + let node = SKShapeNode(circleOfRadius: 8) + node.fillColor = .red + node.position = touch.location(in: self) + addChild(node) + } +} diff --git a/Sprites QandA.rtf b/Sprites QandA.rtf new file mode 100644 index 0000000..11d7c18 --- /dev/null +++ b/Sprites QandA.rtf @@ -0,0 +1,30 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;\red100\green100\blue100; +} +{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c100000\c100000\c100000;\cssrgb\c46667\c46667\c46667; +} +\margl1440\margr1440\vieww29040\viewh18500\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\partightenfactor0 + +\f0\fs36 \cf0 1. Why do we use version control? Under what circumstances would you need version control features and why?\ +\ +\cf2 We use version control to track changes made to an app or apps. Version control also lets us step forward and backward in the process to access specific versions later if we need to, and \cb3 \expnd0\expndtw0\kerning0 +\outl0\strokewidth0 \strokec4 it allows you to add features to your app without disturbing the original source code.\'a0\cb1 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 It can even be used to compare changes to the code over time.\ +\cf0 \ +2. What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them?\ +\ +The Navigator area is the left-most area in the main Xcode window. It shows the name of the project, its associated .swift files, Main.storyboard, assets and .plists. This area lets us select the pieces of the project that we need to work on.\ +\ +The Editor area takes up the middle portion of the Xcode window and can show different things including a source editor, a project editor, the Interface Builder, property list (plist) editor, and a rich text editor, depending on what you select in a Navigator toolbar.\ +\ +The Inspectors area is on the right edge of the main window, and when it\'92s displayed, depending on what\'92s selected on the main storyboard, it allows you to change font sizes, change colors of various elements, align text, precisely resize elements, and so on.\ +\ +3. How do you center a view in Interface Builder? How do you stretch one?\ +\ +A view can be centered in Interface Builder by selecting the \'93Align\'94 button and a view can be stretched by using the \'93Add New Constraints\'94 button. Both buttons are in the lower right-hand corner of the Editor area.\ +\ +4. What is SpriteKit and why do people use it?\ +\ +SpriteKit is a rendering and animation framework that can be used to build 2D sprite-based games and game features. It\'92s useful for creating games and apps that need flexibility in how animations are handled.\ +} \ No newline at end of file diff --git a/Sprites.xcodeproj/project.pbxproj b/Sprites.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b7d4325 --- /dev/null +++ b/Sprites.xcodeproj/project.pbxproj @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + BD14B8E3219B72AF00484BF6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD14B8E2219B72AF00484BF6 /* AppDelegate.swift */; }; + BD14B8E5219B72AF00484BF6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD14B8E4219B72AF00484BF6 /* ViewController.swift */; }; + BD14B8E8219B72AF00484BF6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD14B8E6219B72AF00484BF6 /* Main.storyboard */; }; + BD14B8EA219B72B000484BF6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD14B8E9219B72B000484BF6 /* Assets.xcassets */; }; + BD14B8ED219B72B000484BF6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD14B8EB219B72B000484BF6 /* LaunchScreen.storyboard */; }; + BD14B8F5219B732E00484BF6 /* CustomScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD14B8F4219B732E00484BF6 /* CustomScene.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + BD14B8DF219B72AF00484BF6 /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BD14B8E2219B72AF00484BF6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + BD14B8E4219B72AF00484BF6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + BD14B8E7219B72AF00484BF6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + BD14B8E9219B72B000484BF6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BD14B8EC219B72B000484BF6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + BD14B8EE219B72B000484BF6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BD14B8F4219B732E00484BF6 /* CustomScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScene.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BD14B8DC219B72AF00484BF6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + BD14B8D6219B72AF00484BF6 = { + isa = PBXGroup; + children = ( + BD14B8E1219B72AF00484BF6 /* Sprites */, + BD14B8E0219B72AF00484BF6 /* Products */, + ); + sourceTree = ""; + }; + BD14B8E0219B72AF00484BF6 /* Products */ = { + isa = PBXGroup; + children = ( + BD14B8DF219B72AF00484BF6 /* Sprites.app */, + ); + name = Products; + sourceTree = ""; + }; + BD14B8E1219B72AF00484BF6 /* Sprites */ = { + isa = PBXGroup; + children = ( + BD14B8E2219B72AF00484BF6 /* AppDelegate.swift */, + BD14B8E4219B72AF00484BF6 /* ViewController.swift */, + BD14B8F4219B732E00484BF6 /* CustomScene.swift */, + BD14B8E6219B72AF00484BF6 /* Main.storyboard */, + BD14B8E9219B72B000484BF6 /* Assets.xcassets */, + BD14B8EB219B72B000484BF6 /* LaunchScreen.storyboard */, + BD14B8EE219B72B000484BF6 /* Info.plist */, + ); + path = Sprites; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BD14B8DE219B72AF00484BF6 /* Sprites */ = { + isa = PBXNativeTarget; + buildConfigurationList = BD14B8F1219B72B000484BF6 /* Build configuration list for PBXNativeTarget "Sprites" */; + buildPhases = ( + BD14B8DB219B72AF00484BF6 /* Sources */, + BD14B8DC219B72AF00484BF6 /* Frameworks */, + BD14B8DD219B72AF00484BF6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Sprites; + productName = Sprites; + productReference = BD14B8DF219B72AF00484BF6 /* Sprites.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BD14B8D7219B72AF00484BF6 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Rob Herold"; + TargetAttributes = { + BD14B8DE219B72AF00484BF6 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = BD14B8DA219B72AF00484BF6 /* Build configuration list for PBXProject "Sprites" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = BD14B8D6219B72AF00484BF6; + productRefGroup = BD14B8E0219B72AF00484BF6 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BD14B8DE219B72AF00484BF6 /* Sprites */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BD14B8DD219B72AF00484BF6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BD14B8ED219B72B000484BF6 /* LaunchScreen.storyboard in Resources */, + BD14B8EA219B72B000484BF6 /* Assets.xcassets in Resources */, + BD14B8E8219B72AF00484BF6 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + BD14B8DB219B72AF00484BF6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BD14B8E5219B72AF00484BF6 /* ViewController.swift in Sources */, + BD14B8E3219B72AF00484BF6 /* AppDelegate.swift in Sources */, + BD14B8F5219B732E00484BF6 /* CustomScene.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + BD14B8E6219B72AF00484BF6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BD14B8E7219B72AF00484BF6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + BD14B8EB219B72B000484BF6 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BD14B8EC219B72B000484BF6 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + BD14B8EF219B72B000484BF6 /* 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 = "iPhone 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; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + 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; + }; + BD14B8F0219B72B000484BF6 /* 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 = "iPhone 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; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + BD14B8F2219B72B000484BF6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = NBF6MEV9S8; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.rdherold.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + BD14B8F3219B72B000484BF6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = NBF6MEV9S8; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.rdherold.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BD14B8DA219B72AF00484BF6 /* Build configuration list for PBXProject "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD14B8EF219B72B000484BF6 /* Debug */, + BD14B8F0219B72B000484BF6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BD14B8F1219B72B000484BF6 /* Build configuration list for PBXNativeTarget "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD14B8F2219B72B000484BF6 /* Debug */, + BD14B8F3219B72B000484BF6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BD14B8D7219B72AF00484BF6 /* Project object */; +} diff --git a/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..842b16c --- /dev/null +++ b/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Sprites.xcodeproj/project.xcworkspace/xcuserdata/rderek.xcuserdatad/UserInterfaceState.xcuserstate b/Sprites.xcodeproj/project.xcworkspace/xcuserdata/rderek.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0ad696c Binary files /dev/null and b/Sprites.xcodeproj/project.xcworkspace/xcuserdata/rderek.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Sprites.xcodeproj/xcuserdata/rderek.xcuserdatad/xcschemes/xcschememanagement.plist b/Sprites.xcodeproj/xcuserdata/rderek.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..79f8821 --- /dev/null +++ b/Sprites.xcodeproj/xcuserdata/rderek.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Sprites.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/Sprites/.DS_Store b/Sprites/.DS_Store new file mode 100644 index 0000000..e4f8dc3 Binary files /dev/null and b/Sprites/.DS_Store differ diff --git a/Sprites/AppDelegate.swift b/Sprites/AppDelegate.swift new file mode 100644 index 0000000..e42ab0f --- /dev/null +++ b/Sprites/AppDelegate.swift @@ -0,0 +1,9 @@ +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + +} + diff --git a/Sprites/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprites/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Sprites/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/Sprites/Assets.xcassets/Contents.json b/Sprites/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Sprites/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprites/Base.lproj/LaunchScreen.storyboard b/Sprites/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/Sprites/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprites/Base.lproj/Main.storyboard b/Sprites/Base.lproj/Main.storyboard new file mode 100644 index 0000000..948210b --- /dev/null +++ b/Sprites/Base.lproj/Main.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprites/CustomScene.swift b/Sprites/CustomScene.swift new file mode 100644 index 0000000..fa69e7c --- /dev/null +++ b/Sprites/CustomScene.swift @@ -0,0 +1,35 @@ +import UIKit +import SpriteKit + +class CustomScene: SKScene { + public override func touchesBegan(_ touches: Set, with event: UIEvent?) { + guard !touches.isEmpty, let touch = touches.first + else { return } + + let node = SKShapeNode(circleOfRadius: 8) + node.fillColor = randomColor() + node.position = touch.location(in: self) + addChild(node) + + // zooms the node to 130% + let zoomAction = SKAction.scale(by: 1.3, duration: 0.3) + let unzoomAction = SKAction.scale(to: 1.0, duration: 0.1) + let sequenceAction = SKAction.sequence([zoomAction, unzoomAction]) + + node.run(sequenceAction) + + } + + } + + func randomColor() -> UIColor { + let red = CGFloat.random(in: 0.5...1.0) + let green = CGFloat.random(in: 0.5...1.0) + let blue = CGFloat.random(in: 0.5...1.0) + + return UIColor(red: red, green: green, blue: blue, alpha: 1.0) + } + + + + diff --git a/Sprites/Info.plist b/Sprites/Info.plist new file mode 100644 index 0000000..89d7858 --- /dev/null +++ b/Sprites/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprites/Sprites/Assets.xcassets/Contents.json b/Sprites/Sprites/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Sprites/Sprites/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprites/ViewController.swift b/Sprites/ViewController.swift new file mode 100644 index 0000000..dc1e096 --- /dev/null +++ b/Sprites/ViewController.swift @@ -0,0 +1,24 @@ +// +// ViewController.swift +// Sprites +// +// Created by Rob Herold on 11/13/18. +// Copyright © 2018 Rob Herold. All rights reserved. +// + +import UIKit +import SpriteKit + +class ViewController: UIViewController { + @IBOutlet var skview: SKView! + + var skscene: CustomScene? = nil + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + skscene = CustomScene(size: view.bounds.size) + skview.presentScene(skscene) + } + +} +