eurofurence / ef-app_ios

iOS version of the official Eurofurence app
MIT License
5 stars 1 forks source link

Swap implicit URL building contract in favour of compile-time builder #218

Open ShezHsky opened 5 years ago

ShezHsky commented 5 years ago

The APIURLProviding protocol allows injecting a base URL for contacting the backend, however the absence of a trailing slash is an implicit contract all clients of the dependency need to be aware of. This causes breakages when concatenating a path without the slash.

Instead of injecting a value, passing in a factory to give us back a prepared URL for a path moves this knowledge into the dependency and allows clients to not care about the structure of the URL being passed in.

ShezHsky commented 2 years ago

Alternative approach: APIURLProviding spits out an NSURLComponents