Skip to content

Commit d49a578

Browse files
authored
Rename @_spi(Internals) to @_spi(Advanced) (#290)
1 parent 005d009 commit d49a578

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Changelog
55

66
- Added: `Map` introspection (#288)
77
- Added: advanced range-based platform version predicates (#285)
8+
- Changed: renamed `@_spi(Internals)` to `@_spi(Advanced)` (#290)
89
- Documentation: generate docs for extensions (#282)
910
- Infrastructure: set up `tea` for CI and local environments (#276)
1011

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Implement your own selector
203203
In case SwiftUIIntrospect doesn't support the SwiftUI element that you're looking for, you can implement your own selector. For example, to introspect a `TextField`:
204204

205205
```swift
206-
@_spi(Internals) import SwiftUIIntrospect
206+
@_spi(Advanced) import SwiftUIIntrospect
207207

208208
public struct TextFieldType: IntrospectableViewType {}
209209

Sources/Introspect.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public struct IntrospectionScope: OptionSet {
99
/// Look for an `ancestor` relative to the `.introspect(...)` modifier.
1010
public static let ancestor = Self(rawValue: 1 << 1)
1111

12-
@_spi(Private) public let rawValue: UInt
12+
@_spi(Internals) public let rawValue: UInt
1313

14-
@_spi(Private) public init(rawValue: UInt) {
14+
@_spi(Internals) public init(rawValue: UInt) {
1515
self.rawValue = rawValue
1616
}
1717
}

Sources/IntrospectionSelector.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@_spi(Internals)
1+
@_spi(Advanced)
22
public struct IntrospectionSelector<Target: PlatformEntity> {
3-
@_spi(Internals)
3+
@_spi(Advanced)
44
public static var `default`: Self { .from(Target.self, selector: { $0 }) }
55

6-
@_spi(Internals)
6+
@_spi(Advanced)
77
public static func from<Entry: PlatformEntity>(_ entryType: Entry.Type, selector: @escaping (Entry) -> Target?) -> Self {
88
.init(
99
receiverSelector: { controller in
@@ -26,14 +26,14 @@ public struct IntrospectionSelector<Target: PlatformEntity> {
2626
self.ancestorSelector = ancestorSelector
2727
}
2828

29-
@_spi(Internals)
29+
@_spi(Advanced)
3030
public func withReceiverSelector(_ selector: @escaping (PlatformViewController) -> Target?) -> Self {
3131
var copy = self
3232
copy.receiverSelector = selector
3333
return copy
3434
}
3535

36-
@_spi(Internals)
36+
@_spi(Advanced)
3737
public func withAncestorSelector(_ selector: @escaping (PlatformViewController) -> Target?) -> Self {
3838
var copy = self
3939
copy.ancestorSelector = selector

Sources/PlatformViewVersion.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ public typealias macOSViewVersion<SwiftUIViewType: IntrospectableViewType, Platf
5050
PlatformViewVersion<macOSVersion, SwiftUIViewType, PlatformSpecificEntity>
5151

5252
public enum PlatformViewVersion<Version: PlatformVersion, SwiftUIViewType: IntrospectableViewType, PlatformSpecificEntity: PlatformEntity> {
53-
@_spi(Private) case available(Version, IntrospectionSelector<PlatformSpecificEntity>?)
54-
@_spi(Private) case unavailable
53+
@_spi(Internals) case available(Version, IntrospectionSelector<PlatformSpecificEntity>?)
54+
@_spi(Internals) case unavailable
5555

56-
@_spi(Internals) public init(for version: Version, selector: IntrospectionSelector<PlatformSpecificEntity>? = nil) {
56+
@_spi(Advanced) public init(for version: Version, selector: IntrospectionSelector<PlatformSpecificEntity>? = nil) {
5757
self = .available(version, selector)
5858
}
5959

60-
@_spi(Internals) public static func unavailable(file: StaticString = #file, line: UInt = #line) -> Self {
60+
@_spi(Advanced) public static func unavailable(file: StaticString = #file, line: UInt = #line) -> Self {
6161
let filePath = file.withUTF8Buffer { String(decoding: $0, as: UTF8.self) }
6262
let fileName = URL(fileURLWithPath: filePath).lastPathComponent
6363
runtimeWarn(

0 commit comments

Comments
 (0)