xmartlabs / Eureka

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

Can't compile on Xcode 12 GM, Mac Catalyst #2076

Closed jurex closed 4 years ago

jurex commented 4 years ago

The latest release (5.3.0) does not build on Xcode 12 GM, when using Mac Catalyst as target. Error message:

Type 'UIDatePickerStyle' has no member 'inline'

Screenshot 2020-09-17 at 17 15 30
mats-claassen commented 4 years ago

Does it work for you with the function like this?:

func configurePickerStyle(_ cell: DatePickerCell, _ mode: UIDatePicker.Mode = .dateAndTime) {
        cell.datePicker.datePickerMode = mode
        // For Xcode 11.4 and above
        #if swift(>=5.2)
            if #available(iOS 14.0, *) {
                #if swift(>=5.3) && !(os(OSX) || (os(iOS) && targetEnvironment(macCatalyst)))
                    cell.datePicker.preferredDatePickerStyle = .inline
                #else
                    cell.datePicker.preferredDatePickerStyle = .wheels
                #endif
            }
            else if #available(iOS 13.4, *) {
                cell.datePicker.preferredDatePickerStyle = .wheels
            }
        #endif
    }
jurex commented 4 years ago

yes @mats-claassen, I'm able to compile the project again. Thanks!