How to display different type of cells in a UITableview in swift?
Recently I had a project where I have to display different types of components as a listing. At the beginning the project requirements was to have a simple setup. Maximum 2 component per view. Yeah easy enough. I created custom xib files per component so I can load them up, mix them up whenever I want. By the way the overall layout was controlled by the API server so the design will be sent out from the server, so I have to layout components accordingly. If anyone wondering what a component is, below image is will give you an idea. Since we can control the interface from the API they added more and more component in to the layout. This is where I started to realize the design flow. The more components we added, the system started to lose the performance. It not only decreases the performance but also started the crash the app whenever user switch the orientation. At this point I realized I need to come up with a way to reuse the component...