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

Commit

Permalink
Support watchOS 9 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
funkenstrahlen authored Jul 9, 2022
1 parent f3feb4b commit 7da0a5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PackageDescription

let package = Package(
name: "Zephyr",
platforms: [.iOS(.v11), .tvOS(.v11)],
platforms: [.iOS(.v11), .tvOS(.v11), .watchOS("9.0")],
products: [.library(name: "Zephyr", targets: ["Zephyr"])],
targets: [.target(name: "Zephyr", path: "Sources")],
swiftLanguageVersions: [.v5]
Expand Down
10 changes: 10 additions & 0 deletions Sources/Zephyr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import Foundation
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(watchOS)
import WatchKit
#endif

/// Enumerates the Local (`UserDefaults`) and Remote (`NSUNSUbiquitousKeyValueStore`) data stores
Expand Down Expand Up @@ -234,6 +236,14 @@ private extension Zephyr {
name: UIApplication.willEnterForegroundNotification,
object: nil)
#endif

#if os(watchOS)
if #available(watchOS 9.0, *) {
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(notification:)),
name: WKExtension.applicationWillEnterForegroundNotification,
object: nil)
}
#endif
}

/// Compares the last sync date between `NSUbiquitousKeyValueStore` and `UserDefaults`.
Expand Down
1 change: 1 addition & 0 deletions Zephyr.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Pod::Spec.new do |s|
# Deployment
s.ios.deployment_target = '11.0'
s.tvos.deployment_target = '11.0'
s.watchos.deployment_target = '9.0'

# Sources
s.source = { :git => "https://github.com/ArtSabintsev/Zephyr.git", :tag => s.version.to_s }
Expand Down

0 comments on commit 7da0a5a

Please sign in to comment.