├── README.md ├── SwiftCap.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── user.xcuserdatad │ │ └── WorkspaceSettings.xcsettings └── xcuserdata │ └── user.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── SwiftCap.xcscheme │ └── xcschememanagement.plist ├── SwiftCap ├── AppDelegate.swift ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ScreenRecorder.swift ├── ViewController.swift └── main.swift └── SwiftCapTests ├── Info.plist └── SwiftCapTests.swift /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennyledet/SwiftCap/2c7bfe1351bb1ec7d0f497d8ffd24cc5291e1247/README.md -------------------------------------------------------------------------------- /SwiftCap.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CE0DA6A8193F85790015E437 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0DA6A7193F85790015E437 /* main.swift */; }; 11 | CE0DA6AA193F85790015E437 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0DA6A9193F85790015E437 /* ViewController.swift */; }; 12 | CE0DA6AC193F85790015E437 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0DA6AB193F85790015E437 /* AppDelegate.swift */; }; 13 | CE0DA6AE193F85790015E437 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE0DA6AD193F85790015E437 /* Images.xcassets */; }; 14 | CE0DA6B1193F85790015E437 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE0DA6AF193F85790015E437 /* Main.storyboard */; }; 15 | CE0DA6BD193F85790015E437 /* SwiftCapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0DA6BC193F85790015E437 /* SwiftCapTests.swift */; }; 16 | CE0DA6C7193F85E90015E437 /* ScreenRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0DA6C6193F85E90015E437 /* ScreenRecorder.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | CE0DA6B7193F85790015E437 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = CE0DA69A193F85790015E437 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = CE0DA6A1193F85790015E437; 25 | remoteInfo = SwiftCap; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | CE0DA6A2193F85790015E437 /* SwiftCap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftCap.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | CE0DA6A6193F85790015E437 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | CE0DA6A7193F85790015E437 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 33 | CE0DA6A9193F85790015E437 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 34 | CE0DA6AB193F85790015E437 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 35 | CE0DA6AD193F85790015E437 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 36 | CE0DA6B0193F85790015E437 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 37 | CE0DA6B6193F85790015E437 /* SwiftCapTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftCapTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | CE0DA6BB193F85790015E437 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | CE0DA6BC193F85790015E437 /* SwiftCapTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftCapTests.swift; sourceTree = ""; }; 40 | CE0DA6C6193F85E90015E437 /* ScreenRecorder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScreenRecorder.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | CE0DA69F193F85790015E437 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | CE0DA6B3193F85790015E437 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | CE0DA699193F85790015E437 = { 62 | isa = PBXGroup; 63 | children = ( 64 | CE0DA6A4193F85790015E437 /* SwiftCap */, 65 | CE0DA6B9193F85790015E437 /* SwiftCapTests */, 66 | CE0DA6A3193F85790015E437 /* Products */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | CE0DA6A3193F85790015E437 /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | CE0DA6A2193F85790015E437 /* SwiftCap.app */, 74 | CE0DA6B6193F85790015E437 /* SwiftCapTests.xctest */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | CE0DA6A4193F85790015E437 /* SwiftCap */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | CE0DA6C6193F85E90015E437 /* ScreenRecorder.swift */, 83 | CE0DA6A9193F85790015E437 /* ViewController.swift */, 84 | CE0DA6AB193F85790015E437 /* AppDelegate.swift */, 85 | CE0DA6AD193F85790015E437 /* Images.xcassets */, 86 | CE0DA6AF193F85790015E437 /* Main.storyboard */, 87 | CE0DA6A5193F85790015E437 /* Supporting Files */, 88 | ); 89 | path = SwiftCap; 90 | sourceTree = ""; 91 | }; 92 | CE0DA6A5193F85790015E437 /* Supporting Files */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | CE0DA6A6193F85790015E437 /* Info.plist */, 96 | CE0DA6A7193F85790015E437 /* main.swift */, 97 | ); 98 | name = "Supporting Files"; 99 | sourceTree = ""; 100 | }; 101 | CE0DA6B9193F85790015E437 /* SwiftCapTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | CE0DA6BC193F85790015E437 /* SwiftCapTests.swift */, 105 | CE0DA6BA193F85790015E437 /* Supporting Files */, 106 | ); 107 | path = SwiftCapTests; 108 | sourceTree = ""; 109 | }; 110 | CE0DA6BA193F85790015E437 /* Supporting Files */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | CE0DA6BB193F85790015E437 /* Info.plist */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | /* End PBXGroup section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | CE0DA6A1193F85790015E437 /* SwiftCap */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = CE0DA6C0193F85790015E437 /* Build configuration list for PBXNativeTarget "SwiftCap" */; 124 | buildPhases = ( 125 | CE0DA69E193F85790015E437 /* Sources */, 126 | CE0DA69F193F85790015E437 /* Frameworks */, 127 | CE0DA6A0193F85790015E437 /* Resources */, 128 | ); 129 | buildRules = ( 130 | ); 131 | dependencies = ( 132 | ); 133 | name = SwiftCap; 134 | productName = SwiftCap; 135 | productReference = CE0DA6A2193F85790015E437 /* SwiftCap.app */; 136 | productType = "com.apple.product-type.application"; 137 | }; 138 | CE0DA6B5193F85790015E437 /* SwiftCapTests */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = CE0DA6C3193F85790015E437 /* Build configuration list for PBXNativeTarget "SwiftCapTests" */; 141 | buildPhases = ( 142 | CE0DA6B2193F85790015E437 /* Sources */, 143 | CE0DA6B3193F85790015E437 /* Frameworks */, 144 | CE0DA6B4193F85790015E437 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | CE0DA6B8193F85790015E437 /* PBXTargetDependency */, 150 | ); 151 | name = SwiftCapTests; 152 | productName = SwiftCapTests; 153 | productReference = CE0DA6B6193F85790015E437 /* SwiftCapTests.xctest */; 154 | productType = "com.apple.product-type.bundle.unit-test"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | CE0DA69A193F85790015E437 /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastUpgradeCheck = 0600; 163 | ORGANIZATIONNAME = "Kendrick Ledet"; 164 | TargetAttributes = { 165 | CE0DA6A1193F85790015E437 = { 166 | CreatedOnToolsVersion = 6.0; 167 | }; 168 | CE0DA6B5193F85790015E437 = { 169 | CreatedOnToolsVersion = 6.0; 170 | TestTargetID = CE0DA6A1193F85790015E437; 171 | }; 172 | }; 173 | }; 174 | buildConfigurationList = CE0DA69D193F85790015E437 /* Build configuration list for PBXProject "SwiftCap" */; 175 | compatibilityVersion = "Xcode 3.2"; 176 | developmentRegion = English; 177 | hasScannedForEncodings = 0; 178 | knownRegions = ( 179 | en, 180 | Base, 181 | ); 182 | mainGroup = CE0DA699193F85790015E437; 183 | productRefGroup = CE0DA6A3193F85790015E437 /* Products */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | CE0DA6A1193F85790015E437 /* SwiftCap */, 188 | CE0DA6B5193F85790015E437 /* SwiftCapTests */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | CE0DA6A0193F85790015E437 /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | CE0DA6AE193F85790015E437 /* Images.xcassets in Resources */, 199 | CE0DA6B1193F85790015E437 /* Main.storyboard in Resources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | CE0DA6B4193F85790015E437 /* Resources */ = { 204 | isa = PBXResourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | /* End PBXResourcesBuildPhase section */ 211 | 212 | /* Begin PBXSourcesBuildPhase section */ 213 | CE0DA69E193F85790015E437 /* Sources */ = { 214 | isa = PBXSourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | CE0DA6AC193F85790015E437 /* AppDelegate.swift in Sources */, 218 | CE0DA6C7193F85E90015E437 /* ScreenRecorder.swift in Sources */, 219 | CE0DA6AA193F85790015E437 /* ViewController.swift in Sources */, 220 | CE0DA6A8193F85790015E437 /* main.swift in Sources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | CE0DA6B2193F85790015E437 /* Sources */ = { 225 | isa = PBXSourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | CE0DA6BD193F85790015E437 /* SwiftCapTests.swift in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXTargetDependency section */ 235 | CE0DA6B8193F85790015E437 /* PBXTargetDependency */ = { 236 | isa = PBXTargetDependency; 237 | target = CE0DA6A1193F85790015E437 /* SwiftCap */; 238 | targetProxy = CE0DA6B7193F85790015E437 /* PBXContainerItemProxy */; 239 | }; 240 | /* End PBXTargetDependency section */ 241 | 242 | /* Begin PBXVariantGroup section */ 243 | CE0DA6AF193F85790015E437 /* Main.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | CE0DA6B0193F85790015E437 /* Base */, 247 | ); 248 | name = Main.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | CE0DA6BE193F85790015E437 /* Debug */ = { 255 | isa = XCBuildConfiguration; 256 | buildSettings = { 257 | ALWAYS_SEARCH_USER_PATHS = NO; 258 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 259 | CLANG_CXX_LIBRARY = "libc++"; 260 | CLANG_ENABLE_MODULES = YES; 261 | CLANG_ENABLE_OBJC_ARC = YES; 262 | CLANG_WARN_BOOL_CONVERSION = YES; 263 | CLANG_WARN_CONSTANT_CONVERSION = YES; 264 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 265 | CLANG_WARN_EMPTY_BODY = YES; 266 | CLANG_WARN_ENUM_CONVERSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | CODE_SIGN_IDENTITY = "-"; 272 | COPY_PHASE_STRIP = NO; 273 | ENABLE_STRICT_OBJC_MSGSEND = YES; 274 | GCC_C_LANGUAGE_STANDARD = gnu99; 275 | GCC_DYNAMIC_NO_PIC = NO; 276 | GCC_OPTIMIZATION_LEVEL = 0; 277 | GCC_PREPROCESSOR_DEFINITIONS = ( 278 | "DEBUG=1", 279 | "$(inherited)", 280 | ); 281 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 282 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 283 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 284 | GCC_WARN_UNDECLARED_SELECTOR = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 286 | GCC_WARN_UNUSED_FUNCTION = YES; 287 | GCC_WARN_UNUSED_VARIABLE = YES; 288 | MACOSX_DEPLOYMENT_TARGET = 10.10; 289 | METAL_ENABLE_DEBUG_INFO = YES; 290 | ONLY_ACTIVE_ARCH = YES; 291 | SDKROOT = macosx; 292 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 293 | }; 294 | name = Debug; 295 | }; 296 | CE0DA6BF193F85790015E437 /* Release */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ALWAYS_SEARCH_USER_PATHS = NO; 300 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 301 | CLANG_CXX_LIBRARY = "libc++"; 302 | CLANG_ENABLE_MODULES = YES; 303 | CLANG_ENABLE_OBJC_ARC = YES; 304 | CLANG_WARN_BOOL_CONVERSION = YES; 305 | CLANG_WARN_CONSTANT_CONVERSION = YES; 306 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 307 | CLANG_WARN_EMPTY_BODY = YES; 308 | CLANG_WARN_ENUM_CONVERSION = YES; 309 | CLANG_WARN_INT_CONVERSION = YES; 310 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 311 | CLANG_WARN_UNREACHABLE_CODE = YES; 312 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 313 | CODE_SIGN_IDENTITY = "-"; 314 | COPY_PHASE_STRIP = YES; 315 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 316 | ENABLE_NS_ASSERTIONS = NO; 317 | ENABLE_STRICT_OBJC_MSGSEND = YES; 318 | GCC_C_LANGUAGE_STANDARD = gnu99; 319 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 320 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 321 | GCC_WARN_UNDECLARED_SELECTOR = YES; 322 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 323 | GCC_WARN_UNUSED_FUNCTION = YES; 324 | GCC_WARN_UNUSED_VARIABLE = YES; 325 | MACOSX_DEPLOYMENT_TARGET = 10.10; 326 | METAL_ENABLE_DEBUG_INFO = NO; 327 | SDKROOT = macosx; 328 | }; 329 | name = Release; 330 | }; 331 | CE0DA6C1193F85790015E437 /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | buildSettings = { 334 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 335 | COMBINE_HIDPI_IMAGES = YES; 336 | INFOPLIST_FILE = SwiftCap/Info.plist; 337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 338 | PRODUCT_NAME = "$(TARGET_NAME)"; 339 | }; 340 | name = Debug; 341 | }; 342 | CE0DA6C2193F85790015E437 /* Release */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 346 | COMBINE_HIDPI_IMAGES = YES; 347 | INFOPLIST_FILE = SwiftCap/Info.plist; 348 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | }; 351 | name = Release; 352 | }; 353 | CE0DA6C4193F85790015E437 /* Debug */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SwiftCap.app/Contents/MacOS/SwiftCap"; 357 | COMBINE_HIDPI_IMAGES = YES; 358 | FRAMEWORK_SEARCH_PATHS = ( 359 | "$(DEVELOPER_FRAMEWORKS_DIR)", 360 | "$(inherited)", 361 | ); 362 | GCC_PREPROCESSOR_DEFINITIONS = ( 363 | "DEBUG=1", 364 | "$(inherited)", 365 | ); 366 | INFOPLIST_FILE = SwiftCapTests/Info.plist; 367 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 368 | METAL_ENABLE_DEBUG_INFO = YES; 369 | PRODUCT_NAME = "$(TARGET_NAME)"; 370 | TEST_HOST = "$(BUNDLE_LOADER)"; 371 | }; 372 | name = Debug; 373 | }; 374 | CE0DA6C5193F85790015E437 /* Release */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SwiftCap.app/Contents/MacOS/SwiftCap"; 378 | COMBINE_HIDPI_IMAGES = YES; 379 | FRAMEWORK_SEARCH_PATHS = ( 380 | "$(DEVELOPER_FRAMEWORKS_DIR)", 381 | "$(inherited)", 382 | ); 383 | INFOPLIST_FILE = SwiftCapTests/Info.plist; 384 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 385 | METAL_ENABLE_DEBUG_INFO = NO; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | TEST_HOST = "$(BUNDLE_LOADER)"; 388 | }; 389 | name = Release; 390 | }; 391 | /* End XCBuildConfiguration section */ 392 | 393 | /* Begin XCConfigurationList section */ 394 | CE0DA69D193F85790015E437 /* Build configuration list for PBXProject "SwiftCap" */ = { 395 | isa = XCConfigurationList; 396 | buildConfigurations = ( 397 | CE0DA6BE193F85790015E437 /* Debug */, 398 | CE0DA6BF193F85790015E437 /* Release */, 399 | ); 400 | defaultConfigurationIsVisible = 0; 401 | defaultConfigurationName = Release; 402 | }; 403 | CE0DA6C0193F85790015E437 /* Build configuration list for PBXNativeTarget "SwiftCap" */ = { 404 | isa = XCConfigurationList; 405 | buildConfigurations = ( 406 | CE0DA6C1193F85790015E437 /* Debug */, 407 | CE0DA6C2193F85790015E437 /* Release */, 408 | ); 409 | defaultConfigurationIsVisible = 0; 410 | }; 411 | CE0DA6C3193F85790015E437 /* Build configuration list for PBXNativeTarget "SwiftCapTests" */ = { 412 | isa = XCConfigurationList; 413 | buildConfigurations = ( 414 | CE0DA6C4193F85790015E437 /* Debug */, 415 | CE0DA6C5193F85790015E437 /* Release */, 416 | ); 417 | defaultConfigurationIsVisible = 0; 418 | }; 419 | /* End XCConfigurationList section */ 420 | }; 421 | rootObject = CE0DA69A193F85790015E437 /* Project object */; 422 | } 423 | -------------------------------------------------------------------------------- /SwiftCap.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftCap.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | IssueFilterStyle 12 | ShowActiveSchemeOnly 13 | LiveSourceIssuesEnabled 14 | 15 | SnapshotAutomaticallyBeforeSignificantChanges 16 | 17 | SnapshotLocationStyle 18 | Default 19 | 20 | 21 | -------------------------------------------------------------------------------- /SwiftCap.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SwiftCap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/SwiftCap.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /SwiftCap.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SwiftCap.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | CE0DA6A1193F85790015E437 16 | 17 | primary 18 | 19 | 20 | CE0DA6B5193F85790015E437 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SwiftCap/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftCap 4 | // 5 | // Created by kenny on 6/4/14. 6 | // Copyright (c) 2014 Kendrick Ledet. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | 15 | 16 | func applicationDidFinishLaunching(aNotification: NSNotification?) { 17 | // Insert code here to initialize your application 18 | } 19 | 20 | func applicationWillTerminate(aNotification: NSNotification?) { 21 | // Insert code here to tear down your application 22 | } 23 | 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /SwiftCap/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | Default 604 | 605 | 606 | 607 | 608 | 609 | 610 | Left to Right 611 | 612 | 613 | 614 | 615 | 616 | 617 | Right to Left 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | Default 629 | 630 | 631 | 632 | 633 | 634 | 635 | Left to Right 636 | 637 | 638 | 639 | 640 | 641 | 642 | Right to Left 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | -------------------------------------------------------------------------------- /SwiftCap/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /SwiftCap/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.kennyledet.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2014 Kendrick Ledet. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /SwiftCap/ScreenRecorder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScreenRecorder.swift 3 | // SwiftCap 4 | // 5 | // Created by kenny on 6/4/14. 6 | // Copyright (c) 2014 Kendrick Ledet. All rights reserved. 7 | // 8 | import Cocoa 9 | import Foundation 10 | import AVFoundation 11 | 12 | class Recorder : NSObject, AVCaptureFileOutputRecordingDelegate { 13 | let mFileManager = NSFileManager.defaultManager() 14 | 15 | // AVCaptureSession holds inputs and outputs for real-time capture 16 | let mSession = AVCaptureSession() 17 | let mScreenCapOutput = AVCaptureMovieFileOutput() 18 | var mOutputPath = "" 19 | // Just capture main display for now 20 | let mMainDisplayId = CGMainDisplayID() 21 | 22 | let mTimer : NSTimer = NSTimer() 23 | 24 | 25 | override init() { 26 | 27 | } 28 | 29 | func startCapture(startPath: NSURL, recordTime: NSTimeInterval?) { 30 | let timestamp = NSTimeIntervalSince1970 31 | let outputPath = startPath.URLByAppendingPathComponent("\(timestamp)").URLByAppendingPathExtension("mov") 32 | 33 | mSession.sessionPreset = AVCaptureSessionPresetHigh 34 | 35 | var screenInput = AVCaptureScreenInput(displayID: mMainDisplayId) 36 | if screenInput == nil { 37 | return; 38 | } 39 | 40 | if mSession.canAddInput(screenInput) { 41 | mSession.addInput(screenInput) 42 | 43 | if mSession.canAddOutput(mScreenCapOutput) { 44 | mSession.addOutput(mScreenCapOutput) 45 | 46 | mSession.startRunning() 47 | 48 | mScreenCapOutput.startRecordingToOutputFileURL(outputPath, recordingDelegate: self) 49 | mOutputPath = outputPath.path! 50 | } 51 | } 52 | 53 | //let selector = Selector("finishRecord:") 54 | //mTimer = NSTimer.scheduledTimerWithTimeInterval(recordTime, target: self, selector: selector, userInfo: nil, repeats: false) 55 | //mTimer.fire() 56 | 57 | } 58 | 59 | func stopCapture() { 60 | mScreenCapOutput.stopRecording() 61 | } 62 | 63 | func finishRecord(timer: NSTimer) { 64 | stopCapture() 65 | mTimer.invalidate() 66 | } 67 | 68 | func convert(type: String?) { 69 | let tempCmd = "ffmpeg -i \(mOutputPath) -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis /Users/user/Desktop/test.webm" 70 | let task = NSTask() 71 | task.launchPath = "/usr/bin/ffmpeg" 72 | task.arguments = ["-i", "\(mOutputPath)", "-c:v", "libvpx", "-crf", "10", "-b:v", "1M", "-c:a", "libvorbis", "/Users/user/Desktop/test.webm"] 73 | task.launch() 74 | } 75 | 76 | 77 | /* .. AVCaptureFileOutputRecording Delegate methods .. */ 78 | 79 | // Called when recording is finished 80 | func captureOutput(captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, fromConnections connections: [AnyObject]!, error: NSError!) { 81 | if error != nil { 82 | NSLog("Stopped recording due to error: \(error.description)") 83 | } 84 | mSession.stopRunning() 85 | } 86 | } 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /SwiftCap/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwiftCap 4 | // 5 | // Created by kenny on 6/4/14. 6 | // Copyright (c) 2014 Kendrick Ledet. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class ViewController: NSViewController { 12 | 13 | @IBOutlet var mPathCtrl : NSPathControl? 14 | 15 | let mDefaultSavePath = NSURL(fileURLWithPath: NSHomeDirectory().stringByAppendingPathComponent("/Desktop"), isDirectory: true) 16 | 17 | let mRecorder = Recorder() 18 | 19 | @IBOutlet weak var statusLabel: NSTextField! 20 | 21 | @IBOutlet weak var conversionProgress: NSProgressIndicator! 22 | 23 | 24 | override func viewDidLoad() { 25 | super.viewDidLoad() 26 | 27 | self.view.window?.title = "SwiftCap - Capture Your Mac Screen in .webm" 28 | 29 | mPathCtrl!.URL = mDefaultSavePath! 30 | } 31 | 32 | 33 | @IBAction func startRecord(sender : NSButton) { 34 | self.statusLabel.stringValue = "Started recording...." 35 | 36 | mRecorder.startCapture(mPathCtrl!.URL!, recordTime: nil) 37 | 38 | } 39 | 40 | @IBAction func stopRecord(sender : AnyObject) { 41 | self.statusLabel.stringValue = "Stopping recording...." 42 | 43 | mRecorder.stopCapture() 44 | 45 | self.statusLabel.stringValue = "Starting conversion to webm...." 46 | self.conversionProgress.startAnimation(self) 47 | 48 | mRecorder.convert(nil) 49 | 50 | 51 | } 52 | 53 | @IBAction func choosePath(sender : AnyObject) { 54 | let openPanel = NSOpenPanel() 55 | openPanel.canChooseDirectories = true 56 | openPanel.canCreateDirectories = false 57 | openPanel.canChooseFiles = false 58 | 59 | if openPanel.runModal() == NSOKButton { 60 | mPathCtrl!.URL = openPanel.URL 61 | } 62 | } 63 | 64 | 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /SwiftCap/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // SwiftCap 4 | // 5 | // Created by kenny on 6/4/14. 6 | // Copyright (c) 2014 Kendrick Ledet. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | NSApplicationMain(C_ARGC, C_ARGV) 12 | -------------------------------------------------------------------------------- /SwiftCapTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.kennyledet.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SwiftCapTests/SwiftCapTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftCapTests.swift 3 | // SwiftCapTests 4 | // 5 | // Created by kenny on 6/4/14. 6 | // Copyright (c) 2014 Kendrick Ledet. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SwiftCapTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | // This is an example of a functional test case. 25 | XCTAssert(true, "Pass") 26 | } 27 | 28 | func testPerformanceExample() { 29 | // This is an example of a performance test case. 30 | self.measureBlock() { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | --------------------------------------------------------------------------------