iOS: Everything you have to consider when building a network layer

This is our architecture

Building a Network layer: good practices

Injecting the endpoint

Making the API call and handling errors from the back

Checking the data

Parsing data

Place this code bellow the latest line inside our function

Creating a contract to our API class

Conclusion

--

--

--

iOS developer- WWDC19 scholarship winner- Blockchain enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Create Simple, Custom UINavigationController Transitions

iOS Unit Testing in a linear layer-based architecture

Circular Doubly Linked List with Swift

What’s New in Xcode 13?

Better Way to Observe Keyboard Notifications With Swift | iOS | SOLID

Multi-Threading and Race Conditions in Swift

How to increase app rating in AppStore?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pedro Alvarez

Pedro Alvarez

iOS developer- WWDC19 scholarship winner- Blockchain enthusiast

More from Medium

How useful is the coordinator pattern in an iOS application?

The Best Way to Organise iOS Project Architectures

Swift | Advanced Protocols in Swift

(iOS)Manage Firebase environments for Development & Production effectively 🎯