Validator icon indicating copy to clipboard operation
Validator copied to clipboard

Swift Compiler Error due to multiple Ambiguous use of 'validate' error

Open code-draft opened this issue 4 years ago • 12 comments

After updating to Xcode Version 11.0 (11A420a) on macOS Mojave Version 10.14.6 (18G95), with Cocopods Version 1.7.5, Validator Pod Version swift-4.2

pod 'Validator', :git => 'https://github.com/adamwaite/Validator.git', :branch => 'swift-4.2'

I have been facing this error.

image

code-draft avatar Sep 24 '19 04:09 code-draft

@code-draft I have got the same issue on Xcode 11

kennybuc avatar Sep 24 '19 09:09 kennybuc

me too, any fix?

antonioreyna avatar Sep 25 '19 04:09 antonioreyna

Hi guys I'll look into this when I get a bit of spare time. I haven't had chance to run the lib on Xcode 11 yet.

adamwaite avatar Sep 25 '19 06:09 adamwaite

I got around this problem by renaming the validate function by adding an extra e so it wouldn't clash with what ever was causing the ambiguous errors.

I don't have and swift/objC experience as I work mostly in react native, so I don't know if this will have any ill effects.

   open func validateOnInputChange(enabled: Bool) {
        switch enabled {
        case true: addTarget(self, action: #selector(UISlider.validatee), for: .valueChanged)
        case false: removeTarget(self, action: #selector(UISlider.validatee), for: .valueChanged)
        }
    }
    
    @objc private func validatee(sender: UISlider) {
        sender.validate()
    }

Moistbobo avatar Sep 27 '19 08:09 Moistbobo

Anyone is working on a PR for this?

mostafakram avatar Sep 29 '19 12:09 mostafakram

I have got the same issue on Xcode 11, any fix?

baha-che avatar Oct 03 '19 12:10 baha-che

Funny thing. I cloned this and was about to make a PR. But the source builds fine in master. It's been fixed, but not released:

https://github.com/adamwaite/Validator/blob/master/Validator/Sources/UIKit%2BValidator/UITextField%2BValidator.swift

EDIT: It was fixed in this commit: https://github.com/adamwaite/Validator/commit/cf7232e375cff3d87238afee36825bb1eafeaae8

EDIT 2: I'm a dingus 😂. This change has been released; I was sitting at an older release. This doesn't build under Xcode 11 still, but this isn't the error I'm getting with the latest release. I'm seeing the same as #129.

drdaz avatar Oct 08 '19 13:10 drdaz

I guess this one is the cause: https://developer.apple.com/documentation/uikit/uiresponder/3229892-validate

Added in iOS 13

ssferrazza avatar Oct 20 '19 09:10 ssferrazza

@code-draft the problem is that you are using outdated branch instead of master (where everything works as expected). Or are there any requirements to use that branch?

Just use: pod Validator

piv199 avatar Oct 25 '19 14:10 piv199

I'm using 'pod Validator' and the error still remains. Some news?

FabrizioSposetti-U avatar Oct 29 '19 11:10 FabrizioSposetti-U

@FabrizioSposetti-U Have you tried pod update Validator? The latest version is 3.2.1. Check your Podfile.lock.

piv199 avatar Oct 29 '19 11:10 piv199

Yes, it works. Now im facing troubles because of merge method. I was using it a lot and it does not exist any more. I have seen that there is an other issue associated with this.

FabrizioSposetti-U avatar Oct 29 '19 12:10 FabrizioSposetti-U