ananthbh / SurveyList

0 stars 0 forks source link

Use of UIPageViewController #11

Open teamdisc opened 6 years ago

teamdisc commented 6 years ago

The UIPageViewController is used and each survey is displayed a UIViewController. This is just my suggestion tho, I'm saying which way is the best to do, but for the survey task, IMO, each survey could just be a UICollectionViewCell, instead of a view controller. I like how you created PageContentViewController protocol, but my concern is that, I think, the knowledge of pageIndex is not required for SurveyViewController to have as its parent (SurveyPageViewController in this case) should be the one who handles it instead. Let's say that if SurveyViewController is to be reused in the future and it won't be a child of any page view controller, it will have an unused pageIndex property for no reason. 👍🏻

ananthbh commented 6 years ago

I have actually made it initially with a UICollectionViewCell. But I felt UIPageViewController could be more efficient in terms of scrolling and also for scalability. My plan in using the PageContentViewController protocol and pageIndex is again more in terms of scalability. Just in case, in future if we want to use a different screen design for one type of survey. So using UIPageViewController and the protocol I thought could be a more efficient solution. But, I think the solution you proposed makes absolute sense.