SnapChat-Like Camera! (Part 1 : Swift in Xcode)

Jared Davidson · 61K views · 2015 · 9:37

Open on YouTube

Software (other)Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed to build a custom iOS camera, usually when asking about capture buttons, layer ordering or deprecated AVCapture APIs.

Recommended by 1 people across 1 different months, 2016 to 2017.

What it is

A 2015 screencast by Jared Davidson (archetapp) that walks through building a custom Snapchat-style camera screen in Swift and Xcode using AVCaptureSession. It is part one of a series, with starter and final project files provided for download.

What people said

Recommends S_J · 2017-08 · Stack Overflow · on “UIButton to capture image not responding”

First of all with the help of break points, check which section of your code is not being executed.There might be some problem related to your button connection. OR Try this one [this video] OR this one in Objective-C [LINK]

Cites Manu · 2016-06 · Stack Overflow · on “Snapchat like camera”

Right now, I am making a snapchat like application, I made a custom camera following this tutorial [this video] , then on the next video [LINK] he explains how to take pictures. My problem is that he takes the picture touching the screen and I want to take a picture with a button, right now the .xib looks like this: [LINK] First, I had this issue: func didPressTakeAnother(){ if didTakePhoto == true{ tempImageView.hidden = true didTakePhoto = false } else{ captureSession?.startRunning() didTakePhoto = true didPressTakePhoto() } because I added a button I changed the func didPressTakePhoto so ii had this popping an error. [LINK] After that, I wanted to test it out, so I commented that piece of code

Cites User 5842 · 2017-01 · Stack Overflow · on “Modify AVCaptureStillImageOutput to AVCapturePhotoOutput”

I am currently working on a snippet of code which looks like the following: if error == nil && (captureSession?.canAddInput(input))! { captureSession?.addInput(input) stillImageOutput = AVCaptureStillImageOutput() //let settings = AVCapturePhotoSettings() //settings.availablePreviewPhotoPixelFormatTypes = stillImageOutput?.outputSettings = [AVVideoCodecKey : AVVideoCodecJPEG] if (captureSession?.canAddOutput(stillImageOutput))! { captureSession?.addOutput(stillImageOutput) previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) previewLayer?.videoGravity = AVLayerVideoGravityResizeAspect previewLayer?.connection.videoOrientation = AVCaptureVideoOrientation.portrait cameraView.laye

Cites Cuckoo · 2017-03 · Stack Overflow · on “AVCaptureSession hides buttons in storyboard”

I'm new to Swift and I'm trying to create a custom camera. I've been following this [this video] tutorial and my problem is that the camera layer hides buttons that I've inserted on the storyboard. Code: override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) captureSession = AVCaptureSession() captureSession?.sessionPreset = AVCaptureSessionPreset1920x1080 let backCamera = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo) var error: NSError? do { let input = try AVCaptureDeviceInput(device: backCamera) if (error == nil && captureSession?.canAddInput(input) != nil) { captureSession?.addInput(input) stillImageOutput = AVCaptureStillImageOutput() stillImageOutpu