Xcode 9.2, Swift 4 Compile Errors
The CapureSession.swift file does not compile. the setup function should become:
fileprivate func setup() { #if !IOS_SIMULATOR session.sessionPreset = AVCaptureSession.Preset.photo let discovery = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera], mediaType: AVMediaType.video, position: .back) if let camera = discovery.devices.first { let input = try! AVCaptureDeviceInput(device: camera) if session.canAddInput(input) { session.addInput(input) } } photoOutput = AVCapturePhotoOutput() if self.session.canAddOutput(photoOutput) { self.session.addOutput(photoOutput) } #endif }
This is after accepting Xcode's automatic fixes.
We'll update the code for the next round of fixes/updates of the book. Thanks for pointing this out.