Skip to content
Closed
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to SpecificationKit will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Restored non-circular Core Location region evaluation on macOS and watchOS by
calling `CLRegion.contains(_:)` directly without relying on runtime
indirection, preserving behavior from earlier releases.

## [3.0.0] - 2025-09-18

### Added - Major Release Features
Expand Down
16 changes: 13 additions & 3 deletions Sources/SpecificationKit/Providers/LocationContextProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,19 @@
return distance <= circularRegion.radius
}

// CLRegion.contains(_:) is deprecated across Apple platforms, so we only
// evaluate circular regions directly. Non-circular regions fall back to false.
return false
#if os(macOS) || os(watchOS)
let containsRegion: Bool = {
@available(macOS, deprecated: 10.15)
@available(watchOS, deprecated: 6.0)
() -> Bool in
region.contains(currentLocation.coordinate)
}()
return containsRegion
#else
// CLRegion.contains(_:) is unavailable on iOS/tvOS, so non-circular regions
// cannot be evaluated directly.
return false
#endif
}
}

Expand Down
Loading