xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.79k stars 1.33k forks source link

Compilation Error targeting macCatalyst 13 #2081

Closed mvignau-snap closed 4 years ago

mvignau-snap commented 4 years ago

Setup

Compilation Error

/[***]/Pods/Eureka/Source/Rows/DateInlineRow.swift:40:57: error: type 'UIDatePickerStyle' has no member 'inline'
            cell.datePicker.preferredDatePickerStyle = .inline
                                                       ~^~~~~~

Solution

I tried modifying DateInlineRow.swft line 38-40 from:

        if #available(iOS 14.0, *) {
            #if swift(>=5.3)
            cell.datePicker.preferredDatePickerStyle = .inline

to

        if #available(iOS 14.0, macOS 11, *) {
            #if swift(>=5.3)
            cell.datePicker.preferredDatePickerStyle = .inline

But that did not work, so I excluded macCatalyst all together:

        if #available(iOS 14.0, *) {
            #if swift(>=5.3) && !targetEnvironment(macCatalyst)
            cell.datePicker.preferredDatePickerStyle = .inline

This works for my project, but preferredDatePickerStyle = .inline would not be executed if targeting macCatalyst 14

mats-claassen commented 4 years ago

2078 Should fix this issue. It has been merged into master. I want to let the dust settle a bit on iOS 14 to see if there are other things to fix but next week there should be a new release