Search code examples
iosscrollviewdynamic-data-display

Display all the records from a database in a view controller - iOS


I am new to stack overflow. I am developing a mobile app for iOS. In which I want to display all my records from the database in my single view controller. I can assign label for each data in the record. But it is not possible to assign label for each data in the database. So kindly advice me to display the records as a set. Like.

  1. 1st Record - Data, data, data, etc.,

  2. 2nd Record - Data, data, data, etc.,

I need this in a scroll view. Like eCommerce products listing page.


Solution

  • It Depends on your requirement as if you like to show them in a list then you can go for UITableView and if like to display them in a grid then you can use UICollectionView

    1. UITableView --- To Display content in a sequential list
    2. UICollectionView --- For Grid of n*m rows and column