How to make UIView function like UIScrollView (Objective-C)

advertisements

I have a class named Topic. And inside that topic I can create (and delete) Messages. I need to show the messages in a view that can be scrolled/swiped either right or left (Right to show the older messages, and left to go back to the newer messages). Imagine an image collection that can be scrolled sideways in a ScrollView, that how this should look like. Since the messages is being add by the user, I can't use UIImage. I am thinking of the approach that I need to add use UIView instead of a ScrollView, now my problem is how can I make my UIView function as a ScrollView in terms of displaying data?

please help. Thanks.


You should have to use gesture recognition. Check that user is swiping left or swiping right. after Identifying that you can change UIView with animation. I hope you can get me. This can be useful to you.