Create Your Own Networking Framework for iOS

Pavlos Simas
5 min readDec 16, 2021

Create a framework using Xcode that you can make network (http) calls and use it in every iOS project.

Photo by Pixabay from Pexels

Open Xcode and create a new project. In the first screen that appears we need to select Framework as a template for our new project and hit next.

For our tutorial we put as a product name the label “Networking”.

We need to create only 3 files to start using our library. Our files will be name as “ServiceManager”, “HTTPError” and “HTTPMethod”.

Now that we created our empty files let’s explain what they should do. Let’s start with the HTTPError.

Think what kind of errors an http service could return and let’s put some of them in our enum class. Currently i’m thinking only 4 kinds of errors (of course you can add whatever you want). I added the “url failed” error which…

--

--

Pavlos Simas

iOS Developer, with passion about Development, Marketing and Finance. Join Medium from the following link: https://simaspavlos.medium.com/membership