From 3fc4497cae1c7a023e33e83899a2c9ddfa2a7c30 Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:23:17 -0600 Subject: [PATCH 01/12] Cloned the Sprites project (MBP) --- Sprites/Sprites.xcodeproj/project.pbxproj | 339 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Sprites/Sprites/AppDelegate.swift | 46 +++ .../AppIcon.appiconset/Contents.json | 98 +++++ Sprites/Sprites/Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ Sprites/Sprites/Base.lproj/Main.storyboard | 24 ++ Sprites/Sprites/Info.plist | 45 +++ Sprites/Sprites/ViewController.swift | 20 ++ 10 files changed, 618 insertions(+) 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/Sprites.xcodeproj/project.pbxproj b/Sprites/Sprites.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6a39168 --- /dev/null +++ b/Sprites/Sprites.xcodeproj/project.pbxproj @@ -0,0 +1,339 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 3774BC11219B69E800A5B24C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC10219B69E800A5B24C /* AppDelegate.swift */; }; + 3774BC13219B69E800A5B24C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC12219B69E800A5B24C /* ViewController.swift */; }; + 3774BC16219B69E800A5B24C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC14219B69E800A5B24C /* Main.storyboard */; }; + 3774BC18219B69E900A5B24C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC17219B69E900A5B24C /* Assets.xcassets */; }; + 3774BC1B219B69E900A5B24C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC19219B69E900A5B24C /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3774BC0D219B69E800A5B24C /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3774BC10219B69E800A5B24C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 3774BC12219B69E800A5B24C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 3774BC15219B69E800A5B24C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 3774BC17219B69E900A5B24C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3774BC1A219B69E900A5B24C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3774BC1C219B69E900A5B24C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3774BC0A219B69E800A5B24C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3774BC04219B69E800A5B24C = { + isa = PBXGroup; + children = ( + 3774BC0F219B69E800A5B24C /* Sprites */, + 3774BC0E219B69E800A5B24C /* Products */, + ); + sourceTree = ""; + }; + 3774BC0E219B69E800A5B24C /* Products */ = { + isa = PBXGroup; + children = ( + 3774BC0D219B69E800A5B24C /* Sprites.app */, + ); + name = Products; + sourceTree = ""; + }; + 3774BC0F219B69E800A5B24C /* Sprites */ = { + isa = PBXGroup; + children = ( + 3774BC10219B69E800A5B24C /* AppDelegate.swift */, + 3774BC12219B69E800A5B24C /* ViewController.swift */, + 3774BC14219B69E800A5B24C /* Main.storyboard */, + 3774BC17219B69E900A5B24C /* Assets.xcassets */, + 3774BC19219B69E900A5B24C /* LaunchScreen.storyboard */, + 3774BC1C219B69E900A5B24C /* Info.plist */, + ); + path = Sprites; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3774BC0C219B69E800A5B24C /* Sprites */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3774BC1F219B69E900A5B24C /* Build configuration list for PBXNativeTarget "Sprites" */; + buildPhases = ( + 3774BC09219B69E800A5B24C /* Sources */, + 3774BC0A219B69E800A5B24C /* Frameworks */, + 3774BC0B219B69E800A5B24C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Sprites; + productName = Sprites; + productReference = 3774BC0D219B69E800A5B24C /* Sprites.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3774BC05219B69E800A5B24C /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1000; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Sameera Leola"; + TargetAttributes = { + 3774BC0C219B69E800A5B24C = { + CreatedOnToolsVersion = 10.0; + }; + }; + }; + buildConfigurationList = 3774BC08219B69E800A5B24C /* Build configuration list for PBXProject "Sprites" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3774BC04219B69E800A5B24C; + productRefGroup = 3774BC0E219B69E800A5B24C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3774BC0C219B69E800A5B24C /* Sprites */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3774BC0B219B69E800A5B24C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3774BC1B219B69E900A5B24C /* LaunchScreen.storyboard in Resources */, + 3774BC18219B69E900A5B24C /* Assets.xcassets in Resources */, + 3774BC16219B69E800A5B24C /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3774BC09219B69E800A5B24C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3774BC13219B69E800A5B24C /* ViewController.swift in Sources */, + 3774BC11219B69E800A5B24C /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 3774BC14219B69E800A5B24C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3774BC15219B69E800A5B24C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 3774BC19219B69E900A5B24C /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3774BC1A219B69E900A5B24C /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3774BC1D219B69E900A5B24C /* 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.0; + 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; + }; + 3774BC1E219B69E900A5B24C /* 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.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3774BC20219B69E900A5B24C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.sameeraleola.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3774BC21219B69E900A5B24C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.sameeraleola.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3774BC08219B69E800A5B24C /* Build configuration list for PBXProject "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3774BC1D219B69E900A5B24C /* Debug */, + 3774BC1E219B69E900A5B24C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3774BC1F219B69E900A5B24C /* Build configuration list for PBXNativeTarget "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3774BC20219B69E900A5B24C /* Debug */, + 3774BC21219B69E900A5B24C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3774BC05219B69E800A5B24C /* 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..13b71f9 --- /dev/null +++ b/Sprites/Sprites/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Sprites +// +// Created by Sameera Leola on 11/13/18. +// Copyright © 2018 Sameera Leola. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + 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..f1bcf38 --- /dev/null +++ b/Sprites/Sprites/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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..04642f2 --- /dev/null +++ b/Sprites/Sprites/ViewController.swift @@ -0,0 +1,20 @@ +// +// ViewController.swift +// Sprites +// +// Created by Sameera Leola on 11/13/18. +// Copyright © 2018 Sameera Leola. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + +} + From f65537770756b407980d1e30b350e2607286e12c Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:25:59 -0600 Subject: [PATCH 02/12] Create Questions --- Questions | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Questions diff --git a/Questions b/Questions new file mode 100644 index 0000000..940b49a --- /dev/null +++ b/Questions @@ -0,0 +1,7 @@ +## Questions: Topic here + +**Question** +Start the answer. I won't need a new line until I start the next question. + +**The next question?** +The next question From d20d3845ad954f721739ae735c98a08a21529cba Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:26:53 -0600 Subject: [PATCH 03/12] Update Questions --- Questions | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Questions b/Questions index 940b49a..1eea006 100644 --- a/Questions +++ b/Questions @@ -1,7 +1,14 @@ -## Questions: Topic here +## Questions: Sprites Project **Question** Start the answer. I won't need a new line until I start the next question. **The next question?** The next question + + + +Why do we use version control? Under what circumstances would you need version control features and why? +What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them? +How do you center a view in Interface Builder? How do you stretch one? +What is SpriteKit and why do people use it? From 2b0355e1c5ccb27005adb70a8e82ff7f53ac972c Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:33:26 -0600 Subject: [PATCH 04/12] Update Questions --- Questions | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Questions b/Questions index 1eea006..e38884d 100644 --- a/Questions +++ b/Questions @@ -1,7 +1,9 @@ ## Questions: Sprites Project -**Question** -Start the answer. I won't need a new line until I start the next question. +**Why do we use version control? Under what circumstances would you need version control features and why?** +Version control provides a safety net for the code being developed. It also facilities collaboration of a team of developers. +Lastly, it contributes to the progression of the development project by allowing developers to write and apply new code to a +copy of the stable code before merging it to the completed portion of the project. **The next question?** The next question From 663c82c6970385b1d49fce579b86c0538699fd87 Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:34:04 -0600 Subject: [PATCH 05/12] Rename Questions to Questions.md --- Questions => Questions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Questions => Questions.md (100%) diff --git a/Questions b/Questions.md similarity index 100% rename from Questions rename to Questions.md From 9c5da25d9886c2d9b20d4283a5bfc83fd72eb158 Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:39:08 -0600 Subject: [PATCH 06/12] Update Questions.md --- Questions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Questions.md b/Questions.md index e38884d..64fd444 100644 --- a/Questions.md +++ b/Questions.md @@ -5,12 +5,12 @@ Version control provides a safety net for the code being developed. It also fac Lastly, it contributes to the progression of the development project by allowing developers to write and apply new code to a copy of the stable code before merging it to the completed portion of the project. -**The next question?** -The next question +**What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them?** +Navigator area: There are several navigators in the navigator ares. The individual navigators keep the various components and tasks that are used in a project organized. + +Inspectors area: This area is on the far right of the workspace window contains the inspectors area. The various inspectors are accessed by selecting the appropriate icon on the inspector bar. The inspector allows editing/setting of object attributes. -Why do we use version control? Under what circumstances would you need version control features and why? -What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them? How do you center a view in Interface Builder? How do you stretch one? What is SpriteKit and why do people use it? From c3191e0dc358207d4c369fe94b2589c361b2940d Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:54:30 -0600 Subject: [PATCH 07/12] Completed the challenge project --- Sprites/Sprites.xcodeproj/project.pbxproj | 122 +++++++++++---------- Sprites/Sprites/Base.lproj/Main.storyboard | 23 +++- Sprites/Sprites/CustomScene.swift | 24 ++++ Sprites/Sprites/ViewController.swift | 13 ++- 4 files changed, 116 insertions(+), 66 deletions(-) create mode 100644 Sprites/Sprites/CustomScene.swift diff --git a/Sprites/Sprites.xcodeproj/project.pbxproj b/Sprites/Sprites.xcodeproj/project.pbxproj index 6a39168..78b17de 100644 --- a/Sprites/Sprites.xcodeproj/project.pbxproj +++ b/Sprites/Sprites.xcodeproj/project.pbxproj @@ -7,25 +7,27 @@ objects = { /* Begin PBXBuildFile section */ - 3774BC11219B69E800A5B24C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC10219B69E800A5B24C /* AppDelegate.swift */; }; - 3774BC13219B69E800A5B24C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC12219B69E800A5B24C /* ViewController.swift */; }; - 3774BC16219B69E800A5B24C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC14219B69E800A5B24C /* Main.storyboard */; }; - 3774BC18219B69E900A5B24C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC17219B69E900A5B24C /* Assets.xcassets */; }; - 3774BC1B219B69E900A5B24C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC19219B69E900A5B24C /* LaunchScreen.storyboard */; }; + 3774BC2F219B6EE800A5B24C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC2E219B6EE800A5B24C /* AppDelegate.swift */; }; + 3774BC31219B6EE800A5B24C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC30219B6EE800A5B24C /* ViewController.swift */; }; + 3774BC34219B6EE800A5B24C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC32219B6EE800A5B24C /* Main.storyboard */; }; + 3774BC36219B6EE900A5B24C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC35219B6EE900A5B24C /* Assets.xcassets */; }; + 3774BC39219B6EE900A5B24C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3774BC37219B6EE900A5B24C /* LaunchScreen.storyboard */; }; + 3774BC41219B6FF800A5B24C /* CustomScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3774BC40219B6FF800A5B24C /* CustomScene.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 3774BC0D219B69E800A5B24C /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3774BC10219B69E800A5B24C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 3774BC12219B69E800A5B24C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 3774BC15219B69E800A5B24C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 3774BC17219B69E900A5B24C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 3774BC1A219B69E900A5B24C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 3774BC1C219B69E900A5B24C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3774BC2B219B6EE800A5B24C /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3774BC2E219B6EE800A5B24C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 3774BC30219B6EE800A5B24C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 3774BC33219B6EE800A5B24C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 3774BC35219B6EE900A5B24C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3774BC38219B6EE900A5B24C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3774BC3A219B6EE900A5B24C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3774BC40219B6FF800A5B24C /* CustomScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScene.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 3774BC0A219B69E800A5B24C /* Frameworks */ = { + 3774BC28219B6EE800A5B24C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -35,31 +37,32 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3774BC04219B69E800A5B24C = { + 3774BC22219B6EE800A5B24C = { isa = PBXGroup; children = ( - 3774BC0F219B69E800A5B24C /* Sprites */, - 3774BC0E219B69E800A5B24C /* Products */, + 3774BC2D219B6EE800A5B24C /* Sprites */, + 3774BC2C219B6EE800A5B24C /* Products */, ); sourceTree = ""; }; - 3774BC0E219B69E800A5B24C /* Products */ = { + 3774BC2C219B6EE800A5B24C /* Products */ = { isa = PBXGroup; children = ( - 3774BC0D219B69E800A5B24C /* Sprites.app */, + 3774BC2B219B6EE800A5B24C /* Sprites.app */, ); name = Products; sourceTree = ""; }; - 3774BC0F219B69E800A5B24C /* Sprites */ = { + 3774BC2D219B6EE800A5B24C /* Sprites */ = { isa = PBXGroup; children = ( - 3774BC10219B69E800A5B24C /* AppDelegate.swift */, - 3774BC12219B69E800A5B24C /* ViewController.swift */, - 3774BC14219B69E800A5B24C /* Main.storyboard */, - 3774BC17219B69E900A5B24C /* Assets.xcassets */, - 3774BC19219B69E900A5B24C /* LaunchScreen.storyboard */, - 3774BC1C219B69E900A5B24C /* Info.plist */, + 3774BC2E219B6EE800A5B24C /* AppDelegate.swift */, + 3774BC30219B6EE800A5B24C /* ViewController.swift */, + 3774BC32219B6EE800A5B24C /* Main.storyboard */, + 3774BC40219B6FF800A5B24C /* CustomScene.swift */, + 3774BC35219B6EE900A5B24C /* Assets.xcassets */, + 3774BC37219B6EE900A5B24C /* LaunchScreen.storyboard */, + 3774BC3A219B6EE900A5B24C /* Info.plist */, ); path = Sprites; sourceTree = ""; @@ -67,13 +70,13 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 3774BC0C219B69E800A5B24C /* Sprites */ = { + 3774BC2A219B6EE800A5B24C /* Sprites */ = { isa = PBXNativeTarget; - buildConfigurationList = 3774BC1F219B69E900A5B24C /* Build configuration list for PBXNativeTarget "Sprites" */; + buildConfigurationList = 3774BC3D219B6EE900A5B24C /* Build configuration list for PBXNativeTarget "Sprites" */; buildPhases = ( - 3774BC09219B69E800A5B24C /* Sources */, - 3774BC0A219B69E800A5B24C /* Frameworks */, - 3774BC0B219B69E800A5B24C /* Resources */, + 3774BC27219B6EE800A5B24C /* Sources */, + 3774BC28219B6EE800A5B24C /* Frameworks */, + 3774BC29219B6EE800A5B24C /* Resources */, ); buildRules = ( ); @@ -81,25 +84,25 @@ ); name = Sprites; productName = Sprites; - productReference = 3774BC0D219B69E800A5B24C /* Sprites.app */; + productReference = 3774BC2B219B6EE800A5B24C /* Sprites.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 3774BC05219B69E800A5B24C /* Project object */ = { + 3774BC23219B6EE800A5B24C /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1000; LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Sameera Leola"; TargetAttributes = { - 3774BC0C219B69E800A5B24C = { + 3774BC2A219B6EE800A5B24C = { CreatedOnToolsVersion = 10.0; }; }; }; - buildConfigurationList = 3774BC08219B69E800A5B24C /* Build configuration list for PBXProject "Sprites" */; + buildConfigurationList = 3774BC26219B6EE800A5B24C /* Build configuration list for PBXProject "Sprites" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -107,54 +110,55 @@ en, Base, ); - mainGroup = 3774BC04219B69E800A5B24C; - productRefGroup = 3774BC0E219B69E800A5B24C /* Products */; + mainGroup = 3774BC22219B6EE800A5B24C; + productRefGroup = 3774BC2C219B6EE800A5B24C /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 3774BC0C219B69E800A5B24C /* Sprites */, + 3774BC2A219B6EE800A5B24C /* Sprites */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 3774BC0B219B69E800A5B24C /* Resources */ = { + 3774BC29219B6EE800A5B24C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3774BC1B219B69E900A5B24C /* LaunchScreen.storyboard in Resources */, - 3774BC18219B69E900A5B24C /* Assets.xcassets in Resources */, - 3774BC16219B69E800A5B24C /* Main.storyboard in Resources */, + 3774BC39219B6EE900A5B24C /* LaunchScreen.storyboard in Resources */, + 3774BC36219B6EE900A5B24C /* Assets.xcassets in Resources */, + 3774BC34219B6EE800A5B24C /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 3774BC09219B69E800A5B24C /* Sources */ = { + 3774BC27219B6EE800A5B24C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3774BC13219B69E800A5B24C /* ViewController.swift in Sources */, - 3774BC11219B69E800A5B24C /* AppDelegate.swift in Sources */, + 3774BC31219B6EE800A5B24C /* ViewController.swift in Sources */, + 3774BC2F219B6EE800A5B24C /* AppDelegate.swift in Sources */, + 3774BC41219B6FF800A5B24C /* CustomScene.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 3774BC14219B69E800A5B24C /* Main.storyboard */ = { + 3774BC32219B6EE800A5B24C /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 3774BC15219B69E800A5B24C /* Base */, + 3774BC33219B6EE800A5B24C /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 3774BC19219B69E900A5B24C /* LaunchScreen.storyboard */ = { + 3774BC37219B6EE900A5B24C /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 3774BC1A219B69E900A5B24C /* Base */, + 3774BC38219B6EE900A5B24C /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -162,7 +166,7 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 3774BC1D219B69E900A5B24C /* Debug */ = { + 3774BC3B219B6EE900A5B24C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -223,7 +227,7 @@ }; name = Debug; }; - 3774BC1E219B69E900A5B24C /* Release */ = { + 3774BC3C219B6EE900A5B24C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -278,7 +282,7 @@ }; name = Release; }; - 3774BC20219B69E900A5B24C /* Debug */ = { + 3774BC3E219B6EE900A5B24C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -295,7 +299,7 @@ }; name = Debug; }; - 3774BC21219B69E900A5B24C /* Release */ = { + 3774BC3F219B6EE900A5B24C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -315,25 +319,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 3774BC08219B69E800A5B24C /* Build configuration list for PBXProject "Sprites" */ = { + 3774BC26219B6EE800A5B24C /* Build configuration list for PBXProject "Sprites" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3774BC1D219B69E900A5B24C /* Debug */, - 3774BC1E219B69E900A5B24C /* Release */, + 3774BC3B219B6EE900A5B24C /* Debug */, + 3774BC3C219B6EE900A5B24C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3774BC1F219B69E900A5B24C /* Build configuration list for PBXNativeTarget "Sprites" */ = { + 3774BC3D219B6EE900A5B24C /* Build configuration list for PBXNativeTarget "Sprites" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3774BC20219B69E900A5B24C /* Debug */, - 3774BC21219B69E900A5B24C /* Release */, + 3774BC3E219B6EE900A5B24C /* Debug */, + 3774BC3F219B6EE900A5B24C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 3774BC05219B69E800A5B24C /* Project object */; + rootObject = 3774BC23219B6EE800A5B24C /* Project object */; } diff --git a/Sprites/Sprites/Base.lproj/Main.storyboard b/Sprites/Sprites/Base.lproj/Main.storyboard index f1bcf38..4fc6623 100644 --- a/Sprites/Sprites/Base.lproj/Main.storyboard +++ b/Sprites/Sprites/Base.lproj/Main.storyboard @@ -1,7 +1,10 @@ - + + + + - + @@ -9,13 +12,27 @@ - + + + + + + + + + + + + + + + diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift new file mode 100644 index 0000000..b8ce2d8 --- /dev/null +++ b/Sprites/Sprites/CustomScene.swift @@ -0,0 +1,24 @@ +// +// CustomScene.swift +// Sprites +// +// Created by Sameera Leola on 11/13/18. +// Copyright © 2018 Sameera Leola. 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) + + // Work with your touch here + } +} diff --git a/Sprites/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift index 04642f2..e2fbdec 100644 --- a/Sprites/Sprites/ViewController.swift +++ b/Sprites/Sprites/ViewController.swift @@ -7,14 +7,19 @@ // import UIKit +import SpriteKit class ViewController: UIViewController { + + var skscene: CustomScene? = nil - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. + @IBOutlet weak var skview: SKView! + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + skscene = CustomScene(size: view.bounds.size) + skview.presentScene(skscene) } } - From 9f0689527eadca852ac7e37bd13518f4023c8091 Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 14:59:08 -0600 Subject: [PATCH 08/12] Modified CustomScene to use random color sprites --- Sprites/Sprites/CustomScene.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index b8ce2d8..df47877 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -15,10 +15,17 @@ class CustomScene: SKScene { else { return } let node = SKShapeNode(circleOfRadius: 8) - node.fillColor = .red + node.fillColor = randomColor() node.position = touch.location(in: self) addChild(node) + } + + + func randomColor() -> UIColor { + let red = CGFloat.random(in: 0.25...0.75) + let green = CGFloat.random(in: 0.25...0.75) + let blue = CGFloat.random(in: 0.25...0.75) - // Work with your touch here + return UIColor(red: red, green: green, blue: blue, alpha: 1.0) } } From 5ca22a91544000719c86d5d95e5209eb4aaa0859 Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 15:31:30 -0600 Subject: [PATCH 09/12] Modified CustomScene to include zoom in/out --- Sprites/Sprites/CustomScene.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index df47877..6c2ba59 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -18,6 +18,11 @@ class CustomScene: SKScene { node.fillColor = randomColor() node.position = touch.location(in: self) addChild(node) + + 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) } From 56fc22b7732757509e3f4e83b936ad134a8c5083 Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 15:41:24 -0600 Subject: [PATCH 10/12] Update Questions.md --- Questions.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Questions.md b/Questions.md index 64fd444..136422c 100644 --- a/Questions.md +++ b/Questions.md @@ -8,9 +8,19 @@ copy of the stable code before merging it to the completed portion of the projec **What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them?** Navigator area: There are several navigators in the navigator ares. The individual navigators keep the various components and tasks that are used in a project organized. +Editor area: There are actually several editors in Xcode. The editor button area is located in the upper right margin of the +Xcode window. There are three default editors that are configured in the editor area: +The standard source editor is where the source code is written. +The assistance editor that contains information related to the source code. + Inspectors area: This area is on the far right of the workspace window contains the inspectors area. The various inspectors are accessed by selecting the appropriate icon on the inspector bar. The inspector allows editing/setting of object attributes. +**How do you center a view in Interface Builder? How do you stretch one?** +The view is centered in the Interface Builder by opening the alignment constraint settings (the barchart) and +clicking/selecting the horizontal and vertical constraints. + +To stretch the view use TIE fighter and set all four of the constraint fields to 0. -How do you center a view in Interface Builder? How do you stretch one? -What is SpriteKit and why do people use it? +**What is SpriteKit and why do people use it?** +A SpriteKit is an iOS object that allows animation of sprite images. It is generally used to make 2D games. From 6ed30dbd791d68b5a42717e8bb6e6495edb6b18f Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 15:43:30 -0600 Subject: [PATCH 11/12] Update Questions.md --- Questions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Questions.md b/Questions.md index 136422c..642fb2a 100644 --- a/Questions.md +++ b/Questions.md @@ -23,4 +23,4 @@ To stretch the view use TIE fighter and set all four of the constraint fields to **What is SpriteKit and why do people use it?** -A SpriteKit is an iOS object that allows animation of sprite images. It is generally used to make 2D games. +A SpriteKit is an iOS framework used to make 2D games. It facilitates the animation of sprite images. From c2fea0b8fb69fcd9a654fb8e1c92eb89fff4a3bb Mon Sep 17 00:00:00 2001 From: Sameera Leola Date: Tue, 13 Nov 2018 17:07:48 -0600 Subject: [PATCH 12/12] Added move from center stretch --- Sprites/Sprites/CustomScene.swift | 11 ++++++++--- Sprites/Sprites/ViewController.swift | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index 6c2ba59..25358aa 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -10,22 +10,27 @@ 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) + // node.position = touch.location(in: self) + node.position = CGPoint(x: frame.midX, y: frame.midY) addChild(node) + //let position = node.position = touch.location(in: self) + let position = touch.location(in: self) + let actionDuration = 1.0 + let moveAction = SKAction.move(to: position, duration: actionDuration) 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]) + let sequenceAction = SKAction.sequence([moveAction, zoomAction, unzoomAction]) node.run(sequenceAction) } - func randomColor() -> UIColor { let red = CGFloat.random(in: 0.25...0.75) let green = CGFloat.random(in: 0.25...0.75) diff --git a/Sprites/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift index e2fbdec..c245e89 100644 --- a/Sprites/Sprites/ViewController.swift +++ b/Sprites/Sprites/ViewController.swift @@ -17,7 +17,7 @@ class ViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - skscene = CustomScene(size: view.bounds.size) + skscene = CustomScene(size: view.bounds.size) //size is a parameter that is passed to the init which = Java constructor skview.presentScene(skscene) }