Skip to content

Commit a333fcc

Browse files
authored
Merge pull request #88 from hyperoslo/refactor/remove-unused-files
Refactoring: remove configuration struct
2 parents 2014ba0 + 5c31b09 commit a333fcc

21 files changed

+165
-958
lines changed

BarcodeScanner.podspec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "BarcodeScanner"
33
s.summary = "Simple and beautiful barcode scanner."
4-
s.version = "3.0.3"
4+
s.version = "4.0.0"
55
s.homepage = "https://github.com/hyperoslo/BarcodeScanner"
66
s.license = 'MIT'
77
s.author = { "Hyper Interaktiv AS" => "[email protected]" }
@@ -15,7 +15,10 @@ Pod::Spec.new do |s|
1515
s.requires_arc = true
1616

1717
s.source_files = 'Sources/**/*'
18-
s.resource_bundles = { 'BarcodeScanner' => ['Images/*.{png}'] , 'Localization' => ['Localization/*.lproj/Localizable.strings']}
18+
s.resource_bundles = {
19+
'BarcodeScanner' => ['Images/*.{png}'],
20+
'Localization' => ['Localization/*.lproj/Localizable.strings']
21+
}
1922

2023
s.frameworks = 'UIKit', 'AVFoundation'
2124

BarcodeScanner.xcodeproj/project.pbxproj

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
D55281B62016758F00FF3CDD /* HeaderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281B52016758F00FF3CDD /* HeaderViewController.swift */; };
1616
D55281B8201675D500FF3CDD /* MessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281B7201675D500FF3CDD /* MessageViewController.swift */; };
1717
D55281BA2016770800FF3CDD /* CameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281B92016770800FF3CDD /* CameraViewController.swift */; };
18-
D55281BC2016782C00FF3CDD /* ScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281BB2016782C00FF3CDD /* ScannerViewController.swift */; };
18+
D55281BC2016782C00FF3CDD /* BarcodeScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281BB2016782C00FF3CDD /* BarcodeScannerViewController.swift */; };
1919
D55281BF20167DB400FF3CDD /* UIViewController+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281BE20167DB400FF3CDD /* UIViewController+Extensions.swift */; };
2020
D55281C720168E7000FF3CDD /* NSLayoutConstraint+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D55281C620168E7000FF3CDD /* NSLayoutConstraint+Extensions.swift */; };
21-
D5C4E08E1CA0BFB9008D9269 /* InfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C4E08C1CA0BFB9008D9269 /* InfoView.swift */; };
2221
D5C4E08F1CA0BFB9008D9269 /* TorchMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C4E08D1CA0BFB9008D9269 /* TorchMode.swift */; };
2322
D5CB377F2017ED2E00B9319D /* VideoPermissionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CB377E2017ED2E00B9319D /* VideoPermissionService.swift */; };
24-
D5F1C1C91C9C5113001E17A6 /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F1C1C51C9C5113001E17A6 /* Config.swift */; };
25-
D5F1C1CA1C9C5113001E17A6 /* BarcodeScannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F1C1C61C9C5113001E17A6 /* BarcodeScannerController.swift */; };
26-
D5F1C1D31C9C5809001E17A6 /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F1C1D21C9C5809001E17A6 /* HeaderView.swift */; };
23+
D5CB3783201944DE00B9319D /* AVMetadataObject+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CB3782201944DE00B9319D /* AVMetadataObject+Extensions.swift */; };
24+
D5F1C1C91C9C5113001E17A6 /* Functions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F1C1C51C9C5113001E17A6 /* Functions.swift */; };
2725
D5FC8AD71D252A12004BED88 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5FC8AD61D252A12004BED88 /* State.swift */; };
2826
/* End PBXBuildFile section */
2927

@@ -36,17 +34,15 @@
3634
D55281B52016758F00FF3CDD /* HeaderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderViewController.swift; sourceTree = "<group>"; };
3735
D55281B7201675D500FF3CDD /* MessageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageViewController.swift; sourceTree = "<group>"; };
3836
D55281B92016770800FF3CDD /* CameraViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraViewController.swift; sourceTree = "<group>"; };
39-
D55281BB2016782C00FF3CDD /* ScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerViewController.swift; sourceTree = "<group>"; };
37+
D55281BB2016782C00FF3CDD /* BarcodeScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BarcodeScannerViewController.swift; sourceTree = "<group>"; };
4038
D55281BE20167DB400FF3CDD /* UIViewController+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extensions.swift"; sourceTree = "<group>"; };
4139
D55281C620168E7000FF3CDD /* NSLayoutConstraint+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSLayoutConstraint+Extensions.swift"; sourceTree = "<group>"; };
4240
D5B2E89F1C3A780C00C0327D /* BarcodeScanner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BarcodeScanner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
43-
D5C4E08C1CA0BFB9008D9269 /* InfoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = InfoView.swift; sourceTree = "<group>"; tabWidth = 2; };
4441
D5C4E08D1CA0BFB9008D9269 /* TorchMode.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = TorchMode.swift; sourceTree = "<group>"; tabWidth = 2; };
4542
D5C6298B1C3A8BBD007F7B7C /* Info-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
4643
D5CB377E2017ED2E00B9319D /* VideoPermissionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoPermissionService.swift; sourceTree = "<group>"; };
47-
D5F1C1C51C9C5113001E17A6 /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = "<group>"; tabWidth = 2; };
48-
D5F1C1C61C9C5113001E17A6 /* BarcodeScannerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = BarcodeScannerController.swift; sourceTree = "<group>"; tabWidth = 2; };
49-
D5F1C1D21C9C5809001E17A6 /* HeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = "<group>"; tabWidth = 2; };
44+
D5CB3782201944DE00B9319D /* AVMetadataObject+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AVMetadataObject+Extensions.swift"; sourceTree = "<group>"; };
45+
D5F1C1C51C9C5113001E17A6 /* Functions.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = Functions.swift; sourceTree = "<group>"; tabWidth = 2; };
5046
D5FC8AD61D252A12004BED88 /* State.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = State.swift; sourceTree = "<group>"; tabWidth = 2; };
5147
/* End PBXFileReference section */
5248

@@ -74,11 +70,10 @@
7470
D55281B42016758000FF3CDD /* Controllers */ = {
7571
isa = PBXGroup;
7672
children = (
77-
D5F1C1C61C9C5113001E17A6 /* BarcodeScannerController.swift */,
7873
D55281B52016758F00FF3CDD /* HeaderViewController.swift */,
7974
D55281B7201675D500FF3CDD /* MessageViewController.swift */,
8075
D55281B92016770800FF3CDD /* CameraViewController.swift */,
81-
D55281BB2016782C00FF3CDD /* ScannerViewController.swift */,
76+
D55281BB2016782C00FF3CDD /* BarcodeScannerViewController.swift */,
8277
);
8378
path = Controllers;
8479
sourceTree = "<group>";
@@ -89,6 +84,7 @@
8984
D55281C620168E7000FF3CDD /* NSLayoutConstraint+Extensions.swift */,
9085
D504555E1FD8714700E46826 /* UIView+Extensions.swift */,
9186
D55281BE20167DB400FF3CDD /* UIViewController+Extensions.swift */,
87+
D5CB3782201944DE00B9319D /* AVMetadataObject+Extensions.swift */,
9288
);
9389
path = Extensions;
9490
sourceTree = "<group>";
@@ -122,17 +118,31 @@
122118
D5C629691C3A809D007F7B7C /* Sources */ = {
123119
isa = PBXGroup;
124120
children = (
121+
D5CB3785201947D000B9319D /* Helpers */,
122+
D5CB37842019477900B9319D /* DataStructures */,
125123
D55281BD20167D9F00FF3CDD /* Extensions */,
126124
D55281B42016758000FF3CDD /* Controllers */,
125+
);
126+
path = Sources;
127+
sourceTree = "<group>";
128+
};
129+
D5CB37842019477900B9319D /* DataStructures */ = {
130+
isa = PBXGroup;
131+
children = (
127132
D5FC8AD61D252A12004BED88 /* State.swift */,
128-
D5C4E08C1CA0BFB9008D9269 /* InfoView.swift */,
129133
D5C4E08D1CA0BFB9008D9269 /* TorchMode.swift */,
130134
2DBF9E0D1F169DEF006B5AA8 /* FocusViewType.swift */,
131-
D5F1C1C51C9C5113001E17A6 /* Config.swift */,
132-
D5F1C1D21C9C5809001E17A6 /* HeaderView.swift */,
135+
);
136+
path = DataStructures;
137+
sourceTree = "<group>";
138+
};
139+
D5CB3785201947D000B9319D /* Helpers */ = {
140+
isa = PBXGroup;
141+
children = (
142+
D5F1C1C51C9C5113001E17A6 /* Functions.swift */,
133143
D5CB377E2017ED2E00B9319D /* VideoPermissionService.swift */,
134144
);
135-
path = Sources;
145+
path = Helpers;
136146
sourceTree = "<group>";
137147
};
138148
/* End PBXGroup section */
@@ -218,14 +228,12 @@
218228
files = (
219229
D5C4E08F1CA0BFB9008D9269 /* TorchMode.swift in Sources */,
220230
D55281C720168E7000FF3CDD /* NSLayoutConstraint+Extensions.swift in Sources */,
221-
D5C4E08E1CA0BFB9008D9269 /* InfoView.swift in Sources */,
222231
D55281BF20167DB400FF3CDD /* UIViewController+Extensions.swift in Sources */,
223232
D55281BA2016770800FF3CDD /* CameraViewController.swift in Sources */,
224-
D5F1C1D31C9C5809001E17A6 /* HeaderView.swift in Sources */,
225-
D5F1C1C91C9C5113001E17A6 /* Config.swift in Sources */,
233+
D5F1C1C91C9C5113001E17A6 /* Functions.swift in Sources */,
226234
D55281B8201675D500FF3CDD /* MessageViewController.swift in Sources */,
227-
D5F1C1CA1C9C5113001E17A6 /* BarcodeScannerController.swift in Sources */,
228-
D55281BC2016782C00FF3CDD /* ScannerViewController.swift in Sources */,
235+
D55281BC2016782C00FF3CDD /* BarcodeScannerViewController.swift in Sources */,
236+
D5CB3783201944DE00B9319D /* AVMetadataObject+Extensions.swift in Sources */,
229237
D5CB377F2017ED2E00B9319D /* VideoPermissionService.swift in Sources */,
230238
2DBF9E0E1F169DEF006B5AA8 /* FocusViewType.swift in Sources */,
231239
D504555F1FD8714700E46826 /* UIView+Extensions.swift in Sources */,

Example/BarcodeScannerExample/BarcodeScannerExample/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import BarcodeScanner
33

44
@UIApplicationMain
55
class AppDelegate: UIResponder, UIApplicationDelegate {
6-
76
var window: UIWindow?
87
func application(_ application: UIApplication,
98
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
import UIKit
22
import BarcodeScanner
33

4-
class ViewController: UIViewController {
5-
4+
final class ViewController: UIViewController {
65
@IBOutlet var presentScannerButton: UIButton!
76
@IBOutlet var pushScannerButton: UIButton!
87

98
@IBAction func handleScannerPresent(_ sender: Any, forEvent event: UIEvent) {
10-
let controller = makeBarcodeScannerController()
9+
let controller = makeBarcodeScannerViewController()
1110
controller.title = "Barcode Scanner"
1211
present(controller, animated: true, completion: nil)
1312
}
1413

1514
@IBAction func handleScannerPush(_ sender: Any, forEvent event: UIEvent) {
16-
let controller = makeBarcodeScannerController()
15+
let controller = makeBarcodeScannerViewController()
1716
controller.title = "Barcode Scanner"
1817
navigationController?.pushViewController(controller, animated: true)
1918
}
2019

21-
private func makeBarcodeScannerController() -> ScannerController {
22-
let controller = ScannerController()
23-
controller.codeDelegate = self
24-
controller.errorDelegate = self
25-
controller.dismissalDelegate = self
26-
return controller
20+
private func makeBarcodeScannerViewController() -> BarcodeScannerViewController {
21+
let viewController = BarcodeScannerViewController()
22+
viewController.codeDelegate = self
23+
viewController.errorDelegate = self
24+
viewController.dismissalDelegate = self
25+
return viewController
2726
}
2827
}
2928

30-
extension ViewController: ScannerCodeDelegate {
29+
// MARK: - BarcodeScannerCodeDelegate
3130

32-
func scanner(_ controller: ScannerController, didCaptureCode code: String, type: String) {
31+
extension ViewController: BarcodeScannerCodeDelegate {
32+
func scanner(_ controller: BarcodeScannerViewController, didCaptureCode code: String, type: String) {
3333
print("Barcode Data: \(code)")
3434
print("Symbology Type: \(type)")
3535

@@ -40,16 +40,18 @@ extension ViewController: ScannerCodeDelegate {
4040
}
4141
}
4242

43-
extension ViewController: ScannerErrorDelegate {
43+
// MARK: - BarcodeScannerErrorDelegate
4444

45-
func scanner(_ controller: ScannerController, didReceiveError error: Error) {
45+
extension ViewController: BarcodeScannerErrorDelegate {
46+
func scanner(_ controller: BarcodeScannerViewController, didReceiveError error: Error) {
4647
print(error)
4748
}
4849
}
4950

50-
extension ViewController: ScannerDismissalDelegate {
51+
// MARK: - BarcodeScannerDismissalDelegate
5152

52-
func scannerDidDismiss(_ controller: ScannerController) {
53+
extension ViewController: BarcodeScannerDismissalDelegate {
54+
func scannerDidDismiss(_ controller: BarcodeScannerViewController) {
5355
controller.dismiss(animated: true, completion: nil)
5456
}
5557
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
use_frameworks!
2-
32
platform :ios, '9.0'
4-
53
pod 'BarcodeScanner', path: '../../'
6-
74
target 'BarcodeScannerExample'
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- BarcodeScanner (3.0.3)
2+
- BarcodeScanner (4.0.0)
33

44
DEPENDENCIES:
55
- BarcodeScanner (from `../../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: ../../
1010

1111
SPEC CHECKSUMS:
12-
BarcodeScanner: d46e21e2c193b2a5501d66924c10c264352e5f21
12+
BarcodeScanner: 706068c838405a0b6b624d284c4db3b240919e29
1313

14-
PODFILE CHECKSUM: eae1a5fa9feaba2427db94d37a48c50c283939b8
14+
PODFILE CHECKSUM: ea40d735f047f0ae7ae319d7a320a82facf3361f
1515

1616
COCOAPODS: 1.3.1

Sources/Config.swift

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)