Open teamdisc opened 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.
The
UIPageViewController
is used and each survey is displayed aUIViewController
. 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 aUICollectionViewCell
, instead of a view controller. I like how you createdPageContentViewController
protocol, but my concern is that, I think, the knowledge ofpageIndex
is not required forSurveyViewController
to have as its parent (SurveyPageViewController in this case) should be the one who handles it instead. Let's say that ifSurveyViewController
is to be reused in the future and it won't be a child of any page view controller, it will have an unusedpageIndex
property for no reason. 👍🏻