Skip to content

Commit

Permalink
Merge pull request #40 from getbouncer/public_to_open
Browse files Browse the repository at this point in the history
Change public to open for subclassing
  • Loading branch information
kingst authored Jul 17, 2019
2 parents 3540db1 + 410d1d7 commit b646856
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion CardScan.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'CardScan'
s.version = '1.0.4063'
s.version = '1.0.4064'
s.summary = 'Scan credit cards'
s.description = <<-DESC
CardScan is a library for scanning credit cards.
Expand Down
16 changes: 8 additions & 8 deletions CardScan/Classes/ScanBaseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Vision
@objc func nextImage() -> CGImage?
}

@objc public class ScanBaseViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
@objc open class ScanBaseViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {

@objc public weak var testingImageDataSource: TestingImageDataSource?
@objc public var errorCorrectionDuration = 1.5
Expand Down Expand Up @@ -37,8 +37,8 @@ import Vision
private var ocr = Ocr()

// Child classes should override these two functions
@objc public func onScannedCard(number: String, expiryYear: String?, expiryMonth: String?, scannedImage: UIImage?) { }
@objc public func showCardNumber(_ number: String, expiry: String?) { }
@objc open func onScannedCard(number: String, expiryYear: String?, expiryMonth: String?, scannedImage: UIImage?) { }
@objc open func showCardNumber(_ number: String, expiry: String?) { }

func toggleTorch() {
self.ocr.scanStats.torchOn = !self.ocr.scanStats.torchOn
Expand Down Expand Up @@ -176,19 +176,19 @@ import Vision
self.previewView?.videoPreviewLayer.session = self.videoFeed.session
}

override public var shouldAutorotate: Bool {
override open var shouldAutorotate: Bool {
return false
}

override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
override open var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}

override public var preferredStatusBarStyle: UIStatusBarStyle {
override open var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}

override public func viewWillAppear(_ animated: Bool) {
override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

self.videoFeed.setup(captureDelegate: self) { success in
Expand All @@ -202,7 +202,7 @@ import Vision
self.navigationController?.setNavigationBarHidden(true, animated: animated)
}

override public func viewWillDisappear(_ animated: Bool) {
override open func viewWillDisappear(_ animated: Bool) {
self.videoFeed.willDisappear()

super.viewWillDisappear(animated)
Expand Down
Loading

0 comments on commit b646856

Please sign in to comment.