mapzen / ios

Where you can find everything iOS from Mapzen
https://mapzen.com/projects/mobile/
Apache License 2.0
40 stars 24 forks source link

Add assertion checks for API key usage #259

Open msmollin opened 7 years ago

msmollin commented 7 years ago

We should be more aggressive about checking for API key usage in the SDK and utilize something like Cocoa's assert() to avoid assertions being compiled into production code.

msmollin commented 7 years ago

@sarahlensing i think this is done now?

msmollin commented 7 years ago

Or did we only add this to the sample app?

sarahsnow1 commented 7 years ago

We only added it to the sample app so we should keep this open and update MapzenSearch, etc.

msmollin commented 7 years ago

Looked at this a little bit and we do kinda already check for this, but just in MZMapViewController https://github.com/mapzen/ios/blob/master/MapzenSDK/MZMapViewController.swift#L1082

And it throws, it doesn't assert the api key missing. Since I can't change that API do you think I should just add an assert into that? Or should I have the other places throw as well?

msmollin commented 7 years ago

After discussion we're going to make this assert and change the call to not throw anymore and deprecate all the loadStyle* functions and create new ones that no longer throw as well. We'll release this as part of 1.1.0.