-
Notifications
You must be signed in to change notification settings - Fork 18
Description
- I've read, understood, and done my best to follow the *CONTRIBUTING guidelines.
What did you do?
ℹ Try and call categories/cost by enum string value for "beer_and_wine"
[CDYelpBusinessCategoryFilter(rawValue: "beer_and_wine")!]
What did you expect to happen?
ℹ Have algorithm Return "beer_and_wine" via
case beer_and_wine
What happened instead?
ℹ The CDYelpEnums class could not find a case with 'beer_and_wine' because it was named:
beerWineAndSpirits
It appears that there are multiple instances of this happening. So far I've made customizations to several similar case statements. I hate even bother with this as an issue because it's such a simple fix on our end, but I can only imagine as more and more people begin to use this awesome project people will end up confused. I'm am all for camel-cased variable names, but I think matching the variable names with the value they are equal to in the official Yelp backend may be best.
CDYelpFusionKit Environment
CDYelpFusionKit version: lateset version
**Xcode version: 9.2 **
**Swift version: currently swift 4 (also noticible in swift 3) **
Platform(s) running CDYelpFusionKit: iOS 10+
**macOS version running Xcode: HS 10.13.2 **
Demo Project
ℹ Please link to or upload a project we can download that reproduces the issue.
Here is an example search written in swift 4:
CDYelpFusionKitManager.shared.apiClient.searchBusinesses( byTerm: time_of_day_preset, location: nil, latitude: self.lat, longitude: self.long, radius: 10000, categories: [CDYelpBusinessCategoryFilter(rawValue: "beer_and_wine")!], locale: .english_unitedStates, limit: 25, offset: 0, sortBy: .distance, priceTiers: nil, openNow: true, openAt: nil, attributes: nil) { (response) in if let response = response, let businesses = response.businesses, businesses.count > 0{ for biz in businesses{ print(biz) } } }
CDYelpFusionKitManager.shared.apiClient.searchBusinesses(
byTerm: time_of_day_preset,
location: nil,
latitude: self.lat,
longitude: self.long,
radius: 10000,
categories: [CDYelpBusinessCategoryFilter(rawValue: "beer_and_wine")!],
locale: .english_unitedStates,
limit: 25, offset: 0,
sortBy: .distance,
priceTiers: nil,
openNow: true,
openAt: nil,
attributes: nil) {
(response) in if let response = response, let businesses = response.businesses, businesses.count > 0{
for biz in businesses{
print(biz)
}
}
}
This function works with case beer_and_wine = "beer_and_wine"
but not case beerWineAndSpirits = "beer_and_wine"
I apologize for the lack of tabs. I couldn't get the spacing to work