Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Introspect/AppKitIntrospectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftUI
import AppKit

/// Introspection NSView that is inserted alongside the target view.
@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
public class IntrospectionNSView: NSView {

required init() {
Expand All @@ -23,7 +23,7 @@ public class IntrospectionNSView: NSView {

/// Introspection View that is injected into the UIKit hierarchy alongside the target view.
/// After `updateNSView` is called, it calls `selector` to find the target view, then `customize` when the target view is found.
@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
public struct AppKitIntrospectionView<TargetViewType: NSView>: NSViewRepresentable {

/// Method that introspects the view hierarchy to find the target view.
Expand Down
2 changes: 1 addition & 1 deletion Introspect/UIKitIntrospectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class IntrospectionUIView: UIView {

/// Introspection View that is injected into the UIKit hierarchy alongside the target view.
/// After `updateUIView` is called, it calls `selector` to find the target view, then `customize` when the target view is found.
@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
public struct UIKitIntrospectionView<TargetViewType: UIView>: UIViewRepresentable {

/// Method that introspects the view hierarchy to find the target view.
Expand Down
4 changes: 2 additions & 2 deletions Introspect/UIKitIntrospectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftUI
import UIKit

/// Introspection UIViewController that is inserted alongside the target view controller.
@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
public class IntrospectionUIViewController: UIViewController {
required init() {
super.init(nibName: nil, bundle: nil)
Expand All @@ -17,7 +17,7 @@ public class IntrospectionUIViewController: UIViewController {
}

/// This is the same logic as IntrospectionView but for view controllers. Please see details above.
@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
public struct UIKitIntrospectionViewController<TargetViewControllerType: UIViewController>: UIViewControllerRepresentable {

let selector: (IntrospectionUIViewController) -> TargetViewControllerType?
Expand Down
6 changes: 3 additions & 3 deletions Introspect/ViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import AppKit
import UIKit
#endif

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
extension View {
public func inject<SomeView>(_ view: SomeView) -> some View where SomeView: View {
return overlay(view.frame(width: 0, height: 0))
}
}

#if canImport(UIKit)
@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
extension View {

/// Finds a `TargetView` from a `SwiftUI.View`
Expand Down Expand Up @@ -117,7 +117,7 @@ extension View {
#endif

#if canImport(AppKit) && !targetEnvironment(macCatalyst)
@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
extension View {

/// Finds a `TargetView` from a `SwiftUI.View`
Expand Down
18 changes: 9 additions & 9 deletions IntrospectTests/AppKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import XCTest
import SwiftUI
@testable import Introspect

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
enum TestUtils {
static func present<ViewType: View>(view: ViewType) {

Expand All @@ -19,7 +19,7 @@ enum TestUtils {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct ListTestView: View {

let spy1: () -> Void
Expand All @@ -39,7 +39,7 @@ private struct ListTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct ScrollTestView: View {

let spy1: () -> Void
Expand All @@ -63,7 +63,7 @@ private struct ScrollTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct TextFieldTestView: View {
let spy: () -> Void
@State private var textFieldValue = ""
Expand All @@ -75,7 +75,7 @@ private struct TextFieldTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct SliderTestView: View {
let spy: () -> Void
@State private var sliderValue = 0.0
Expand All @@ -87,7 +87,7 @@ private struct SliderTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct StepperTestView: View {
let spy: () -> Void
var body: some View {
Expand All @@ -100,7 +100,7 @@ private struct StepperTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct DatePickerTestView: View {
let spy: () -> Void
@State private var datePickerValue = Date()
Expand All @@ -114,7 +114,7 @@ private struct DatePickerTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
private struct SegmentedControlTestView: View {
@State private var pickerValue = 0
let spy: () -> Void
Expand All @@ -131,7 +131,7 @@ private struct SegmentedControlTestView: View {
}
}

@available(macOS 15.0, *)
@available(macOS 10.15.0, *)
class AppKitTests: XCTestCase {

func testList() {
Expand Down
30 changes: 15 additions & 15 deletions IntrospectTests/UIKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftUI

@testable import Introspect

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
enum TestUtils {
static func present<ViewType: View>(view: ViewType) {

Expand All @@ -28,7 +28,7 @@ enum TestUtils {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct NavigationTestView: View {
let spy: () -> Void
var body: some View {
Expand All @@ -43,7 +43,7 @@ private struct NavigationTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct ViewControllerTestView: View {
let spy: () -> Void
var body: some View {
Expand All @@ -58,7 +58,7 @@ private struct ViewControllerTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct NavigationRootTestView: View {
let spy: () -> Void
var body: some View {
Expand All @@ -73,7 +73,7 @@ private struct NavigationRootTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct TabTestView: View {
@State private var selection = 0
let spy: () -> Void
Expand All @@ -88,7 +88,7 @@ private struct TabTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct TabRootTestView: View {
@State private var selection = 0
let spy: () -> Void
Expand All @@ -103,7 +103,7 @@ private struct TabRootTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct ListTestView: View {

let spy1: () -> Void
Expand All @@ -123,7 +123,7 @@ private struct ListTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct ScrollTestView: View {

let spy1: () -> Void
Expand All @@ -147,7 +147,7 @@ private struct ScrollTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct TextFieldTestView: View {
let spy: () -> Void
@State private var textFieldValue = ""
Expand All @@ -159,7 +159,7 @@ private struct TextFieldTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
@available(tvOS, unavailable)
private struct ToggleTestView: View {
let spy: () -> Void
Expand All @@ -172,7 +172,7 @@ private struct ToggleTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
@available(tvOS, unavailable)
private struct SliderTestView: View {
let spy: () -> Void
Expand All @@ -185,7 +185,7 @@ private struct SliderTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
@available(tvOS, unavailable)
private struct StepperTestView: View {
let spy: () -> Void
Expand All @@ -199,7 +199,7 @@ private struct StepperTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
@available(tvOS, unavailable)
private struct DatePickerTestView: View {
let spy: () -> Void
Expand All @@ -214,7 +214,7 @@ private struct DatePickerTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct SegmentedControlTestView: View {
@State private var pickerValue = 0
let spy: () -> Void
Expand All @@ -231,7 +231,7 @@ private struct SegmentedControlTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 15.0, *)
@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
class UIKitTests: XCTestCase {
func testNavigation() {

Expand Down