From a8d9d936a5696194a528bcb7cc858554778ebb43 Mon Sep 17 00:00:00 2001 From: Vijay Das Date: Tue, 13 Nov 2018 14:38:50 -0600 Subject: [PATCH 1/5] add freefrom answers .txt file --- Sprites-MBP-VijayDas-Questions.rtf | 48 +++ Sprites/Sprites.xcodeproj/project.pbxproj | 341 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Sprites/Sprites/AppDelegate.swift | 36 ++ .../AppIcon.appiconset/Contents.json | 98 +++++ Sprites/Sprites/Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ Sprites/Sprites/Base.lproj/Main.storyboard | 39 ++ Sprites/Sprites/Info.plist | 45 +++ Sprites/Sprites/ViewController.swift | 11 + 11 files changed, 664 insertions(+) create mode 100644 Sprites-MBP-VijayDas-Questions.rtf create mode 100644 Sprites/Sprites.xcodeproj/project.pbxproj create mode 100644 Sprites/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Sprites/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Sprites/Sprites/AppDelegate.swift create mode 100644 Sprites/Sprites/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Sprites/Sprites/Assets.xcassets/Contents.json create mode 100644 Sprites/Sprites/Base.lproj/LaunchScreen.storyboard create mode 100644 Sprites/Sprites/Base.lproj/Main.storyboard create mode 100644 Sprites/Sprites/Info.plist create mode 100644 Sprites/Sprites/ViewController.swift diff --git a/Sprites-MBP-VijayDas-Questions.rtf b/Sprites-MBP-VijayDas-Questions.rtf new file mode 100644 index 0000000..84c6c5d --- /dev/null +++ b/Sprites-MBP-VijayDas-Questions.rtf @@ -0,0 +1,48 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf100 +{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;\f1\fnil\fcharset0 HelveticaNeue-Bold;} +{\colortbl;\red255\green255\blue255;\red27\green31\blue34;\red255\green255\blue255;\red10\green77\blue204; +} +{\*\expandedcolortbl;;\cssrgb\c14118\c16078\c18039;\cssrgb\c100000\c100000\c100000;\cssrgb\c1176\c40000\c83922; +} +{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1} +{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}} +\margl1440\margr1440\vieww33100\viewh17120\viewkind0 +\deftab720 +\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0 +\ls1\ilvl0 +\f0\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0 +Question:\ +Why do we use version control? Under what circumstances would you need version control features and why?\ +\pard\tx720\pardeftab720\partightenfactor0 +\cf2 \cb1 Answer:\ +We use version control to maintain code projects under an organized set of procedures and processes that enable the participation of many contributors and versions of a software application. Version control systems like Git/Githib maintains the integrity and control of changes over time through branching, committing and push capabilities,\ +\ +Question:\ +\cb3 What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them?\cb1 \ +\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0 +\ls2\ilvl0\cf2 \cb3 \kerning1\expnd0\expndtw0 Answer:\ +The far left side of Xcode contains the Navigator pain. This gives the developer a view of all the files associated with a given project including code files, interface files, image/other assets and the info.plist. The center area is the Editor area and is where developers are able to edit files either directly in program files or in Interface Builder using a graphical interface. When in Interface Builder, the Inspector window appears at the far right and allows the set up and configuration of all objects in Interface builder. This allows the assignment of Objects to custom classes, size and layout of objects, and the required settings for any given object.\ +\ +\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0 +\ls2\ilvl0\cf2 \expnd0\expndtw0\kerning0 +Question:\ +How do you center a view in Interface Builder? How do you stretch one?\cb1 \ +\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0 +\ls2\ilvl0\cf2 \cb3 \kerning1\expnd0\expndtw0 Answer:\ +Select the object either with mouse selection or in the Document Pane in Interface builder and using the \'93Add New Constraints\'94 (aka \'93Tie Fighter\'94) to set all sides to \'930\'94 OR use \'93Align\'94 to select both \'93Horizontally in Container\'94 and \'93Vertically in Container\'94. Once these constraints have been set, they can be edited in the Inspector Pane using the settings in the View tab.\ +\ +\ +\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0 +\ls2\ilvl0\cf2 \expnd0\expndtw0\kerning0 +What is SpriteKit and why do people use it?\ +SpriteKIt is a iOS framework for creating 2D touch interactions used especially in game development.\ +\ +\ +\ +\ +\ls2\ilvl0\cb1 \ +\pard\pardeftab720\partightenfactor0 + +\f1\b\fs48 \cf4 \ +} \ No newline at end of file diff --git a/Sprites/Sprites.xcodeproj/project.pbxproj b/Sprites/Sprites.xcodeproj/project.pbxproj new file mode 100644 index 0000000..454af0a --- /dev/null +++ b/Sprites/Sprites.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 27C58A65219B62EE0036E0D0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C58A64219B62EE0036E0D0 /* AppDelegate.swift */; }; + 27C58A67219B62EE0036E0D0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C58A66219B62EE0036E0D0 /* ViewController.swift */; }; + 27C58A6A219B62EE0036E0D0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27C58A68219B62EE0036E0D0 /* Main.storyboard */; }; + 27C58A6C219B62EF0036E0D0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27C58A6B219B62EF0036E0D0 /* Assets.xcassets */; }; + 27C58A6F219B62EF0036E0D0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27C58A6D219B62EF0036E0D0 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 27C58A61219B62EE0036E0D0 /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 27C58A64219B62EE0036E0D0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 27C58A66219B62EE0036E0D0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 27C58A69219B62EE0036E0D0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 27C58A6B219B62EF0036E0D0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 27C58A6E219B62EF0036E0D0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 27C58A70219B62EF0036E0D0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 27C58A5E219B62EE0036E0D0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 27C58A58219B62EE0036E0D0 = { + isa = PBXGroup; + children = ( + 27C58A63219B62EE0036E0D0 /* Sprites */, + 27C58A62219B62EE0036E0D0 /* Products */, + ); + sourceTree = ""; + }; + 27C58A62219B62EE0036E0D0 /* Products */ = { + isa = PBXGroup; + children = ( + 27C58A61219B62EE0036E0D0 /* Sprites.app */, + ); + name = Products; + sourceTree = ""; + }; + 27C58A63219B62EE0036E0D0 /* Sprites */ = { + isa = PBXGroup; + children = ( + 27C58A64219B62EE0036E0D0 /* AppDelegate.swift */, + 27C58A66219B62EE0036E0D0 /* ViewController.swift */, + 27C58A68219B62EE0036E0D0 /* Main.storyboard */, + 27C58A6B219B62EF0036E0D0 /* Assets.xcassets */, + 27C58A6D219B62EF0036E0D0 /* LaunchScreen.storyboard */, + 27C58A70219B62EF0036E0D0 /* Info.plist */, + ); + path = Sprites; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 27C58A60219B62EE0036E0D0 /* Sprites */ = { + isa = PBXNativeTarget; + buildConfigurationList = 27C58A73219B62EF0036E0D0 /* Build configuration list for PBXNativeTarget "Sprites" */; + buildPhases = ( + 27C58A5D219B62EE0036E0D0 /* Sources */, + 27C58A5E219B62EE0036E0D0 /* Frameworks */, + 27C58A5F219B62EE0036E0D0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Sprites; + productName = Sprites; + productReference = 27C58A61219B62EE0036E0D0 /* Sprites.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 27C58A59219B62EE0036E0D0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Vijay Das"; + TargetAttributes = { + 27C58A60219B62EE0036E0D0 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = 27C58A5C219B62EE0036E0D0 /* Build configuration list for PBXProject "Sprites" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 27C58A58219B62EE0036E0D0; + productRefGroup = 27C58A62219B62EE0036E0D0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 27C58A60219B62EE0036E0D0 /* Sprites */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 27C58A5F219B62EE0036E0D0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 27C58A6F219B62EF0036E0D0 /* LaunchScreen.storyboard in Resources */, + 27C58A6C219B62EF0036E0D0 /* Assets.xcassets in Resources */, + 27C58A6A219B62EE0036E0D0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 27C58A5D219B62EE0036E0D0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 27C58A67219B62EE0036E0D0 /* ViewController.swift in Sources */, + 27C58A65219B62EE0036E0D0 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 27C58A68219B62EE0036E0D0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 27C58A69219B62EE0036E0D0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 27C58A6D219B62EF0036E0D0 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 27C58A6E219B62EF0036E0D0 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 27C58A71219B62EF0036E0D0 /* 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; + }; + 27C58A72219B62EF0036E0D0 /* 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; + }; + 27C58A74219B62EF0036E0D0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = F29U3VL727; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = vijaydas.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 27C58A75219B62EF0036E0D0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = F29U3VL727; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = vijaydas.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 27C58A5C219B62EE0036E0D0 /* Build configuration list for PBXProject "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 27C58A71219B62EF0036E0D0 /* Debug */, + 27C58A72219B62EF0036E0D0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 27C58A73219B62EF0036E0D0 /* Build configuration list for PBXNativeTarget "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 27C58A74219B62EF0036E0D0 /* Debug */, + 27C58A75219B62EF0036E0D0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 27C58A59219B62EE0036E0D0 /* Project object */; +} diff --git a/Sprites/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sprites/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..842b16c --- /dev/null +++ b/Sprites/Sprites.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Sprites/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sprites/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Sprites/Sprites.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Sprites/Sprites/AppDelegate.swift b/Sprites/Sprites/AppDelegate.swift new file mode 100644 index 0000000..1a51d31 --- /dev/null +++ b/Sprites/Sprites/AppDelegate.swift @@ -0,0 +1,36 @@ +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + return true + } + +// func applicationWillResignActive(_ application: UIApplication) { +// // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. +// // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +// } +// +// func applicationDidEnterBackground(_ application: UIApplication) { +// // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. +// // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +// } +// +// func applicationWillEnterForeground(_ application: UIApplication) { +// // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +// } +// +// func applicationDidBecomeActive(_ application: UIApplication) { +// // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +// } +// +// func applicationWillTerminate(_ application: UIApplication) { +// // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +// } +// + +} + diff --git a/Sprites/Sprites/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprites/Sprites/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Sprites/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/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/Sprites/Base.lproj/LaunchScreen.storyboard b/Sprites/Sprites/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/Sprites/Sprites/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprites/Sprites/Base.lproj/Main.storyboard b/Sprites/Sprites/Base.lproj/Main.storyboard new file mode 100644 index 0000000..2b0d84d --- /dev/null +++ b/Sprites/Sprites/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprites/Sprites/Info.plist b/Sprites/Sprites/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/Sprites/Sprites/Info.plist @@ -0,0 +1,45 @@ + + + + + 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 + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprites/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift new file mode 100644 index 0000000..d625d1d --- /dev/null +++ b/Sprites/Sprites/ViewController.swift @@ -0,0 +1,11 @@ +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + +} + From 88162866b3973adfbb692f8de3d2662c427a1d73 Mon Sep 17 00:00:00 2001 From: Vijay Das Date: Tue, 13 Nov 2018 15:01:20 -0600 Subject: [PATCH 2/5] add CustomScene class, SpriteView and single color persistent node function (MVP for project) --- Sprites/Sprites.xcodeproj/project.pbxproj | 4 ++++ Sprites/Sprites/Base.lproj/Main.storyboard | 3 +++ Sprites/Sprites/CustomScene.swift | 16 ++++++++++++++++ Sprites/Sprites/ViewController.swift | 13 +++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 Sprites/Sprites/CustomScene.swift diff --git a/Sprites/Sprites.xcodeproj/project.pbxproj b/Sprites/Sprites.xcodeproj/project.pbxproj index 454af0a..f45e3e3 100644 --- a/Sprites/Sprites.xcodeproj/project.pbxproj +++ b/Sprites/Sprites.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 27C0EFA6219B6FB30066C9DC /* CustomScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C0EFA5219B6FB30066C9DC /* CustomScene.swift */; }; 27C58A65219B62EE0036E0D0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C58A64219B62EE0036E0D0 /* AppDelegate.swift */; }; 27C58A67219B62EE0036E0D0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27C58A66219B62EE0036E0D0 /* ViewController.swift */; }; 27C58A6A219B62EE0036E0D0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27C58A68219B62EE0036E0D0 /* Main.storyboard */; }; @@ -15,6 +16,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 27C0EFA5219B6FB30066C9DC /* CustomScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScene.swift; sourceTree = ""; }; 27C58A61219B62EE0036E0D0 /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; 27C58A64219B62EE0036E0D0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27C58A66219B62EE0036E0D0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -56,6 +58,7 @@ children = ( 27C58A64219B62EE0036E0D0 /* AppDelegate.swift */, 27C58A66219B62EE0036E0D0 /* ViewController.swift */, + 27C0EFA5219B6FB30066C9DC /* CustomScene.swift */, 27C58A68219B62EE0036E0D0 /* Main.storyboard */, 27C58A6B219B62EF0036E0D0 /* Assets.xcassets */, 27C58A6D219B62EF0036E0D0 /* LaunchScreen.storyboard */, @@ -137,6 +140,7 @@ files = ( 27C58A67219B62EE0036E0D0 /* ViewController.swift in Sources */, 27C58A65219B62EE0036E0D0 /* AppDelegate.swift in Sources */, + 27C0EFA6219B6FB30066C9DC /* CustomScene.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sprites/Sprites/Base.lproj/Main.storyboard b/Sprites/Sprites/Base.lproj/Main.storyboard index 2b0d84d..7312a78 100644 --- a/Sprites/Sprites/Base.lproj/Main.storyboard +++ b/Sprites/Sprites/Base.lproj/Main.storyboard @@ -31,6 +31,9 @@ + + + diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift new file mode 100644 index 0000000..42170b1 --- /dev/null +++ b/Sprites/Sprites/CustomScene.swift @@ -0,0 +1,16 @@ +import Foundation +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/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift index d625d1d..7ba48b5 100644 --- a/Sprites/Sprites/ViewController.swift +++ b/Sprites/Sprites/ViewController.swift @@ -1,7 +1,20 @@ import UIKit +import SpriteKit class ViewController: UIViewController { + @IBOutlet weak var skview: SKView! + + + var skscene: CustomScene? = nil + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + skscene = CustomScene(size: view.bounds.size) + skview.presentScene(skscene) + + } + override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. From 7d3d2c2fba9e58dec1ecf193b6008f32d284358a Mon Sep 17 00:00:00 2001 From: Vijay Das Date: Tue, 13 Nov 2018 16:01:07 -0600 Subject: [PATCH 3/5] add random color at touch location, add sequence action to zoom and unzoom node at touch location --- Sprites/Sprites/CustomScene.swift | 28 ++++++++++++++++++++++++---- Sprites/Sprites/ViewController.swift | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index 42170b1..9742c64 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -3,14 +3,34 @@ 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 } + 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) + } + let node = SKShapeNode(circleOfRadius: 8) - node.fillColor = .red - node.position = touch.location(in: self) addChild(node) - - } + node.fillColor = randomColor() + // record touchposition + node.position = touch.location(in: self) +// node.position = touch.location(in: self) + +// let centerAction = node.location(CGPoint(x: frame.midX, y: frame.midY)) +// let touchPositionAction = node.position(touchPosition) + let zoomAction = SKAction.scale(by: 1.3, duration: 0.3) + let unzoomAction = SKAction.scale(by: 1.0, duration: 0.1) + let sequenceAction = SKAction.sequence([zoomAction, unzoomAction]) + node.run(sequenceAction) + + } + } diff --git a/Sprites/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift index 7ba48b5..846ee14 100644 --- a/Sprites/Sprites/ViewController.swift +++ b/Sprites/Sprites/ViewController.swift @@ -19,6 +19,8 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } + + } From 1f8bbf21b40babd45fc8b9f6f7e7632f2409ea71 Mon Sep 17 00:00:00 2001 From: Vijay Das Date: Tue, 13 Nov 2018 16:35:55 -0600 Subject: [PATCH 4/5] add moveaction to start at center and move to touch position in sequence action --- Sprites/Sprites/CustomScene.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index 9742c64..64ba3df 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -20,15 +20,20 @@ class CustomScene: SKScene { let node = SKShapeNode(circleOfRadius: 8) addChild(node) node.fillColor = randomColor() + node.position = (CGPoint(x: frame.midX, y: frame.midY)) // record touchposition - node.position = touch.location(in: self) +// node.location(CGPoint(x: frame.midX, y: frame.midY)) + let touchPosition = touch.location(in: self) + // node.position = touch.location(in: self) // let centerAction = node.location(CGPoint(x: frame.midX, y: frame.midY)) // let touchPositionAction = node.position(touchPosition) + let actionDuration = 1.0 + let moveAction = SKAction.move(to: touchPosition, duration: actionDuration) let zoomAction = SKAction.scale(by: 1.3, duration: 0.3) - let unzoomAction = SKAction.scale(by: 1.0, duration: 0.1) - let sequenceAction = SKAction.sequence([zoomAction, unzoomAction]) + let unzoomAction = SKAction.scale(by: 1.0, duration: 1.0) + let sequenceAction = SKAction.sequence([moveAction, zoomAction, unzoomAction, moveAction]) node.run(sequenceAction) } From 9e64d7744f1d78377d7b6e67d0cbfb1772138959 Mon Sep 17 00:00:00 2001 From: Vijay Das Date: Tue, 13 Nov 2018 18:49:08 -0600 Subject: [PATCH 5/5] cleaned up code comments, moved random color function outside outside func per Dillon, made some setting tweaks to make nodes more fun to watch --- Sprites/Sprites/CustomScene.swift | 28 ++++++++++++---------------- Sprites/Sprites/ViewController.swift | 4 ---- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index 64ba3df..f24ee6c 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -8,34 +8,30 @@ class CustomScene: SKScene { guard !touches.isEmpty, let touch = touches.first else { return } - 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) - } - + let node = SKShapeNode(circleOfRadius: 8) addChild(node) node.fillColor = randomColor() node.position = (CGPoint(x: frame.midX, y: frame.midY)) - // record touchposition -// node.location(CGPoint(x: frame.midX, y: frame.midY)) - let touchPosition = touch.location(in: self) -// node.position = touch.location(in: self) + let touchPosition = touch.location(in: self) -// let centerAction = node.location(CGPoint(x: frame.midX, y: frame.midY)) -// let touchPositionAction = node.position(touchPosition) let actionDuration = 1.0 let moveAction = SKAction.move(to: touchPosition, duration: actionDuration) - let zoomAction = SKAction.scale(by: 1.3, duration: 0.3) - let unzoomAction = SKAction.scale(by: 1.0, duration: 1.0) + let zoomAction = SKAction.scale(by: 2.4, duration: 0.3) + let unzoomAction = SKAction.scale(by: 0.5, duration: 0.3) let sequenceAction = SKAction.sequence([moveAction, zoomAction, unzoomAction, moveAction]) 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/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift index 846ee14..048125d 100644 --- a/Sprites/Sprites/ViewController.swift +++ b/Sprites/Sprites/ViewController.swift @@ -17,10 +17,6 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. } - - - }