From cfe434430b43449a94519b07c8c3c0cdf488a38a Mon Sep 17 00:00:00 2001 From: Nelson Gonzalez Date: Mon, 7 Jan 2019 16:51:43 -0500 Subject: [PATCH 1/3] Add project Sprites --- Sprites/Sprites.xcodeproj/project.pbxproj | 341 ++++++++++++++++++ .../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, 620 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..5e88304 --- /dev/null +++ b/Sprites/Sprites.xcodeproj/project.pbxproj @@ -0,0 +1,341 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 7A8ED4A321E4014300E9EE73 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A8ED4A221E4014300E9EE73 /* AppDelegate.swift */; }; + 7A8ED4A521E4014300E9EE73 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A8ED4A421E4014300E9EE73 /* ViewController.swift */; }; + 7A8ED4A821E4014300E9EE73 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A8ED4A621E4014300E9EE73 /* Main.storyboard */; }; + 7A8ED4AA21E4014500E9EE73 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7A8ED4A921E4014500E9EE73 /* Assets.xcassets */; }; + 7A8ED4AD21E4014500E9EE73 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A8ED4AB21E4014500E9EE73 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 7A8ED49F21E4014300E9EE73 /* Sprites.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sprites.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7A8ED4A221E4014300E9EE73 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7A8ED4A421E4014300E9EE73 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 7A8ED4A721E4014300E9EE73 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 7A8ED4A921E4014500E9EE73 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 7A8ED4AC21E4014500E9EE73 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 7A8ED4AE21E4014500E9EE73 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7A8ED49C21E4014300E9EE73 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7A8ED49621E4014300E9EE73 = { + isa = PBXGroup; + children = ( + 7A8ED4A121E4014300E9EE73 /* Sprites */, + 7A8ED4A021E4014300E9EE73 /* Products */, + ); + sourceTree = ""; + }; + 7A8ED4A021E4014300E9EE73 /* Products */ = { + isa = PBXGroup; + children = ( + 7A8ED49F21E4014300E9EE73 /* Sprites.app */, + ); + name = Products; + sourceTree = ""; + }; + 7A8ED4A121E4014300E9EE73 /* Sprites */ = { + isa = PBXGroup; + children = ( + 7A8ED4A221E4014300E9EE73 /* AppDelegate.swift */, + 7A8ED4A421E4014300E9EE73 /* ViewController.swift */, + 7A8ED4A621E4014300E9EE73 /* Main.storyboard */, + 7A8ED4A921E4014500E9EE73 /* Assets.xcassets */, + 7A8ED4AB21E4014500E9EE73 /* LaunchScreen.storyboard */, + 7A8ED4AE21E4014500E9EE73 /* Info.plist */, + ); + path = Sprites; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7A8ED49E21E4014300E9EE73 /* Sprites */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7A8ED4B121E4014500E9EE73 /* Build configuration list for PBXNativeTarget "Sprites" */; + buildPhases = ( + 7A8ED49B21E4014300E9EE73 /* Sources */, + 7A8ED49C21E4014300E9EE73 /* Frameworks */, + 7A8ED49D21E4014300E9EE73 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Sprites; + productName = Sprites; + productReference = 7A8ED49F21E4014300E9EE73 /* Sprites.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7A8ED49721E4014300E9EE73 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Nelson Gonzalez"; + TargetAttributes = { + 7A8ED49E21E4014300E9EE73 = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = 7A8ED49A21E4014300E9EE73 /* Build configuration list for PBXProject "Sprites" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 7A8ED49621E4014300E9EE73; + productRefGroup = 7A8ED4A021E4014300E9EE73 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7A8ED49E21E4014300E9EE73 /* Sprites */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 7A8ED49D21E4014300E9EE73 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7A8ED4AD21E4014500E9EE73 /* LaunchScreen.storyboard in Resources */, + 7A8ED4AA21E4014500E9EE73 /* Assets.xcassets in Resources */, + 7A8ED4A821E4014300E9EE73 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7A8ED49B21E4014300E9EE73 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7A8ED4A521E4014300E9EE73 /* ViewController.swift in Sources */, + 7A8ED4A321E4014300E9EE73 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 7A8ED4A621E4014300E9EE73 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 7A8ED4A721E4014300E9EE73 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 7A8ED4AB21E4014500E9EE73 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 7A8ED4AC21E4014500E9EE73 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 7A8ED4AF21E4014500E9EE73 /* 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; + }; + 7A8ED4B021E4014500E9EE73 /* 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; + }; + 7A8ED4B221E4014500E9EE73 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ZD9LN99SX6; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nelsongonzalez.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 7A8ED4B321E4014500E9EE73 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ZD9LN99SX6; + INFOPLIST_FILE = Sprites/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nelsongonzalez.Sprites; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7A8ED49A21E4014300E9EE73 /* Build configuration list for PBXProject "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7A8ED4AF21E4014500E9EE73 /* Debug */, + 7A8ED4B021E4014500E9EE73 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7A8ED4B121E4014500E9EE73 /* Build configuration list for PBXNativeTarget "Sprites" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7A8ED4B221E4014500E9EE73 /* Debug */, + 7A8ED4B321E4014500E9EE73 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7A8ED49721E4014300E9EE73 /* 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..d64ddfc --- /dev/null +++ b/Sprites/Sprites/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Sprites +// +// Created by Nelson Gonzalez on 1/7/19. +// Copyright © 2019 Nelson Gonzalez. 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..cd7515f --- /dev/null +++ b/Sprites/Sprites/ViewController.swift @@ -0,0 +1,20 @@ +// +// ViewController.swift +// Sprites +// +// Created by Nelson Gonzalez on 1/7/19. +// Copyright © 2019 Nelson Gonzalez. 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 6f2716e0d8a7906de13e4660646dbd04c501f741 Mon Sep 17 00:00:00 2001 From: Nelson Gonzalez Date: Mon, 7 Jan 2019 17:29:51 -0500 Subject: [PATCH 2/3] Add SceneKit and functionality to create red dots on skview --- Sprites/Sprites.xcodeproj/project.pbxproj | 4 ++++ Sprites/Sprites/Base.lproj/Main.storyboard | 25 +++++++++++++++++++--- Sprites/Sprites/CustomScene.swift | 23 ++++++++++++++++++++ Sprites/Sprites/Info.plist | 2 -- Sprites/Sprites/ViewController.swift | 13 ++++++++--- 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 Sprites/Sprites/CustomScene.swift diff --git a/Sprites/Sprites.xcodeproj/project.pbxproj b/Sprites/Sprites.xcodeproj/project.pbxproj index 5e88304..7f81be3 100644 --- a/Sprites/Sprites.xcodeproj/project.pbxproj +++ b/Sprites/Sprites.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 7A8ED4A821E4014300E9EE73 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A8ED4A621E4014300E9EE73 /* Main.storyboard */; }; 7A8ED4AA21E4014500E9EE73 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7A8ED4A921E4014500E9EE73 /* Assets.xcassets */; }; 7A8ED4AD21E4014500E9EE73 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A8ED4AB21E4014500E9EE73 /* LaunchScreen.storyboard */; }; + 7A8ED4B521E4078C00E9EE73 /* CustomScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A8ED4B421E4078C00E9EE73 /* CustomScene.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -22,6 +23,7 @@ 7A8ED4A921E4014500E9EE73 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 7A8ED4AC21E4014500E9EE73 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 7A8ED4AE21E4014500E9EE73 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7A8ED4B421E4078C00E9EE73 /* CustomScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScene.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,6 +58,7 @@ children = ( 7A8ED4A221E4014300E9EE73 /* AppDelegate.swift */, 7A8ED4A421E4014300E9EE73 /* ViewController.swift */, + 7A8ED4B421E4078C00E9EE73 /* CustomScene.swift */, 7A8ED4A621E4014300E9EE73 /* Main.storyboard */, 7A8ED4A921E4014500E9EE73 /* Assets.xcassets */, 7A8ED4AB21E4014500E9EE73 /* LaunchScreen.storyboard */, @@ -137,6 +140,7 @@ files = ( 7A8ED4A521E4014300E9EE73 /* ViewController.swift in Sources */, 7A8ED4A321E4014300E9EE73 /* AppDelegate.swift in Sources */, + 7A8ED4B521E4078C00E9EE73 /* CustomScene.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sprites/Sprites/Base.lproj/Main.storyboard b/Sprites/Sprites/Base.lproj/Main.storyboard index f1bcf38..1c48a78 100644 --- a/Sprites/Sprites/Base.lproj/Main.storyboard +++ b/Sprites/Sprites/Base.lproj/Main.storyboard @@ -1,7 +1,11 @@ - + + + + - + + @@ -9,16 +13,31 @@ - + + + + + + + + + + + + + + + + diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift new file mode 100644 index 0000000..370beda --- /dev/null +++ b/Sprites/Sprites/CustomScene.swift @@ -0,0 +1,23 @@ +// +// CustomScene.swift +// Sprites +// +// Created by Nelson Gonzalez on 1/7/19. +// Copyright © 2019 Nelson Gonzalez. 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 } + + // Work with your touch here + let node = SKShapeNode(circleOfRadius: 8) + node.fillColor = .red + node.position = touch.location(in: self) + addChild(node) + } +} diff --git a/Sprites/Sprites/Info.plist b/Sprites/Sprites/Info.plist index 16be3b6..89d7858 100644 --- a/Sprites/Sprites/Info.plist +++ b/Sprites/Sprites/Info.plist @@ -31,8 +31,6 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad diff --git a/Sprites/Sprites/ViewController.swift b/Sprites/Sprites/ViewController.swift index cd7515f..56e79de 100644 --- a/Sprites/Sprites/ViewController.swift +++ b/Sprites/Sprites/ViewController.swift @@ -7,12 +7,19 @@ // import UIKit +import SpriteKit class ViewController: UIViewController { - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. + @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) } From bd9dc87489213f9f934e2a2017a6b79085c18aeb Mon Sep 17 00:00:00 2001 From: Nelson Gonzalez Date: Mon, 7 Jan 2019 18:18:47 -0500 Subject: [PATCH 3/3] add random color and zoom --- Sprites/Sprites/CustomScene.swift | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Sprites/Sprites/CustomScene.swift b/Sprites/Sprites/CustomScene.swift index 370beda..0685d28 100644 --- a/Sprites/Sprites/CustomScene.swift +++ b/Sprites/Sprites/CustomScene.swift @@ -10,14 +10,33 @@ 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 } // Work with your touch here - let node = SKShapeNode(circleOfRadius: 8) - node.fillColor = .red - node.position = touch.location(in: self) + + let node = SKShapeNode(circleOfRadius: 8) + node.fillColor = .random + node.position = touch.location(in: self) + + + let zoomInAction = SKAction.scale(to: 0.5, duration: 1) + node.run(zoomInAction) addChild(node) } + + +} + +extension UIColor { + static var random: UIColor { + return UIColor(red: .random(in: 0.5...1), + green: .random(in: 0.5...1), + blue: .random(in: 0.5...1), + alpha: 1.0) + } }