Closed Static-Flow closed 4 years ago
My hunch is it has something to do with calling it inside another closure because if I defer the creation of the ViewController until after the Firestore call I don't get any errors. I was wanting to preload them so when the user opens the view there isn't a delay while the Yelp API call finishes.
What did you do?
I am trying to fetch a business when constructing a VIewController with apiClient.fetchBusiness like so:
For context this code is eventually called from inside a Google Firestore closure where I am pulling the user's businesses from the cloud and then populating the UI with the details from the YelpApi.
I've checked to make sure the
businessId
String I pass in is valid so that's not the issue. What's also peculiar is if I put a breakpoint at the fetchBusiness call and the first line of the closure it works. So it's almost like I need to slow it down.What did you expect to happen?
I expect the CDYelpBusiness object
business
to be filled and not nilWhat happened instead?
Instead the
business
object is nil and the closure failsCDYelpFusionKit Environment
CDYelpFusionKit version: 1.5.1 Xcode version: 11 Swift version: 5 Platform(s) running CDYelpFusionKit: ios macOS version running Xcode: 10.15.3
Demo Project
I don't have a public repo code but I can show you the view controller: