Skip to content

Commit

Permalink
Fix Swift 4 implementation
Browse files Browse the repository at this point in the history
This adds swift version property to the podspec, as well as using the appropriate notification names. It fixes some discrepancies that were preventing this from building in Xcode 10.1.
  • Loading branch information
Ferreira, Eric (ef183v) committed Jan 2, 2019
1 parent ccaaced commit d8c1d83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion RSBarcodes_Swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RSBarcodes_Swift"
s.version = "4.2.0"
s.version = "4.2.1"
s.summary = "1D and 2D barcodes reader and generators for iOS 8 with delightful controls. Now Swift. "
s.homepage = "https://github.com/yeahdongcn/RSBarcodes_Swift"
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
Expand All @@ -10,4 +10,5 @@ Pod::Spec.new do |s|
s.source_files = 'Source/*.{swift,h,m}'
s.frameworks = ['CoreImage', 'AVFoundation', 'QuartzCore']
s.requires_arc = true
s.swift_version = "4.0"
end
6 changes: 3 additions & 3 deletions Source/RSCodeReaderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ open class RSCodeReaderViewController: UIViewController, AVCaptureMetadataOutput

override open func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: UIApplication.didEnterBackgroundNotification, object: nil)

NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil)
if !Platform.isSimulator {
self.session.stopRunning()
}
Expand Down

0 comments on commit d8c1d83

Please sign in to comment.