This is an issue I encountered in my project. Usually, I develop the logic separately, outside the main project. Once it’s stable and working correctly, I integrate it into the main project.
So previously, I created an article about this in a collection view that contains two different data arrays. This is an example I made for my project. The implementation is based on the code from the previous article.
The Issue
I recently discussed with the backend team and learned that the data structure for new users is always consistent: 4 stocks and 4 funds. However, if the data is empty, it indicates that the user is an existing one. Despite this assumption, I discovered yesterday that the data from the backend was disorganized, causing inconsistencies in the app. For instance, instead of 4 stocks and 4 funds, the data appeared as 1 stock and 4 funds, leading to a crash in the app.