I am working on a large iOS project, the design is not as pleasant as we would like, but I have to stick with it. (sometimes life can be a bitch).
The fact is that we have a library that basically allows you to browse the directory. You have a filter in which you specify certain search criteria, and you are presented with a list that you can click on the items of interest to you. When you click an item, you can see a more detailed description of it.
The company worked, sells the same software to many different companies that have different directories. The idea is that the library has all the basic functionality, and a project that uses it can somehow extend or completely redefine some of these interfaces.
To give an example, imagine that in my library there are 2 classes that control two views. They will be "FilterViewController" and "DetailsViewControllers". At some point in the code, these classes are instantiated. It will look something like this.

My approach looks something like this:
ProjectA side
ProjectB side
Library.FilterViewClass = ProjectBFilterViewController; Library.DetailsViewClass = nil;
Library side
The problem with this approach is that I really don't know if it is possible to programmatically create an object. Or at least I donβt know how to do it. Maybe I'm using the wrong approach, some directions will be appreciated. Txs in advance!
Ignacio OronΓ‘
source share