Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Xcode 11 / iOS 13 / Swift 5.1 Support (#44)
Browse files Browse the repository at this point in the history
* Added UIScene.willEnterForegroundNotification support for iOS 13

* Updated swift tools version

* Made sure both notifications are being setup, irrespective of iOS version

* Updated metadata
  • Loading branch information
ArtSabintsev committed Sep 15, 2019
1 parent 3d708c3 commit 63bcc08
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.1
import PackageDescription

let package = Package(
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ For the latest updates, refer to the [Releases](https://github.com/ArtSabintsev/
| Swift Version | Branch Name | Will Continue to Receive Updates?
| ------------- | ------------- | -------------
| 5.1 | swift5.1 | **Yes**
| 5.0 | master | **Yes**
| 5.0 | swift5.0 | No
| 4.2 | swift4.2 | No
| 4.1 | swift4.1 | No
| 3.2 | swift3.2 | No
| 3.1 | swift3.1 | No

#### CocoaPods
```ruby
pod 'Zephyr' # Swift 5.0
pod 'Zephyr' # Swift 5.1
pod 'Zephyr', :git => 'https://github.com/ArtSabintsev/Zephyr.git', :branch => 'swift5.0' # Swift 5.0
pod 'Zephyr', :git => 'https://github.com/ArtSabintsev/Zephyr.git', :branch => 'swift4.2' # Swift 4.2
pod 'Zephyr', :git => 'https://github.com/ArtSabintsev/Zephyr.git', :branch => 'swift4.1' # Swift 4.1
pod 'Zephyr', :git => 'https://github.com/ArtSabintsev/Zephyr.git', :branch => 'swift3.2' # Swift 3.2
Expand All @@ -44,7 +45,8 @@ pod 'Zephyr', :git => 'https://github.com/ArtSabintsev/Zephyr.git', :branch => '

### Carthage
``` swift
github "ArtSabintsev/Zephyr" // Swift 5.0
github "ArtSabintsev/Zephyr" // Swift 5.1
github "ArtSabintsev/Zephyr" "swift5.0" // Swift 5.0
github "ArtSabintsev/Zephyr" "swift4.2" // Swift 4.2
github "ArtSabintsev/Zephyr" "swift4.1" // Swift 4.1
github "ArtSabintsev/Zephyr" "swift3.2" // Swift 3.2
Expand Down
8 changes: 8 additions & 0 deletions Sources/Zephyr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,19 @@ public final class Zephyr: NSObject {
NotificationCenter.default.addObserver(self, selector: #selector(keysDidChangeOnCloud(notification:)),
name: NSUbiquitousKeyValueStore.didChangeExternallyNotification,
object: nil)

#if os(iOS) || os(tvOS)
if #available(iOS 13.0, *) {
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(notification:)),
name: UIScene.willEnterForegroundNotification,
object: nil)
}

NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(notification:)),
name: UIApplication.willEnterForegroundNotification,
object: nil)
#endif

NSUbiquitousKeyValueStore.default.synchronize()
}

Expand Down
4 changes: 2 additions & 2 deletions Zephyr.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
# Version
s.version = "3.4.2"
s.swift_version = "5.0"
s.version = "3.5.0"
s.swift_version = "5.1"

# Meta
s.name = "Zephyr"
Expand Down

0 comments on commit 63bcc08

Please sign in to comment.