siteline / swiftui-introspect

Introspect underlying UIKit/AppKit components from SwiftUI
MIT License
5.69k stars 352 forks source link

Open PlatformEntity like .iOS(.v13...) generates an error #402

Closed ramunasjurgilas closed 9 months ago

ramunasjurgilas commented 9 months ago

Description

In the source code I have found, that platform can be specified with open range like this: .iOS(.v13...).

Source code:

struct ContentView: View {
    var body: some View {
        ScrollView {
            // ...
        }
        .introspect(.scrollView, on: .iOS(.v13...)) { scrollView in
            // ...
        }
    }
}

Getting this error:

Cannot convert value of type '()' to expected argument type 'PlatformViewVersion<iOSVersion, ScrollViewType, PlatformSpecificEntity>'

Checklist

Expected behavior

It must to compile without an error.

Actual behavior

Getting this error:

Cannot convert value of type '()' to expected argument type 'PlatformViewVersion<iOSVersion, ScrollViewType, PlatformSpecificEntity>'

Steps to reproduce

Add this code to the source code:

        .introspect(.scrollView, on: .iOS(.v13...)) { scrollView in
            // ...
        }

Version information

1.1.2

Destination operating system

iOS17 & iOS16

Xcode version information

Version 15.2 (15C500b)

Swift Compiler version information

arm64-apple-macosx14.0
davdroman commented 9 months ago

https://github.com/siteline/swiftui-introspect/issues/354#issuecomment-1712177770