Skip to content

Commit 09f6a66

Browse files
authored
Merge pull request #49 from clutter/out-of-bounds-exception
9.1.1 - Fix Potential Internal Inconsistency
2 parents e063dd9 + eb4b975 commit 09f6a66

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build-and-test:
44
macos:
5-
xcode: 11.0.0
5+
xcode: 12.5.1
66
working_directory: /Users/distiller/project
77
environment:
88
FL_OUTPUT_DIR: /Users/distiller/project/Example/fastlane/test_output
@@ -27,4 +27,4 @@ workflows:
2727
version: 2
2828
build-test-adhoc:
2929
jobs:
30-
- build-and-test
30+
- build-and-test

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- Sections (0.8.0)
3-
- SplitScreenScanner (9.0.2):
3+
- SplitScreenScanner (9.1.1):
44
- Sections
55
- SwiftLint (0.34.0)
66

@@ -20,9 +20,9 @@ EXTERNAL SOURCES:
2020

2121
SPEC CHECKSUMS:
2222
Sections: efc268a207d0e7afba82d2a0efd6cdf61872b5d4
23-
SplitScreenScanner: 48ddf2c2db8bb133a0b7991e29fd9e3fb0546c05
23+
SplitScreenScanner: a4e8c1c708f5434b3d4374218463ddd7d81c7774
2424
SwiftLint: 79d48a17c6565dc286c37efb8322c7b450f95c67
2525

2626
PODFILE CHECKSUM: e3b551128f802187ddddf037b42e5f79c866fb2a
2727

28-
COCOAPODS: 1.11.2
28+
COCOAPODS: 1.8.4

SplitScreenScanner.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'SplitScreenScanner'
11-
s.version = '9.1.0'
11+
s.version = '9.1.1'
1212
s.summary = 'Swift library for scanning barcodes with half the screen devoted to scan history'
1313

1414
# This description is used to generate tags and improve search results.

SplitScreenScanner/Classes/ScanHistoryTableViewController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import UIKit
1010
class ScanHistoryTableViewController: UITableViewController {
1111
var viewModel: ScanHistoryViewModel!
1212

13+
private var pendingInsertions: [IndexPath] = []
14+
1315
override func viewDidLoad() {
1416
super.viewDidLoad()
1517

@@ -20,8 +22,13 @@ class ScanHistoryTableViewController: UITableViewController {
2022
}
2123

2224
viewModel.insertRowObserver = { [weak self] indexPath in
25+
self?.pendingInsertions.insert(indexPath, at: 0)
2326
DispatchQueue.main.async {
24-
self?.tableView.insertRows(at: [indexPath], with: .left)
27+
guard let pendingInsertions = self?.pendingInsertions, !pendingInsertions.isEmpty else {
28+
return
29+
}
30+
self?.tableView.insertRows(at: pendingInsertions, with: .left)
31+
self?.pendingInsertions = []
2532
}
2633
}
2734

0 commit comments

Comments
 (0)