I have a requirement to show the Data in Linear Vertical List in iPhone and in Collection/Grid in IPAD
In the iPhone, it should look like
But In Ipad, it should look like
I have already implemented in iPhone through table view but don't know how to show it as grid view in IPAD
Here are my questions
should I have to create the Separate view controller for Ipad if yes then how can I define two view controller one for iPhone and other for iPad
what is the best way to achieve this?
please help me I am trying to implement it but can not find any way.
(Note)Images are copied from Vimeo iTunes app https://itunes.apple.com/us/app/vimeo/id425194759?mt=8
You don't need to create two different controller's for IPAD
and IPHONE
. Just create one controller with UICollectionView
and then use UICollectionViewFlowLayout
for your UICollectionView
to set layout of UICollectionView
according to the device weather it is IPAD
or IPHONE
Try this solution if you have any doubt pls let us know.
Try this solution
UICollectionViewFlowLayout *collectionViewFlowLayout = [[UICollectionViewFlowLayout alloc] init];
[collectionViewFlowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
self.myCollectionView.collectionViewLayout = collectionViewFlowLayout;
Also you can use multiple properties of UICollectionViewFlowLayout
.
Check this solution and let me know if it works for you.
Check these links for reference :