├── .gitignore ├── LICENSE ├── README.md ├── ReplayKit Introduction.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── DavisAllie.xcuserdatad │ └── xcschemes │ ├── ReplayKit Introduction.xcscheme │ └── xcschememanagement.plist └── ReplayKit Introduction ├── AppDelegate.swift ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Fire.scnp ├── GameViewController.swift ├── HiddenStatusBarViewController.swift ├── Info.plist └── spark.png /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ReplayKit Introduction/art.scnassets/scene.scn 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Envato Tuts+ 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Envato Tuts+ Tutorial: iOS 9: An Introduction to ReplayKit 2 | 3 | #### Instructor: Davis Allie 4 | 5 | In this tutorial, you learn how to get started with the ReplayKit framework. The framework was introduced in iOS 9 and it allows users to record their app's screen and create high-definition videos they can share directly from your app. 6 | 7 | Starter project for the Envato Tuts+ tutorial: [iOS 9: An Introduction to ReplayKit](http://code.tutsplus.com/tutorials/an-introduction-to-replaykit--cms-25458) 8 | 9 | **Read this tutorial on [Envato Tuts+](https://code.tutsplus.com)**. 10 | -------------------------------------------------------------------------------- /ReplayKit Introduction.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6082C9511C13C877001C560E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6082C9501C13C877001C560E /* AppDelegate.swift */; }; 11 | 6082C9551C13C877001C560E /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6082C9541C13C877001C560E /* GameViewController.swift */; }; 12 | 6082C9581C13C877001C560E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6082C9561C13C877001C560E /* Main.storyboard */; }; 13 | 6082C95A1C13C877001C560E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6082C9591C13C877001C560E /* Assets.xcassets */; }; 14 | 6082C95D1C13C877001C560E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6082C95B1C13C877001C560E /* LaunchScreen.storyboard */; }; 15 | 6082C9661C13C96B001C560E /* Fire.scnp in Resources */ = {isa = PBXBuildFile; fileRef = 6082C9641C13C96B001C560E /* Fire.scnp */; }; 16 | 60C03EB11C140981008DADE0 /* spark.png in Resources */ = {isa = PBXBuildFile; fileRef = 60C03EB01C140981008DADE0 /* spark.png */; }; 17 | 60C03EB31C140C6A008DADE0 /* HiddenStatusBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60C03EB21C140C6A008DADE0 /* HiddenStatusBarViewController.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 6082C94D1C13C877001C560E /* ReplayKit Introduction.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ReplayKit Introduction.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 6082C9501C13C877001C560E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | 6082C9541C13C877001C560E /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = ""; }; 24 | 6082C9571C13C877001C560E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | 6082C9591C13C877001C560E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | 6082C95C1C13C877001C560E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | 6082C95E1C13C877001C560E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 6082C9641C13C96B001C560E /* Fire.scnp */ = {isa = PBXFileReference; lastKnownFileType = file.scp; path = Fire.scnp; sourceTree = ""; }; 29 | 60C03EB01C140981008DADE0 /* spark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spark.png; sourceTree = ""; }; 30 | 60C03EB21C140C6A008DADE0 /* HiddenStatusBarViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HiddenStatusBarViewController.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 6082C94A1C13C877001C560E /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 6082C9441C13C877001C560E = { 45 | isa = PBXGroup; 46 | children = ( 47 | 6082C94F1C13C877001C560E /* ReplayKit Introduction */, 48 | 6082C94E1C13C877001C560E /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | 6082C94E1C13C877001C560E /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 6082C94D1C13C877001C560E /* ReplayKit Introduction.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | 6082C94F1C13C877001C560E /* ReplayKit Introduction */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 6082C9501C13C877001C560E /* AppDelegate.swift */, 64 | 6082C9541C13C877001C560E /* GameViewController.swift */, 65 | 60C03EB21C140C6A008DADE0 /* HiddenStatusBarViewController.swift */, 66 | 6082C9641C13C96B001C560E /* Fire.scnp */, 67 | 60C03EB01C140981008DADE0 /* spark.png */, 68 | 6082C9561C13C877001C560E /* Main.storyboard */, 69 | 6082C9591C13C877001C560E /* Assets.xcassets */, 70 | 6082C95B1C13C877001C560E /* LaunchScreen.storyboard */, 71 | 6082C95E1C13C877001C560E /* Info.plist */, 72 | ); 73 | path = "ReplayKit Introduction"; 74 | sourceTree = ""; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | 6082C94C1C13C877001C560E /* ReplayKit Introduction */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = 6082C9611C13C877001C560E /* Build configuration list for PBXNativeTarget "ReplayKit Introduction" */; 82 | buildPhases = ( 83 | 6082C9491C13C877001C560E /* Sources */, 84 | 6082C94A1C13C877001C560E /* Frameworks */, 85 | 6082C94B1C13C877001C560E /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = "ReplayKit Introduction"; 92 | productName = "ReplayKit Introduction"; 93 | productReference = 6082C94D1C13C877001C560E /* ReplayKit Introduction.app */; 94 | productType = "com.apple.product-type.application"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | 6082C9451C13C877001C560E /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastSwiftUpdateCheck = 0710; 103 | LastUpgradeCheck = 0710; 104 | ORGANIZATIONNAME = tutsplus; 105 | TargetAttributes = { 106 | 6082C94C1C13C877001C560E = { 107 | CreatedOnToolsVersion = 7.1.1; 108 | }; 109 | }; 110 | }; 111 | buildConfigurationList = 6082C9481C13C877001C560E /* Build configuration list for PBXProject "ReplayKit Introduction" */; 112 | compatibilityVersion = "Xcode 3.2"; 113 | developmentRegion = English; 114 | hasScannedForEncodings = 0; 115 | knownRegions = ( 116 | en, 117 | Base, 118 | ); 119 | mainGroup = 6082C9441C13C877001C560E; 120 | productRefGroup = 6082C94E1C13C877001C560E /* Products */; 121 | projectDirPath = ""; 122 | projectRoot = ""; 123 | targets = ( 124 | 6082C94C1C13C877001C560E /* ReplayKit Introduction */, 125 | ); 126 | }; 127 | /* End PBXProject section */ 128 | 129 | /* Begin PBXResourcesBuildPhase section */ 130 | 6082C94B1C13C877001C560E /* Resources */ = { 131 | isa = PBXResourcesBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | 60C03EB11C140981008DADE0 /* spark.png in Resources */, 135 | 6082C95D1C13C877001C560E /* LaunchScreen.storyboard in Resources */, 136 | 6082C95A1C13C877001C560E /* Assets.xcassets in Resources */, 137 | 6082C9661C13C96B001C560E /* Fire.scnp in Resources */, 138 | 6082C9581C13C877001C560E /* Main.storyboard in Resources */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXResourcesBuildPhase section */ 143 | 144 | /* Begin PBXSourcesBuildPhase section */ 145 | 6082C9491C13C877001C560E /* Sources */ = { 146 | isa = PBXSourcesBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 6082C9551C13C877001C560E /* GameViewController.swift in Sources */, 150 | 60C03EB31C140C6A008DADE0 /* HiddenStatusBarViewController.swift in Sources */, 151 | 6082C9511C13C877001C560E /* AppDelegate.swift in Sources */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXSourcesBuildPhase section */ 156 | 157 | /* Begin PBXVariantGroup section */ 158 | 6082C9561C13C877001C560E /* Main.storyboard */ = { 159 | isa = PBXVariantGroup; 160 | children = ( 161 | 6082C9571C13C877001C560E /* Base */, 162 | ); 163 | name = Main.storyboard; 164 | sourceTree = ""; 165 | }; 166 | 6082C95B1C13C877001C560E /* LaunchScreen.storyboard */ = { 167 | isa = PBXVariantGroup; 168 | children = ( 169 | 6082C95C1C13C877001C560E /* Base */, 170 | ); 171 | name = LaunchScreen.storyboard; 172 | sourceTree = ""; 173 | }; 174 | /* End PBXVariantGroup section */ 175 | 176 | /* Begin XCBuildConfiguration section */ 177 | 6082C95F1C13C877001C560E /* Debug */ = { 178 | isa = XCBuildConfiguration; 179 | buildSettings = { 180 | ALWAYS_SEARCH_USER_PATHS = NO; 181 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 182 | CLANG_CXX_LIBRARY = "libc++"; 183 | CLANG_ENABLE_MODULES = YES; 184 | CLANG_ENABLE_OBJC_ARC = YES; 185 | CLANG_WARN_BOOL_CONVERSION = YES; 186 | CLANG_WARN_CONSTANT_CONVERSION = YES; 187 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 188 | CLANG_WARN_EMPTY_BODY = YES; 189 | CLANG_WARN_ENUM_CONVERSION = YES; 190 | CLANG_WARN_INT_CONVERSION = YES; 191 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 192 | CLANG_WARN_UNREACHABLE_CODE = YES; 193 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 194 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 195 | COPY_PHASE_STRIP = NO; 196 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 197 | ENABLE_STRICT_OBJC_MSGSEND = YES; 198 | ENABLE_TESTABILITY = YES; 199 | GCC_C_LANGUAGE_STANDARD = gnu99; 200 | GCC_DYNAMIC_NO_PIC = NO; 201 | GCC_NO_COMMON_BLOCKS = YES; 202 | GCC_OPTIMIZATION_LEVEL = 0; 203 | GCC_PREPROCESSOR_DEFINITIONS = ( 204 | "DEBUG=1", 205 | "$(inherited)", 206 | ); 207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 209 | GCC_WARN_UNDECLARED_SELECTOR = YES; 210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 211 | GCC_WARN_UNUSED_FUNCTION = YES; 212 | GCC_WARN_UNUSED_VARIABLE = YES; 213 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 214 | MTL_ENABLE_DEBUG_INFO = YES; 215 | ONLY_ACTIVE_ARCH = YES; 216 | SDKROOT = iphoneos; 217 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 218 | TARGETED_DEVICE_FAMILY = "1,2"; 219 | }; 220 | name = Debug; 221 | }; 222 | 6082C9601C13C877001C560E /* Release */ = { 223 | isa = XCBuildConfiguration; 224 | buildSettings = { 225 | ALWAYS_SEARCH_USER_PATHS = NO; 226 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 227 | CLANG_CXX_LIBRARY = "libc++"; 228 | CLANG_ENABLE_MODULES = YES; 229 | CLANG_ENABLE_OBJC_ARC = YES; 230 | CLANG_WARN_BOOL_CONVERSION = YES; 231 | CLANG_WARN_CONSTANT_CONVERSION = YES; 232 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 233 | CLANG_WARN_EMPTY_BODY = YES; 234 | CLANG_WARN_ENUM_CONVERSION = YES; 235 | CLANG_WARN_INT_CONVERSION = YES; 236 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 | CLANG_WARN_UNREACHABLE_CODE = YES; 238 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 239 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 240 | COPY_PHASE_STRIP = NO; 241 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 242 | ENABLE_NS_ASSERTIONS = NO; 243 | ENABLE_STRICT_OBJC_MSGSEND = YES; 244 | GCC_C_LANGUAGE_STANDARD = gnu99; 245 | GCC_NO_COMMON_BLOCKS = YES; 246 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 247 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 248 | GCC_WARN_UNDECLARED_SELECTOR = YES; 249 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 250 | GCC_WARN_UNUSED_FUNCTION = YES; 251 | GCC_WARN_UNUSED_VARIABLE = YES; 252 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 253 | MTL_ENABLE_DEBUG_INFO = NO; 254 | SDKROOT = iphoneos; 255 | TARGETED_DEVICE_FAMILY = "1,2"; 256 | VALIDATE_PRODUCT = YES; 257 | }; 258 | name = Release; 259 | }; 260 | 6082C9621C13C877001C560E /* Debug */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 264 | INFOPLIST_FILE = "ReplayKit Introduction/Info.plist"; 265 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 266 | PRODUCT_BUNDLE_IDENTIFIER = "com.tutplus.ReplayKit-Introduction"; 267 | PRODUCT_NAME = "$(TARGET_NAME)"; 268 | }; 269 | name = Debug; 270 | }; 271 | 6082C9631C13C877001C560E /* Release */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 275 | INFOPLIST_FILE = "ReplayKit Introduction/Info.plist"; 276 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 277 | PRODUCT_BUNDLE_IDENTIFIER = "com.tutplus.ReplayKit-Introduction"; 278 | PRODUCT_NAME = "$(TARGET_NAME)"; 279 | }; 280 | name = Release; 281 | }; 282 | /* End XCBuildConfiguration section */ 283 | 284 | /* Begin XCConfigurationList section */ 285 | 6082C9481C13C877001C560E /* Build configuration list for PBXProject "ReplayKit Introduction" */ = { 286 | isa = XCConfigurationList; 287 | buildConfigurations = ( 288 | 6082C95F1C13C877001C560E /* Debug */, 289 | 6082C9601C13C877001C560E /* Release */, 290 | ); 291 | defaultConfigurationIsVisible = 0; 292 | defaultConfigurationName = Release; 293 | }; 294 | 6082C9611C13C877001C560E /* Build configuration list for PBXNativeTarget "ReplayKit Introduction" */ = { 295 | isa = XCConfigurationList; 296 | buildConfigurations = ( 297 | 6082C9621C13C877001C560E /* Debug */, 298 | 6082C9631C13C877001C560E /* Release */, 299 | ); 300 | defaultConfigurationIsVisible = 0; 301 | defaultConfigurationName = Release; 302 | }; 303 | /* End XCConfigurationList section */ 304 | }; 305 | rootObject = 6082C9451C13C877001C560E /* Project object */; 306 | } 307 | -------------------------------------------------------------------------------- /ReplayKit Introduction.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ReplayKit Introduction.xcodeproj/xcuserdata/DavisAllie.xcuserdatad/xcschemes/ReplayKit Introduction.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ReplayKit Introduction.xcodeproj/xcuserdata/DavisAllie.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ReplayKit Introduction.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6082C94C1C13C877001C560E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ReplayKit Introduction/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ReplayKit Introduction 4 | // 5 | // Created by Davis Allie on 6/12/2015. 6 | // Copyright © 2015 tutsplus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /ReplayKit Introduction/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /ReplayKit Introduction/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ReplayKit Introduction/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ReplayKit Introduction/Fire.scnp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/iOS-ReplayKit-Introduction-Starter/bb3ff6e07f9f74f2dc22a752b395002f37c2235b/ReplayKit Introduction/Fire.scnp -------------------------------------------------------------------------------- /ReplayKit Introduction/GameViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewController.swift 3 | // ReplayKit Introduction 4 | // 5 | // Created by Davis Allie on 6/12/2015. 6 | // Copyright (c) 2015 tutsplus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import QuartzCore 11 | import SceneKit 12 | 13 | class GameViewController: UIViewController { 14 | 15 | var particleSystem: SCNParticleSystem! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | let scene = SCNScene() 21 | 22 | let cameraNode = SCNNode() 23 | cameraNode.camera = SCNCamera() 24 | scene.rootNode.addChildNode(cameraNode) 25 | cameraNode.position = SCNVector3(x: 0, y: 0, z: 15) 26 | 27 | let lightNode = SCNNode() 28 | lightNode.light = SCNLight() 29 | lightNode.light!.type = SCNLightTypeOmni 30 | lightNode.position = SCNVector3(x: 0, y: 10, z: 10) 31 | scene.rootNode.addChildNode(lightNode) 32 | 33 | let ambientLightNode = SCNNode() 34 | ambientLightNode.light = SCNLight() 35 | ambientLightNode.light!.type = SCNLightTypeAmbient 36 | ambientLightNode.light!.color = UIColor.darkGrayColor() 37 | scene.rootNode.addChildNode(ambientLightNode) 38 | 39 | self.particleSystem = SCNParticleSystem(named: "Fire", inDirectory: nil)! 40 | self.particleSystem.birthRate = 0 41 | let node = SCNNode() 42 | node.addParticleSystem(self.particleSystem) 43 | scene.rootNode.addChildNode(node) 44 | 45 | let scnView = self.view as! SCNView 46 | scnView.scene = scene 47 | scnView.allowsCameraControl = true 48 | scnView.backgroundColor = UIColor.blackColor() 49 | } 50 | 51 | override func viewDidAppear(animated: Bool) { 52 | let recordingButton = UIButton(type: .System) 53 | recordingButton.setTitle("Start Recording", forState: .Normal) 54 | recordingButton.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: 50) 55 | recordingButton.addTarget(self, action: "startRecording:", forControlEvents: .TouchUpInside) 56 | 57 | let fireButton = UIButton(type: .Custom) 58 | fireButton.frame = CGRect(x: 0, y: 0, width: 70, height: 70) 59 | fireButton.backgroundColor = UIColor.greenColor() 60 | fireButton.clipsToBounds = true 61 | fireButton.layer.cornerRadius = 35.0 62 | fireButton.addTarget(self, action: "fireButtonTouchedDown:", forControlEvents: .TouchDown) 63 | fireButton.addTarget(self, action: "fireButtonTouchedUp:", forControlEvents: .TouchUpInside) 64 | fireButton.addTarget(self, action: "fireButtonTouchedUp:", forControlEvents: .TouchUpOutside) 65 | fireButton.frame.origin.y = self.view.frame.height - 78 66 | fireButton.center.x = self.view.center.x 67 | 68 | self.addButtons([recordingButton, fireButton]) 69 | } 70 | 71 | func addButtons(buttons: [UIButton]) { 72 | for button in buttons { 73 | self.view.addSubview(button) 74 | } 75 | } 76 | 77 | func fireButtonTouchedDown(sender: UIButton) { 78 | self.particleSystem.birthRate = 455 79 | } 80 | 81 | func fireButtonTouchedUp(sender: UIButton) { 82 | self.particleSystem.birthRate = 0 83 | } 84 | 85 | override func shouldAutorotate() -> Bool { 86 | return true 87 | } 88 | 89 | override func prefersStatusBarHidden() -> Bool { 90 | return true 91 | } 92 | 93 | override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { 94 | if UIDevice.currentDevice().userInterfaceIdiom == .Phone { 95 | return .AllButUpsideDown 96 | } else { 97 | return .All 98 | } 99 | } 100 | 101 | override func didReceiveMemoryWarning() { 102 | super.didReceiveMemoryWarning() 103 | // Release any cached data, images, etc that aren't in use. 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /ReplayKit Introduction/HiddenStatusBarViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HiddenStatusBarViewController.swift 3 | // ReplayKit Introduction 4 | // 5 | // Created by Davis Allie on 6/12/2015. 6 | // Copyright © 2015 tutsplus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class HiddenStatusBarViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // Do any additional setup after loading the view. 17 | } 18 | 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | override func prefersStatusBarHidden() -> Bool { 25 | return true 26 | } 27 | 28 | /* 29 | // MARK: - Navigation 30 | 31 | // In a storyboard-based application, you will often want to do a little preparation before navigation 32 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 33 | // Get the new view controller using segue.destinationViewController. 34 | // Pass the selected object to the new view controller. 35 | } 36 | */ 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ReplayKit Introduction/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ReplayKit Introduction/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/iOS-ReplayKit-Introduction-Starter/bb3ff6e07f9f74f2dc22a752b395002f37c2235b/ReplayKit Introduction/spark.png --------------------------------------------------------------------------------