Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

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

Open
code-draft opened this issue Sep 24, 2019 · 12 comments
Open

Comments

@code-draft
Copy link

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

@kennybuc
Copy link

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

@antonioreyna
Copy link

me too, any fix?

@adamwaite
Copy link
Owner

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.

@Moistbobo
Copy link

Moistbobo commented Sep 27, 2019

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()
    }

@mostafakram
Copy link

Anyone is working on a PR for this?

@baha-che
Copy link

baha-che commented Oct 3, 2019

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

@drdaz
Copy link

drdaz commented Oct 8, 2019

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: cf7232e

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.

@ssferrazza
Copy link

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

Added in iOS 13

@piv199
Copy link

piv199 commented Oct 25, 2019

@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

@FabrizioSposetti-U
Copy link

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

@piv199
Copy link

piv199 commented Oct 29, 2019

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

@FabrizioSposetti-U
Copy link

FabrizioSposetti-U commented Oct 29, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests