Kanishka
Kanishka

Reputation: 77

How to communicate between 2 framework / library

I have one module in one application say chat module now I want to take it into another application (By creating a framework or library not by dragging and dropping its classes to other applications). How can I do this?

for Eg: I have one framework called network framework which has methods:

func GetDataFromAPI()->Data

Now I want to create another framework say Chat, Settings, Live Status etc framework. I want to develop it in a way that I can use it in my other projects as well. For this, I have used Swift package manager and created one separate framework for each (Network, Chat, Settings, Live Status etc). Now my problem is I have to call API in each framework to get data but my api calls is written in network module. so my question are as follows.

a) How can I access this network module in another framework? b) Do I need to import this network module in all other modules? If yes then how ? If no then what will be the best way to do with such kind of problem?

Image

Upvotes: 0

Views: 285

Answers (0)

Related Questions