This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func address(o: UnsafeRawPointer) -> Int { | |
return Int(bitPattern: o) | |
} | |
struct myStruct { | |
var a: String | |
} | |
class myClas {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |