What is proper way to show data like app store app(Collection view inside table View) - ios

There are lots of stack-overflow thread and community articles but i just want to know which one is better to show data like App store App(Vertical scrolling of apps and sometimes horizontal scrolling inside vertical scrolling). So far i understand below might be possible solution.
Solution 1:
Collection View inside tableView. So that products can be scrolled horizontally inside tableView cell.
Solution 2:
Number of collection View inside a scrollView stacked one after another if categories are specific.
Is there any better solution to make such type of scenario?. Your opinions will be highly appreciated. Thanks

A general suggestion based on my usage, create a tableview and inside it's tableviewcell create a collectionview. You may use staggered layout for a better user interface. That is what I have been doing, you will build it much easier.
Rest depends on your usage and requirement.

Related

Creating a menu in iOS

I'm currently creating an update of my iOS application and I'm a bit stuck. I've tried to googling around but cannot find a decent answer on this.
I've a menu which links to different views. And I'm not really sure if I've done it the best method.
I've created a view, and added the links into a stack view. Should I considering changing it all to a tableview? or a collection view? Or maybe there's another way?
The current look:
Should I change this to a tableview? collection view? or something else? Or just let it stay as it is?
If the number of items in your menu changes at runtime and is large, you should use a table view, because a table view is good for efficiently displaying a screen's worth of items from a large list of items.
If the contents of your menu is small (under maybe two screenfuls of items) and fixed at compile time and you are using a storyboard, then you could use a table view with static cells, if you can make it look the way you want.
If the contents of your menu is small, then you can use a stack view (inside a scroll view) if that is easier for you. There is no particular advantage to using a table view over a stack view to display a small amount of content, unless you need other features of the table view (like the ability to select/deselect rows).
Based on the screen shot you posted, I'd either use a table view with static cells (since the screen shot is from a storyboard) or a stack view, depending on whether I can get the appearance I want from a table view. If, as in the screen shot, the buttons must be centered vertically, I'd use a stack view, because it's easier to vertically center the content with a stack view.
Look, the fact of have many itens on your screen is clear on the mobile applications, to make it easy, we have collecions view like UITableView and UICollectionView. On the UITableView's case, this implements the scrolling and have methods do handle the operations' list, you can see the documentation to check these methods: https://developer.apple.com/documentation/uikit/uitableview.
Main reasons to use UITableView
Implements scroll behavior.
Independent of size screen you can access all itens.
Easy to detect interactions like tap on cell.
Easy to make changes, like insert and remove content.
The UITableView exists precisely to solve problems like you has.

Can anyone suggest what to use to make the UI screen as Mention?

I have design the UI for the below screen as I am little bit confuse that what should have to use for the below screen. As you seen the on the screen below things:
1.Scrolling part of Images swap.
2.Again another Scrolling images Swap.
So here for the scrolling Images what should I use its Collection View for both or Pagecontrol for one and Collection view for other. Please suggest me.
Thanks and Appreciate for the help...
Use UITableView and in its cell use UICollectionCell so that you can scroll horizontally and vertically.
see Back image, this is how you can implemented output looked like.
As Tinu Dahiya pointed it correctly, You should use tableView and custom tableViewCells to achieve your UI design. This approach will also make your coding easy to handle dynamic contents which you might be fetching from server. For your reference you can directly use this control from cocoa controls. This control is ready made dish for you, you just have to implement your logic to achieve your functionality.

Best practice add multiple object at one page on storyboard

I am wondering what is the best practice for creating a page in storyboard that consist of multiple object (It can be imageView, View, label, etc). Look at this image, I feel ridiculous adding new object under the bottom view that is outside the page view.
I know a little how to arrange view with relativeLayout etc in Android. But how can I arrange this page with storyboard and autolayout? I want to arrange a page that consist of multiple object with different size. This maybe a stupid question, but I mean it a lot for me as a newbie developer. Thank you.
Its hard to say without knowing more about what you are trying to do.
It looks to me like it might be a good candidate for using a UITableView. You'd create a table view and add cells for each of the items that you want.
You could also create a scroll view and install the items on the scroll view, either through custom code, or with AutoLayout if there are a fixed number of items.
You could also use a UICollectionView if you need a layout other than a vertical scrolling list of items.
Edit your question with more details on what you're trying to do if you want more specific help.

Scrolling across UITableviews

I have a situation where I need to scroll across UITableViews. The number of UITableViews could be any number, it is dynamic. In that case which of the following implementation would be better, taking into account the memory intensiveness, UX and overall efficiency ?
To have a scroll view on which I put all the tableviews
To have a collection view on which I put the tableviews on each cell of the collection view.
or any other suggestions are welcome.
Thanks
TableView inside TableView or TableView inside CollectionView will be good approach other wise view reuse functionality has to implement by you.
As you say your data us dynamic
instead of providing scrolling to inner and outer tableview you can populate data in inner tablView they will grow as much data is present and out tableview will contain these inner tableviews and serves as scrollview (provide scrolling/ pagination)
Hope it helps.
If, based on your comments, you want to have multiple table views that you can scroll horizontally between, I would highly recommend creating a page view controller where each table view is a page. If you're unfamiliar with how to create page view controllers, I have a little open-source project that makes it easy to build your own, or alternatively look at my code and replicate it.
https://github.com/mamaral/MAPageViewController

iOS UI - Toggling between UICollectionView & UITableView in one screen

The question is hopefully pretty straight forward. In one of the tabs of my application where I'm presenting a set of data from Core Data, I want to give the user the option of a Grid view or Table view. Both views should share the same custom header with a button in the header that let's them toggle.
I see it in other apps all the time, but couldn't return any searches. I'm getting stuck on how to flip between the 2 controllers based on different classes.
Any help or guidance is much appreciated. Thanks a lot!
Assuming you are using a UICollectionViewFlowLayout, just adjust the itemSize property of your items to be the width of their containing view.
Bam. Instant "table view"
Sure, it's not quite a tableView, and reasonable people can disagree over when a tableView might be more appropriate than a collectionView, but for what you describe (giving the user a choice between rows or grid), it's probably the magic bullet you seek.

Resources