Skip to content

Fix Platform Versions #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
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
6 changes: 3 additions & 3 deletions Introspect.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |spec|
spec.source_files = 'Introspect/*.swift'

spec.swift_version = '5.1'
spec.ios.deployment_target = '11.0'
spec.tvos.deployment_target = '11.0'
spec.osx.deployment_target = '10.13'
spec.ios.deployment_target = '13.0'
spec.tvos.deployment_target = '13.0'
spec.osx.deployment_target = '10.15'
end
2 changes: 0 additions & 2 deletions Introspect/AppKitIntrospectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import SwiftUI
import AppKit

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

required init() {
Expand All @@ -23,7 +22,6 @@ 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 10.15.0, *)
public struct AppKitIntrospectionView<TargetViewType: NSView>: NSViewRepresentable {

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

/// Introspection UIView that is inserted alongside the target view.
@available(iOS 13.0, *)
public class IntrospectionUIView: UIView {

required init() {
Expand All @@ -20,7 +19,6 @@ 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 10.15.0, *)
public struct UIKitIntrospectionView<TargetViewType: UIView>: UIViewRepresentable {

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

/// Introspection UIViewController that is inserted alongside the target view controller.
@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 +16,6 @@ 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 10.15.0, *)
public struct UIKitIntrospectionViewController<TargetViewControllerType: UIViewController>: UIViewControllerRepresentable {

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

@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 10.15.0, *)
extension View {

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

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

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

@available(macOS 10.15.0, *)
enum TestUtils {
enum Constants {
static let timeout: TimeInterval = 5
Expand All @@ -24,7 +23,6 @@ enum TestUtils {
}
}

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

let spy1: () -> Void
Expand Down Expand Up @@ -53,7 +51,6 @@ private struct ListTestView: View {
}
}

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

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

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

let spy1: (NSScrollView) -> Void
Expand All @@ -103,7 +99,6 @@ private struct NestedScrollTestView: View {
}
}

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

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

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

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

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

@available(macOS 10.15.0, *)
private struct TabViewTestView: View {
let spy: () -> Void
var body: some View {
Expand All @@ -203,7 +193,6 @@ private struct TabViewTestView: View {
}
}

@available(macOS 10.15.0, *)
private struct ButtonTestView: View {
let spy: () -> Void
var body: some View {
Expand All @@ -214,7 +203,6 @@ private struct ButtonTestView: View {
}
}

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

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

@testable import Introspect

@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
enum TestUtils {
enum Constants {
static let timeout: TimeInterval = 3
Expand Down Expand Up @@ -33,7 +32,6 @@ enum TestUtils {
}
}

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

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

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

@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 @@ -93,7 +88,6 @@ private struct TabTestView: View {
}
}

@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 @@ -108,7 +102,6 @@ private struct TabRootTestView: View {
}
}

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

let spy1: () -> Void
Expand Down Expand Up @@ -137,7 +130,6 @@ private struct ListTestView: View {
}
}

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

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

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

let spy1: (UIScrollView) -> Void
Expand All @@ -186,7 +177,6 @@ private struct NestedScrollTestView: View {
}
}

@available(iOS 13.0, tvOS 13.0, macOS 10.15.0, *)
private struct TextFieldTestView: View {
let spy1: (UITextField) -> Void
let spy2: (UITextField) -> Void
Expand Down Expand Up @@ -230,7 +220,6 @@ private struct TextEditorTestView: View {
}
}

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

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

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

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

@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 @@ -302,7 +287,6 @@ private struct SegmentedControlTestView: View {
}
}

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

Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import PackageDescription
let package = Package(
name: "Introspect",
platforms: [
.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11)
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13)
],
products: [
.library(
Expand All @@ -28,4 +28,4 @@ let package = Package(
path: "IntrospectTests"
)
]
)
)