zhuorantan / LocationPicker

A ready for use and fully customizable location picker for your app
MIT License
400 stars 79 forks source link

Incompatible with Swift 5 #42

Closed Rebecca-Qian closed 5 years ago

Rebecca-Qian commented 5 years ago

I am getting a compiler error using Swift 5:

{path to project}/Pods/LocationPickerViewController/LocationPicker/LocationItem.swift:122:24: value of type 'AnyObject' has no member 'hashValue'

This is the function causing problems:

open override func isEqual(_ object: Any?) -> Bool { guard let object = object else { return false } return (object as! NSObject).hashValue == hashValue }

Since this class subclasses from NSObject, can we use the default NSObject isEqual definition instead? Thanks for looking into this.

edwardmp commented 5 years ago

I submitted a PR to fix this. I'm not 100% sure that fix is correct, but it seems so.

uknowmeright commented 4 years ago

for swift 5 support pull from:

pod 'LocationPickerViewController', :git => 'https://github.com/zhuorantan/LocationPicker.git', :branch => 'master'