Skip to content

Instantly share code, notes, and snippets.

import Foundation
import AVFoundation
import UIKit
import Vision
final class VNScannerController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
private let session = AVCaptureSession()
private let seqHandler = VNSequenceRequestHandler()
private let captureDevice = AVCaptureDevice.default(for: AVMediaType.video)
private var request: VNDetectBarcodesRequest?
enum WeatherError: LocalizedError {
case cityIsInTheListAlready(String)
case noLocationAccess(String)
case nothingFound
var localizedDescription: String {
switch self {
case .cityIsInTheListAlready(let string): return "Error Description"
case .noLocationAccess(let string): return "Error Description"
case .nothingFound: return "Ooops.. Nothing found!"
func address(o: UnsafeRawPointer) -> Int {
return Int(bitPattern: o)
}
struct myStruct {
var a: String
}
class myClas {}