├── JMSwiftBackgroundCameraView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── JMSwiftBackgroundCameraView.xccheckout │ └── xcuserdata │ │ └── ulidev.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── ulidev.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── JMSwiftBackgroundCameraView.xcscheme │ └── xcschememanagement.plist ├── JMSwiftBackgroundCameraView ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── JMBackgroundCameraView.swift └── ViewController.swift ├── JMSwiftBackgroundCameraViewTests ├── Info.plist └── JMSwiftBackgroundCameraViewTests.swift ├── LICENSE └── README.md /JMSwiftBackgroundCameraView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BED195B81A06A61600363B48 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED195B71A06A61600363B48 /* AppDelegate.swift */; }; 11 | BED195BA1A06A61600363B48 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED195B91A06A61600363B48 /* ViewController.swift */; }; 12 | BED195BD1A06A61600363B48 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BED195BB1A06A61600363B48 /* Main.storyboard */; }; 13 | BED195BF1A06A61600363B48 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BED195BE1A06A61600363B48 /* Images.xcassets */; }; 14 | BED195C21A06A61600363B48 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = BED195C01A06A61600363B48 /* LaunchScreen.xib */; }; 15 | BED195CE1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED195CD1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.swift */; }; 16 | BED195D81A06A68800363B48 /* JMBackgroundCameraView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED195D71A06A68800363B48 /* JMBackgroundCameraView.swift */; }; 17 | BED195DA1A06AD2200363B48 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED195D91A06AD2200363B48 /* AVFoundation.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | BED195C81A06A61600363B48 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = BED195AA1A06A61600363B48 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = BED195B11A06A61600363B48; 26 | remoteInfo = JMSwiftBackgroundCameraView; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | BED195B21A06A61600363B48 /* JMSwiftBackgroundCameraView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JMSwiftBackgroundCameraView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | BED195B61A06A61600363B48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | BED195B71A06A61600363B48 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 34 | BED195B91A06A61600363B48 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 35 | BED195BC1A06A61600363B48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 36 | BED195BE1A06A61600363B48 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 37 | BED195C11A06A61600363B48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 38 | BED195C71A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JMSwiftBackgroundCameraViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | BED195CC1A06A61600363B48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | BED195CD1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JMSwiftBackgroundCameraViewTests.swift; sourceTree = ""; }; 41 | BED195D71A06A68800363B48 /* JMBackgroundCameraView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JMBackgroundCameraView.swift; sourceTree = ""; }; 42 | BED195D91A06AD2200363B48 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | BED195AF1A06A61600363B48 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | BED195DA1A06AD2200363B48 /* AVFoundation.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | BED195C41A06A61600363B48 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | BED195A91A06A61600363B48 = { 65 | isa = PBXGroup; 66 | children = ( 67 | BED195D91A06AD2200363B48 /* AVFoundation.framework */, 68 | BED195B41A06A61600363B48 /* JMSwiftBackgroundCameraView */, 69 | BED195CA1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests */, 70 | BED195B31A06A61600363B48 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | BED195B31A06A61600363B48 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | BED195B21A06A61600363B48 /* JMSwiftBackgroundCameraView.app */, 78 | BED195C71A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.xctest */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | BED195B41A06A61600363B48 /* JMSwiftBackgroundCameraView */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | BED195B71A06A61600363B48 /* AppDelegate.swift */, 87 | BED195B91A06A61600363B48 /* ViewController.swift */, 88 | BED195D71A06A68800363B48 /* JMBackgroundCameraView.swift */, 89 | BED195BB1A06A61600363B48 /* Main.storyboard */, 90 | BED195BE1A06A61600363B48 /* Images.xcassets */, 91 | BED195C01A06A61600363B48 /* LaunchScreen.xib */, 92 | BED195B51A06A61600363B48 /* Supporting Files */, 93 | ); 94 | path = JMSwiftBackgroundCameraView; 95 | sourceTree = ""; 96 | }; 97 | BED195B51A06A61600363B48 /* Supporting Files */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | BED195B61A06A61600363B48 /* Info.plist */, 101 | ); 102 | name = "Supporting Files"; 103 | sourceTree = ""; 104 | }; 105 | BED195CA1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | BED195CD1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.swift */, 109 | BED195CB1A06A61600363B48 /* Supporting Files */, 110 | ); 111 | path = JMSwiftBackgroundCameraViewTests; 112 | sourceTree = ""; 113 | }; 114 | BED195CB1A06A61600363B48 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | BED195CC1A06A61600363B48 /* Info.plist */, 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | BED195B11A06A61600363B48 /* JMSwiftBackgroundCameraView */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = BED195D11A06A61600363B48 /* Build configuration list for PBXNativeTarget "JMSwiftBackgroundCameraView" */; 128 | buildPhases = ( 129 | BED195AE1A06A61600363B48 /* Sources */, 130 | BED195AF1A06A61600363B48 /* Frameworks */, 131 | BED195B01A06A61600363B48 /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = JMSwiftBackgroundCameraView; 138 | productName = JMSwiftBackgroundCameraView; 139 | productReference = BED195B21A06A61600363B48 /* JMSwiftBackgroundCameraView.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | BED195C61A06A61600363B48 /* JMSwiftBackgroundCameraViewTests */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = BED195D41A06A61600363B48 /* Build configuration list for PBXNativeTarget "JMSwiftBackgroundCameraViewTests" */; 145 | buildPhases = ( 146 | BED195C31A06A61600363B48 /* Sources */, 147 | BED195C41A06A61600363B48 /* Frameworks */, 148 | BED195C51A06A61600363B48 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | BED195C91A06A61600363B48 /* PBXTargetDependency */, 154 | ); 155 | name = JMSwiftBackgroundCameraViewTests; 156 | productName = JMSwiftBackgroundCameraViewTests; 157 | productReference = BED195C71A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.xctest */; 158 | productType = "com.apple.product-type.bundle.unit-test"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | BED195AA1A06A61600363B48 /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 0600; 167 | ORGANIZATIONNAME = "joan molinas ramon"; 168 | TargetAttributes = { 169 | BED195B11A06A61600363B48 = { 170 | CreatedOnToolsVersion = 6.0.1; 171 | }; 172 | BED195C61A06A61600363B48 = { 173 | CreatedOnToolsVersion = 6.0.1; 174 | TestTargetID = BED195B11A06A61600363B48; 175 | }; 176 | }; 177 | }; 178 | buildConfigurationList = BED195AD1A06A61600363B48 /* Build configuration list for PBXProject "JMSwiftBackgroundCameraView" */; 179 | compatibilityVersion = "Xcode 3.2"; 180 | developmentRegion = English; 181 | hasScannedForEncodings = 0; 182 | knownRegions = ( 183 | en, 184 | Base, 185 | ); 186 | mainGroup = BED195A91A06A61600363B48; 187 | productRefGroup = BED195B31A06A61600363B48 /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | BED195B11A06A61600363B48 /* JMSwiftBackgroundCameraView */, 192 | BED195C61A06A61600363B48 /* JMSwiftBackgroundCameraViewTests */, 193 | ); 194 | }; 195 | /* End PBXProject section */ 196 | 197 | /* Begin PBXResourcesBuildPhase section */ 198 | BED195B01A06A61600363B48 /* Resources */ = { 199 | isa = PBXResourcesBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | BED195BD1A06A61600363B48 /* Main.storyboard in Resources */, 203 | BED195C21A06A61600363B48 /* LaunchScreen.xib in Resources */, 204 | BED195BF1A06A61600363B48 /* Images.xcassets in Resources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | BED195C51A06A61600363B48 /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXResourcesBuildPhase section */ 216 | 217 | /* Begin PBXSourcesBuildPhase section */ 218 | BED195AE1A06A61600363B48 /* Sources */ = { 219 | isa = PBXSourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | BED195BA1A06A61600363B48 /* ViewController.swift in Sources */, 223 | BED195B81A06A61600363B48 /* AppDelegate.swift in Sources */, 224 | BED195D81A06A68800363B48 /* JMBackgroundCameraView.swift in Sources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | BED195C31A06A61600363B48 /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | BED195CE1A06A61600363B48 /* JMSwiftBackgroundCameraViewTests.swift in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXTargetDependency section */ 239 | BED195C91A06A61600363B48 /* PBXTargetDependency */ = { 240 | isa = PBXTargetDependency; 241 | target = BED195B11A06A61600363B48 /* JMSwiftBackgroundCameraView */; 242 | targetProxy = BED195C81A06A61600363B48 /* PBXContainerItemProxy */; 243 | }; 244 | /* End PBXTargetDependency section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | BED195BB1A06A61600363B48 /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | BED195BC1A06A61600363B48 /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | BED195C01A06A61600363B48 /* LaunchScreen.xib */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | BED195C11A06A61600363B48 /* Base */, 259 | ); 260 | name = LaunchScreen.xib; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | BED195CF1A06A61600363B48 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 271 | CLANG_CXX_LIBRARY = "libc++"; 272 | CLANG_ENABLE_MODULES = YES; 273 | CLANG_ENABLE_OBJC_ARC = YES; 274 | CLANG_WARN_BOOL_CONVERSION = YES; 275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 276 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | ENABLE_STRICT_OBJC_MSGSEND = YES; 286 | GCC_C_LANGUAGE_STANDARD = gnu99; 287 | GCC_DYNAMIC_NO_PIC = NO; 288 | GCC_OPTIMIZATION_LEVEL = 0; 289 | GCC_PREPROCESSOR_DEFINITIONS = ( 290 | "DEBUG=1", 291 | "$(inherited)", 292 | ); 293 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = YES; 302 | ONLY_ACTIVE_ARCH = YES; 303 | SDKROOT = iphoneos; 304 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 305 | }; 306 | name = Debug; 307 | }; 308 | BED195D01A06A61600363B48 /* Release */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_MODULES = YES; 315 | CLANG_ENABLE_OBJC_ARC = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INT_CONVERSION = YES; 322 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 323 | CLANG_WARN_UNREACHABLE_CODE = YES; 324 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 325 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 326 | COPY_PHASE_STRIP = YES; 327 | ENABLE_NS_ASSERTIONS = NO; 328 | ENABLE_STRICT_OBJC_MSGSEND = YES; 329 | GCC_C_LANGUAGE_STANDARD = gnu99; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 337 | MTL_ENABLE_DEBUG_INFO = NO; 338 | SDKROOT = iphoneos; 339 | VALIDATE_PRODUCT = YES; 340 | }; 341 | name = Release; 342 | }; 343 | BED195D21A06A61600363B48 /* Debug */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 347 | INFOPLIST_FILE = JMSwiftBackgroundCameraView/Info.plist; 348 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | }; 351 | name = Debug; 352 | }; 353 | BED195D31A06A61600363B48 /* Release */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 357 | INFOPLIST_FILE = JMSwiftBackgroundCameraView/Info.plist; 358 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 359 | PRODUCT_NAME = "$(TARGET_NAME)"; 360 | }; 361 | name = Release; 362 | }; 363 | BED195D51A06A61600363B48 /* Debug */ = { 364 | isa = XCBuildConfiguration; 365 | buildSettings = { 366 | BUNDLE_LOADER = "$(TEST_HOST)"; 367 | FRAMEWORK_SEARCH_PATHS = ( 368 | "$(SDKROOT)/Developer/Library/Frameworks", 369 | "$(inherited)", 370 | ); 371 | GCC_PREPROCESSOR_DEFINITIONS = ( 372 | "DEBUG=1", 373 | "$(inherited)", 374 | ); 375 | INFOPLIST_FILE = JMSwiftBackgroundCameraViewTests/Info.plist; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JMSwiftBackgroundCameraView.app/JMSwiftBackgroundCameraView"; 379 | }; 380 | name = Debug; 381 | }; 382 | BED195D61A06A61600363B48 /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | BUNDLE_LOADER = "$(TEST_HOST)"; 386 | FRAMEWORK_SEARCH_PATHS = ( 387 | "$(SDKROOT)/Developer/Library/Frameworks", 388 | "$(inherited)", 389 | ); 390 | INFOPLIST_FILE = JMSwiftBackgroundCameraViewTests/Info.plist; 391 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JMSwiftBackgroundCameraView.app/JMSwiftBackgroundCameraView"; 394 | }; 395 | name = Release; 396 | }; 397 | /* End XCBuildConfiguration section */ 398 | 399 | /* Begin XCConfigurationList section */ 400 | BED195AD1A06A61600363B48 /* Build configuration list for PBXProject "JMSwiftBackgroundCameraView" */ = { 401 | isa = XCConfigurationList; 402 | buildConfigurations = ( 403 | BED195CF1A06A61600363B48 /* Debug */, 404 | BED195D01A06A61600363B48 /* Release */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | defaultConfigurationName = Release; 408 | }; 409 | BED195D11A06A61600363B48 /* Build configuration list for PBXNativeTarget "JMSwiftBackgroundCameraView" */ = { 410 | isa = XCConfigurationList; 411 | buildConfigurations = ( 412 | BED195D21A06A61600363B48 /* Debug */, 413 | BED195D31A06A61600363B48 /* Release */, 414 | ); 415 | defaultConfigurationIsVisible = 0; 416 | defaultConfigurationName = Release; 417 | }; 418 | BED195D41A06A61600363B48 /* Build configuration list for PBXNativeTarget "JMSwiftBackgroundCameraViewTests" */ = { 419 | isa = XCConfigurationList; 420 | buildConfigurations = ( 421 | BED195D51A06A61600363B48 /* Debug */, 422 | BED195D61A06A61600363B48 /* Release */, 423 | ); 424 | defaultConfigurationIsVisible = 0; 425 | defaultConfigurationName = Release; 426 | }; 427 | /* End XCConfigurationList section */ 428 | }; 429 | rootObject = BED195AA1A06A61600363B48 /* Project object */; 430 | } 431 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView.xcodeproj/project.xcworkspace/xcshareddata/JMSwiftBackgroundCameraView.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 3D25E8A4-CC37-4FB9-97D4-3C82F9AF1FBB 9 | IDESourceControlProjectName 10 | JMSwiftBackgroundCameraView 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | D26FBCF6F2535A2C2EF54B1BA1C8337AD58125C8 14 | https://github.com/ulidev/JMSwiftBackgroudCameraView.git 15 | 16 | IDESourceControlProjectPath 17 | JMSwiftBackgroundCameraView.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | D26FBCF6F2535A2C2EF54B1BA1C8337AD58125C8 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/ulidev/JMSwiftBackgroudCameraView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | D26FBCF6F2535A2C2EF54B1BA1C8337AD58125C8 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | D26FBCF6F2535A2C2EF54B1BA1C8337AD58125C8 36 | IDESourceControlWCCName 37 | JMSwiftBackgroudCameraView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView.xcodeproj/project.xcworkspace/xcuserdata/ulidev.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joanmolinas/JMSwiftBackgroudCameraView/d3b0f1ec6002a5fbdb61c72c240cbafe10e423d8/JMSwiftBackgroundCameraView.xcodeproj/project.xcworkspace/xcuserdata/ulidev.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView.xcodeproj/xcuserdata/ulidev.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView.xcodeproj/xcuserdata/ulidev.xcuserdatad/xcschemes/JMSwiftBackgroundCameraView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView.xcodeproj/xcuserdata/ulidev.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JMSwiftBackgroundCameraView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BED195B11A06A61600363B48 16 | 17 | primary 18 | 19 | 20 | BED195C61A06A61600363B48 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // JMSwiftBackgroundCameraView 4 | // 5 | // Created by Joan Molinas on 2/11/14. 6 | // Copyright (c) 2014 joan molinas ramon. 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 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/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 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/Images.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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | ulidev.$(PRODUCT_NAME:rfc1034identifier) 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 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/JMBackgroundCameraView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JMBackgroundCameraView.swift 3 | // JMSwiftBackgroundCameraView 4 | // 5 | // Created by Joan Molinas on 2/11/14. 6 | // Copyright (c) 2014 joan molinas ramon. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIkit 11 | import AVFoundation 12 | 13 | enum DevicePosition : Int { 14 | case Front 15 | case Back 16 | } 17 | class JMBackgroundCameraView: UIView { 18 | 19 | var session = AVCaptureSession() 20 | var input = AVCaptureDeviceInput() 21 | var device = AVCaptureDevice?() 22 | var imageOutput = AVCaptureStillImageOutput() 23 | var preview = AVCaptureVideoPreviewLayer() 24 | var blurEffectView = UIVisualEffectView() 25 | 26 | init(frame: CGRect, position: DevicePosition) { 27 | super.init(frame: frame) 28 | initCameraInPosition(position) 29 | } 30 | 31 | init(frame: CGRect, position: DevicePosition, blur: UIBlurEffectStyle) { 32 | super.init(frame: frame) 33 | initCameraInPosition(position) 34 | addBlurEffect(blur) 35 | 36 | } 37 | 38 | func initCameraInPosition(position: DevicePosition) { 39 | 40 | 41 | session = AVCaptureSession() 42 | session.sessionPreset = AVCaptureSessionPresetHigh 43 | 44 | var devices = NSArray() 45 | devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) 46 | 47 | for device in devices { 48 | if position == .Back { 49 | if device.position == AVCaptureDevicePosition.Back { 50 | self.device = device as? AVCaptureDevice 51 | } 52 | } else { 53 | if device.position == AVCaptureDevicePosition.Front { 54 | self.device = device as? AVCaptureDevice 55 | } 56 | } 57 | } 58 | 59 | var error = NSErrorPointer() 60 | let outputSettings = NSDictionary(dictionary:[AVVideoCodecKey:AVVideoCodecJPEG]) 61 | 62 | input = AVCaptureDeviceInput(device: device, error: error) 63 | if session.canAddInput(input) { 64 | session.addInput(input) 65 | } 66 | 67 | 68 | 69 | imageOutput = AVCaptureStillImageOutput() 70 | imageOutput.outputSettings = outputSettings 71 | session.addOutput(imageOutput) 72 | preview = AVCaptureVideoPreviewLayer(session: session) 73 | preview.videoGravity = AVLayerVideoGravityResizeAspectFill 74 | preview.frame = frame 75 | layer.addSublayer(preview) 76 | session.startRunning() 77 | 78 | } 79 | func removeBlurEffect() { 80 | blurEffectView.removeFromSuperview() 81 | } 82 | 83 | func addBlurEffect(style : UIBlurEffectStyle) { 84 | var blur = UIBlurEffect(style: style) 85 | blurEffectView = UIVisualEffectView(effect: blur) 86 | blurEffectView.frame = bounds 87 | 88 | insertSubview(blurEffectView, atIndex: 1) 89 | 90 | } 91 | 92 | 93 | 94 | 95 | 96 | required init(coder aDecoder: NSCoder) { 97 | fatalError("init(coder:) has not been implemented") 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // JMSwiftBackgroundCameraView 4 | // 5 | // Created by Joan Molinas on 2/11/14. 6 | // Copyright (c) 2014 joan molinas ramon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class ViewController: UIViewController { 13 | 14 | var v : JMBackgroundCameraView! 15 | 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | 21 | 22 | v = JMBackgroundCameraView(frame: view.bounds, position: DevicePosition.Front, blur: UIBlurEffectStyle.Dark) 23 | view.addSubview(v) 24 | 25 | var s = UISwitch(frame: CGRectMake(0, 100, 100, 40)) 26 | s.addTarget(self, action: "switchState:", forControlEvents: .TouchUpInside) 27 | s.center = CGPointMake(view.frame.origin.x + view.frame.size.width/2, s.frame.origin.y) 28 | v.addSubview(s) 29 | 30 | 31 | 32 | var text = UILabel(frame: CGRectMake(0, s.frame.origin.y + s.frame.size.height + 30, view.frame.size.width, 300)) 33 | text.text = "JMBackgroundCameraView in Swift! Enjoy"; 34 | text.font = UIFont(name: "HelveticaNeue-Thin", size: 50) 35 | text.textColor = UIColor(white: 0.4, alpha: 1.0) 36 | text.textAlignment = NSTextAlignment.Center 37 | text.numberOfLines = 0 38 | 39 | v.addSubview(text) 40 | 41 | } 42 | 43 | func switchState(sender: UISwitch){ 44 | 45 | sender.on ? v.removeBlurEffect() : v.addBlurEffect(UIBlurEffectStyle.Dark) 46 | } 47 | 48 | 49 | 50 | 51 | 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | ulidev.$(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 | -------------------------------------------------------------------------------- /JMSwiftBackgroundCameraViewTests/JMSwiftBackgroundCameraViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JMSwiftBackgroundCameraViewTests.swift 3 | // JMSwiftBackgroundCameraViewTests 4 | // 5 | // Created by Joan Molinas on 2/11/14. 6 | // Copyright (c) 2014 joan molinas ramon. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class JMSwiftBackgroundCameraViewTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Joan Molinas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JMBackgroundCameraView 2 | ====================== 3 | Use a front or back camera on backgroundView in your app. This is perfect for Logins or Welcome screens. 4 | It's the same that https://github.com/ulidev/JMBackgroundCameraView 5 | 6 | ##Installation 7 | At this moment, You can install only a way, manually. 8 | For install, you can import JMBackgroundCameraView folder to your project. 9 | This Folder already contains **blur effect**. 10 | Is necessari import AVFundation Framework. 11 | 12 | ##Usage 13 | It's very easy. 14 | 15 | 1. Define `JMBackgroundCameraView `: 16 | 17 | `var v : JMBackgroundCameraView` 18 | 19 | 2. You can use two constructors, device position for back or front camera: 20 | 21 | `init(frame: CGRect, position: DevicePosition, blur: UIBlurEffectStyle)` 22 | 23 | · UIBlurEffectStyle.Dark 24 | 25 | · UIBlurEffectStyle.Light 26 | 27 | · UIBlurEffectStyle.ExtraLight` 28 | 29 | or: 30 | 31 | `init(frame: CGRect, position: DevicePosition)` 32 | 33 | 3. Just need add view `addSubview` 34 | 35 | ##Requeriments 36 | Required iOS8 for Blur. 37 | 38 | ##License 39 | Mit License 40 | 41 | ##Contact 42 | joanmramon@gmail.com 43 | 44 | http://joanmolinas.com 45 | 46 | --------------------------------------------------------------------------------