D
D
Denis2016-04-11 17:32:25
iOS
Denis, 2016-04-11 17:32:25

How to properly implement nested frameworks in iOS?

Hello, the task is to create a "package" of nested frameworks with the following structure:
UI Implementation
    ↳Busines
        ↳Server API
Where:
Server API : A set of classes for working with the server + classes with basic business logic (Objective-C)
Busines : A set of classes that implement some business logic bound to ViewController. Basically a basic implementation of lists and authentication screens without being tied to a specific UI. Actively uses the Server API. (Swift)
UI Implementation : This is already a specific implementation with a specific UI. (Swift)
The end user chooses the desired level of abstraction from all this zoo and uses the appropriate framework for this.
Actually, the question arose of how to organize all this business.
I rummaged through a bunch of resources and nowhere is the question and nesting of frameworks addressed. There is a similar question on stackoverflow.com:
stackoverflow.com/questions/14194577/ios-framework...
But the "Don't do this" style answer doesn't suit me. How is it right?
PS: While writing the question, I came up with the idea to put all the code in one project and to compile each level, create separate .xcodeproj files that will use only those classes that belong to them. In fact, there will be as many as 3 .xcodeproj files in the project folder for each framework.
How correct is this implementation?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2016-04-13
@KamiSempai

Issue resolved. Did almost as described in the question but even better. The fact is that for each "Target" (Target) you can specify which classes will be included in it.
Therefore, I got the following solution:
Created 1 project file. There are 3 separate targets created in this project. The first target contains classes only for working with the API, the second contains all the classes of the previous target plus its own classes, and so on.
In fact, each target is an independent and self-sufficient library. The difference is only in the number of classes inside.
You can specify which files are included in the Target in its properties in the Build Phases tab.

G
German Polyansky, 2016-04-13
@f0r3s1

While reading the question, I immediately thought to break the project into subprojects. I think this is a very good option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question