adamwaite / Validator

Drop in user input validation for your iOS apps.
MIT License
1.42k stars 218 forks source link

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

Open code-draft opened 5 years ago

code-draft commented 5 years ago

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 commented 5 years ago

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

antonioreyna commented 5 years ago

me too, any fix?

adamwaite commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Anyone is working on a PR for this?

baha-che commented 5 years ago

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

drdaz commented 5 years ago

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.

ssferrazza commented 5 years ago

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

Added in iOS 13

piv199 commented 5 years ago

@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 commented 5 years ago

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

piv199 commented 5 years ago

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

FabrizioSposetti-U commented 5 years ago

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.