Skip to content

Commit

Permalink
Raise the minimum supported version to iOS 17.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieatkinson committed Apr 26, 2024
1 parent 6e49e49 commit 29e2d44
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Sources/Perception/Macros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#if canImport(Observation)
import Observation

@available(iOS, deprecated: 17, renamed: "Observable")
@available(iOS, deprecated: 17.0.1, renamed: "Observable")
@available(macOS, deprecated: 14, renamed: "Observable")
@available(tvOS, deprecated: 17, renamed: "Observable")
@available(watchOS, deprecated: 10, renamed: "Observable")
Expand All @@ -23,7 +23,7 @@
public macro Perceptible() =
#externalMacro(module: "PerceptionMacros", type: "PerceptibleMacro")

@available(iOS, deprecated: 17, renamed: "ObservationTracked")
@available(iOS, deprecated: 17.0.1, renamed: "ObservationTracked")
@available(macOS, deprecated: 14, renamed: "ObservationTracked")
@available(tvOS, deprecated: 17, renamed: "ObservationTracked")
@available(watchOS, deprecated: 10, renamed: "ObservationTracked")
Expand All @@ -32,7 +32,7 @@
public macro PerceptionTracked() =
#externalMacro(module: "PerceptionMacros", type: "PerceptionTrackedMacro")

@available(iOS, deprecated: 17, renamed: "ObservationIgnored")
@available(iOS, deprecated: 17.0.1, renamed: "ObservationIgnored")
@available(macOS, deprecated: 14, renamed: "ObservationIgnored")
@available(tvOS, deprecated: 17, renamed: "ObservationIgnored")
@available(watchOS, deprecated: 10, renamed: "ObservationIgnored")
Expand Down
2 changes: 1 addition & 1 deletion Sources/Perception/Perceptible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/// type doesn't add observation functionality to the type. Instead, always use
/// the ``Perception/Perceptible()`` macro when adding observation
/// support to a type.
@available(iOS, deprecated: 17, renamed: "Observable")
@available(iOS, deprecated: 17.0.1, renamed: "Observable")
@available(macOS, deprecated: 14, renamed: "Observable")
@available(tvOS, deprecated: 17, renamed: "Observable")
@available(watchOS, deprecated: 10, renamed: "Observable")
Expand Down
20 changes: 10 additions & 10 deletions Sources/Perception/PerceptionRegistrar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SwiftUI
///
/// You don't need to create an instance of `PerceptionRegistrar` when using
/// the ``Perception/Perceptible()`` macro to indicate observability of a type.
@available(iOS, deprecated: 17, renamed: "ObservationRegistrar")
@available(iOS, deprecated: 17.0.1, renamed: "ObservationRegistrar")
@available(macOS, deprecated: 14, renamed: "ObservationRegistrar")
@available(tvOS, deprecated: 17, renamed: "ObservationRegistrar")
@available(watchOS, deprecated: 10, renamed: "ObservationRegistrar")
Expand All @@ -27,7 +27,7 @@ public struct PerceptionRegistrar: Sendable {
/// ``Perception/Perceptible()`` macro to indicate observably
/// of a type.
public init(isPerceptionCheckingEnabled: Bool = Perception.isPerceptionCheckingEnabled) {
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) {
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *) {
#if canImport(Observation)
self._rawValue = AnySendable(ObservationRegistrar())
#else
Expand All @@ -42,7 +42,7 @@ public struct PerceptionRegistrar: Sendable {
}

#if canImport(Observation)
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
@available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *)
private var registrar: ObservationRegistrar {
self._rawValue.base as! ObservationRegistrar
}
Expand All @@ -54,7 +54,7 @@ public struct PerceptionRegistrar: Sendable {
}

#if canImport(Observation)
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
@available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *)
extension PerceptionRegistrar {
public func access<Subject: Observable, Member>(
_ subject: Subject, keyPath: KeyPath<Subject, Member>
Expand Down Expand Up @@ -94,7 +94,7 @@ extension PerceptionRegistrar {
self.perceptionCheck(file: file, line: line)
#endif
#if canImport(Observation)
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) {
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *) {
func `open`<T: Observable>(_ subject: T) {
self.registrar.access(
subject,
Expand All @@ -117,7 +117,7 @@ extension PerceptionRegistrar {
_ mutation: () throws -> T
) rethrows -> T {
#if canImport(Observation)
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *),
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *),
let subject = subject as? any Observable
{
func `open`<S: Observable>(_ subject: S) throws -> T {
Expand All @@ -142,7 +142,7 @@ extension PerceptionRegistrar {
keyPath: KeyPath<Subject, Member>
) {
#if canImport(Observation)
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *),
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *),
let subject = subject as? any Observable
{
func `open`<S: Observable>(_ subject: S) {
Expand All @@ -164,7 +164,7 @@ extension PerceptionRegistrar {
keyPath: KeyPath<Subject, Member>
) {
#if canImport(Observation)
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *),
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *),
let subject = subject as? any Observable
{
func `open`<S: Observable>(_ subject: S) {
Expand Down Expand Up @@ -315,7 +315,7 @@ extension PerceptionRegistrar: Hashable {
#endif

#if DEBUG
@available(iOS, deprecated: 17)
@available(iOS, deprecated: 17.0.1)
@available(macOS, deprecated: 14)
@available(tvOS, deprecated: 17)
@available(watchOS, deprecated: 10)
Expand All @@ -327,7 +327,7 @@ extension PerceptionRegistrar: Hashable {
}
}
#else
@available(iOS, deprecated: 17)
@available(iOS, deprecated: 17.0.1)
@available(macOS, deprecated: 14)
@available(tvOS, deprecated: 17)
@available(watchOS, deprecated: 10)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Perception/PerceptionTracking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private func generateAccessList<T>(_ apply: () -> T) -> (T, PerceptionTracking._
///
/// - Returns: The value that the `apply` closure returns if it has a return
/// value; otherwise, there is no return value.
@available(iOS, deprecated: 17, renamed: "withObservationTracking")
@available(iOS, deprecated: 17.0.1, renamed: "withObservationTracking")
@available(macOS, deprecated: 14, renamed: "withObservationTracking")
@available(tvOS, deprecated: 17, renamed: "withObservationTracking")
@available(watchOS, deprecated: 10, renamed: "withObservationTracking")
Expand All @@ -218,7 +218,7 @@ public func withPerceptionTracking<T>(
onChange: @autoclosure () -> @Sendable () -> Void
) -> T {
#if canImport(Observation)
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) {
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *) {
return withObservationTracking(apply, onChange: onChange())
}
#endif
Expand Down
6 changes: 3 additions & 3 deletions Sources/Perception/WithPerceptionTracking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import SwiftUI
/// To debug this, expand the warning in the Issue Navigator of Xcode (cmd+5), and click through the
/// stack frames displayed to find the line in your view where you are accessing state without being
/// inside ``WithPerceptionTracking``.
@available(iOS, deprecated: 17, message: "Remove WithPerceptionTracking")
@available(iOS, deprecated: 17.0.1, message: "Remove WithPerceptionTracking")
@available(macOS, deprecated: 14, message: "Remove WithPerceptionTracking")
@available(tvOS, deprecated: 17, message: "Remove WithPerceptionTracking")
@available(watchOS, deprecated: 10, message: "Remove WithPerceptionTracking")
Expand All @@ -47,7 +47,7 @@ public struct WithPerceptionTracking<Content> {
let content: () -> Content

public var body: Content {
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *) {
if #available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *) {
return self.instrumentedBody()
} else {
// NB: View will not re-render when 'id' changes unless we access it in the view.
Expand Down Expand Up @@ -156,7 +156,7 @@ extension WithPerceptionTracking: View where Content: View {
}
}

@available(iOS, deprecated: 17)
@available(iOS, deprecated: 17.0.1)
@available(macOS, deprecated: 14)
@available(tvOS, deprecated: 17)
@available(watchOS, deprecated: 10)
Expand Down
2 changes: 1 addition & 1 deletion Sources/PerceptionMacros/PerceptibleMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ extension PerceptibleMacro: ExtensionMacro {
extension \(raw: type.trimmedDescription): \(raw: qualifiedConformanceName) {}
"""
let obsDecl: DeclSyntax = """
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
@available(iOS 17.0.1, macOS 14, tvOS 17, watchOS 10, *)
extension \(raw: type.trimmedDescription): Observation.Observable {}
"""
let ext = decl.cast(ExtensionDeclSyntax.self)
Expand Down

0 comments on commit 29e2d44

Please sign in to comment.