Loading data dynamically is a way to load data as the user interacts, avoiding a full load of wasted traffic and stalling.
The most typical scenario is when the user views the information of the day.
The first thing I did was to use a scrollview and a three view to solve the problem. First implement a Carousel chart effect, each time the user left and right slide after the page jumps back to the middle of the page, this time the status of the middle page should be the same as the left or right slide the state of the page. So each time you load the left and right three days of data, swipe to the right, reset the three-day data jump to the middle.
But this has a problem, it is difficult to achieve bounce rebound effect, even if the code will be very messy, there is a rapid sliding when the problem caused by the inability to slide.
Later the practice is to use the Uicollectionview, the advantage is that data management is already encapsulated, and the reuse mechanism is very powerful, the bad place is every time the cell is sliding to refresh, if this is the time to interact, it is easy to cause the Dayton.
Another way is to use ScrollView, each time the sliding load a number of views on the top, the advantage is that the refreshed page is no longer the user click on the page, can solve the problem of possible lag, the bad thing is that if the user swipe too much of the words will be very memory consumption.
According to the present situation, the third way seems to be the best.
New possibilities for dynamically loading data