Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Swift 4.2 #33

Merged
merged 5 commits into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build-and-test:
macos:
xcode: 9.3.0
xcode: 10.1.0
working_directory: /Users/distiller/project
environment:
FL_OUTPUT_DIR: /Users/distiller/project/Example/fastlane/test_output
Expand Down
5 changes: 2 additions & 3 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use_frameworks!
pod 'SplitScreenScanner', :path => '../'

target 'SplitScreenScanner_Example' do
pod 'SwiftLint'
pod 'SwiftLint'
end

target 'SplitScreenScanner_Tests' do
end
target 'SplitScreenScanner_Tests'
14 changes: 7 additions & 7 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- Sections (0.7.0)
- SplitScreenScanner (5.0.0):
- Sections (0.8.0)
- SplitScreenScanner (6.0.0):
- Sections
- SwiftLint (0.27.0)
- SwiftLint (0.28.0)

DEPENDENCIES:
- SplitScreenScanner (from `../`)
Expand All @@ -18,10 +18,10 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Sections: 2fe69a9d2ff1aeca8060cb1b0342beb969f06378
SplitScreenScanner: 935bc49020b1fb70ef59aebf28eb686f723ce7db
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
Sections: efc268a207d0e7afba82d2a0efd6cdf61872b5d4
SplitScreenScanner: 893474f0577b4723c82a9ac1dfb79ac89e9ea3ff
SwiftLint: 088cfacb75b45970017e62b7524d506776d60148

PODFILE CHECKSUM: 0f27a091a060e9de3544260c0ca39500a106075b
PODFILE CHECKSUM: 662fda703b72b77c2ece8658c02a5b890176b006

COCOAPODS: 1.5.3
16 changes: 6 additions & 10 deletions Example/SplitScreenScanner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = T4U6BU9TBH;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = T4U6BU9TBH;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand Down Expand Up @@ -527,8 +527,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -544,8 +543,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -563,8 +561,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -581,8 +578,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Example/SplitScreenScanner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
4 changes: 2 additions & 2 deletions SplitScreenScanner.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SplitScreenScanner'
s.version = '5.0.0'
s.version = '6.0.0'
s.summary = 'Swift library for scanning barcodes with half the screen devoted to scan history'

# This description is used to generate tags and improve search results.
Expand All @@ -29,7 +29,7 @@ TODO: Add long description of the pod here.
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

s.ios.deployment_target = '11.0'
s.swift_version = '4.1'
s.swift_version = '4.2'

s.source_files = 'SplitScreenScanner/Classes/**/*'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ScanHistoryTableViewController: UITableViewController {
super.viewWillAppear(animated)

viewModel.createExpireSessionTimer()
NotificationCenter.default.addObserver(self, selector: #selector(expire), name: .UIApplicationDidEnterBackground, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(expire), name: UIApplication.didEnterBackgroundNotification, object: nil)
}

override func viewDidAppear(_ animated: Bool) {
Expand All @@ -61,8 +61,8 @@ class ScanHistoryTableViewController: UITableViewController {
viewModel.isHapticFeedbackEnabled = true
}

override func willMove(toParentViewController parent: UIViewController?) {
super.willMove(toParentViewController: parent)
override func willMove(toParent parent: UIViewController?) {
super.willMove(toParent: parent)

if parent == nil {
viewModel.invalidateExpireSessionTimer()
Expand Down Expand Up @@ -127,7 +127,7 @@ class ScanHistoryTableViewController: UITableViewController {

if let textLabelBounds = headerView.textLabel?.bounds {
let insets = UIEdgeInsets(top: 8.0, left: 16.0, bottom: 4.0, right: 16.0)
let insetsRect = UIEdgeInsetsInsetRect(textLabelBounds, insets)
let insetsRect = textLabelBounds.inset(by: insets)
headerView.bounds = insetsRect
}
}
Expand Down
12 changes: 6 additions & 6 deletions SplitScreenScanner/Classes/ScanToContinueViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class ScanToContinueViewController: UIViewController {
viewModel.isHapticFeedbackEnabled = false
}

override func willMove(toParentViewController parent: UIViewController?) {
super.willMove(toParentViewController: parent)
override func willMove(toParent parent: UIViewController?) {
super.willMove(toParent: parent)

if parent == nil {
viewModel.invalidateRemoveScanWarningTimer()
Expand All @@ -85,17 +85,17 @@ private extension ScanToContinueViewController {
let storyboard = UIStoryboard(name: "SplitScanner", bundle: resourceBundle)
guard let scanToContinueErrorVC = storyboard.instantiateViewController(withIdentifier: "ScanToContinueError") as? ScanToContinueErrorViewController else { return }

addChildViewController(scanToContinueErrorVC)
addChild(scanToContinueErrorVC)
view.addSubview(scanToContinueErrorVC.view)
scanToContinueErrorVC.didMove(toParentViewController: self)
scanToContinueErrorVC.didMove(toParent: self)
scanToContinueErrorVC.display(warningMessage: warningMessage)

self.scanToContinueErrorVC = scanToContinueErrorVC
}

func removeWarningView() {
scanToContinueErrorVC?.willMove(toParentViewController: nil)
scanToContinueErrorVC?.removeFromParentViewController()
scanToContinueErrorVC?.willMove(toParent: nil)
scanToContinueErrorVC?.removeFromParent()
scanToContinueErrorVC?.view.removeFromSuperview()
scanToContinueErrorVC = nil
}
Expand Down
10 changes: 5 additions & 5 deletions SplitScreenScanner/Classes/SplitScannerCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ private extension SplitScannerCoordinator {

func switchInfoView(to viewController: UIViewController) {
DispatchQueue.main.async { [weak self] in
self?.currentlyDisplayedInfoVC?.willMove(toParentViewController: nil)
self?.currentlyDisplayedInfoVC?.willMove(toParent: nil)
self?.currentlyDisplayedInfoVC?.view.removeFromSuperview()
self?.currentlyDisplayedInfoVC?.removeFromParentViewController()
self?.currentlyDisplayedInfoVC?.removeFromParent()

self?.currentlyDisplayedInfoVC = viewController

Expand All @@ -163,11 +163,11 @@ private extension SplitScannerCoordinator {
func embed(childVC: UIViewController, in containerView: UIView) {
guard let splitScannerParentVC = splitScannerParentVC else { return }

childVC.willMove(toParentViewController: splitScannerParentVC)
childVC.willMove(toParent: splitScannerParentVC)
containerView.addSubview(childVC.view)
splitScannerParentVC.addChildViewController(childVC)
splitScannerParentVC.addChild(childVC)
childVC.view.frame = containerView.bounds
childVC.didMove(toParentViewController: splitScannerParentVC)
childVC.didMove(toParent: splitScannerParentVC)
}
}

Expand Down