tableview controller, embedded tableview, or something else for this interface? - ios

I'm trying to figure out what kind of iOS user interface element(s) I should be using to create this interface:
At the bottom of this view, there is a list of items. This list of items can be arbitrarily long. As such, and because of the standard detail disclosure indicator and so on, it makes sense that this is a tableview.
However, the items at the top are not tableview cells. The obvious answer then, is to simply place a tableview on the view, i.e. an embedded tableview. But this leads to another obvious issue, which is that this entire view should be scrollable - there will be a button for "Add Item" underneath the list of items which you will need to be able to scroll to, and the interface will be crappy if the whole view doesn't scroll.
So, I could make it so the tableview is not scrollable, and is just as tall as it needs to be to include as many items as it needs to. Then, the entire view is embedded in a scrollview, and scrolls properly. My concern with this relates to memory management, if I do this, I don't think I'll be taking advantage of the dynamic cell creation that is inherently part of a scrollable tableview, and will instead have dozens or even hundreds of cells instantiated when the view loads.
Another alternative would be to make the entire interface a tableview, with the top portions, and the bottom button, implemented as custom tableview cells that are different from the cells that show items. In the past, however, I've found that this is a pain-in-the-ass too, but perhaps it's a pain I must endure.
In general, I feel like I'm missing an obvious approach here, since this seems like it ought to be extremely simple to implement, but I'm currently at a loss. Help is appreciated!

jjv360 mentioned it correctly, this should be 1 tableview with sections and custom cells. The different look comes from nice images.

It's all a tableview with a single cell type, and 4 sections.
The cell has an optional image, a label and the optional disclosure indicator. If those don't exist, the label expands to encompass the full space.
It's very easy to do, quite standard.

Related

How to achieve a (almost) full view uitableview that can scroll past the last cell and show further elements in iOS

I have attached the below image because it describes my problem better than words:
So basically, I need the Title/Subtitles part at the top to always be static, after that a dynamic UITableView which will have a lot of cells (mostly will fill the rest of the screen), and then after that a few additional elements such as a Map View and etc.
I'm using storyboards/xibs for this so it was also an issue of how to constraint everything in the designer properly. Would a stack or scroll view be appropriate for this?
I think you can take two paths to achieve this.
The first is to create a custom cell containing the map and another containing the "Paragraph of text" thing.
Then you only need to push the cells at the end of the original data source.
Keep in mind that you need to add this cells to the RowsInSection function.
The other way is add a custom footer view to the tableView.
You can create a custom UIView containing the map an other info and then tell the table to take the custom view as footer:
tableView.tableFooterView = customView

How can I place a view between cells in collectionView?

I want to place a view between cells in a collectionView. Like an ad. to be added dynamically after they see the first 3 cells. Is there a method to do that?
If you could figure out a way to do that you still shouldn't. A collection view owns the area it draws in. It's in charge of placing cells where they belong within it's content view, and you are supposed to keep out.
That said, collection views are extremely flexible and you could design your collection view to display a set of "normal" cells, an ad cell, and then more normal cells. If your ad cells are different sizes or need to be spaced differently than your normal cells then you might have to create a custom collection view layout.
No, you can't. But you can add a UICollectionViewCell which will contain advertisements or something else you want to be added. It is really simple. Just create two prototype cell. First cell will contain your data, second one will contain some extra data.

How to make cell doesn't scroll along with other cell?

I am making an app that use table View Controller and static cell.
I want to make first cell don't scrolling while other can. This is a picture of what i am talking about.(Sorry for my bad English)
For example as in this picture, I want to make 9gag tab stay when scroll. If you play instragram you will see that when you scrolling the name of user will stay until you scroll into another one. However I want it to stay not changing when it encounter second cell.
Any suggestion?
Using UITableViewController would not help here. You can use these steps to get what you want:
1. Create a UIViewController.
2. Add UITableView as its subview.
3. Add another UIView as UIViewController's view's subview.
4. Using auto layout constraints, you can put UIView above UITableView
This way, you will get a sticky view at the top.
Ok, not exactly sure what you're after but i'll take a stab.
Firstly, if you want the section to remain in place until a new section of items is present, you just need have a look at sections. This is an automatic feature. You may not see it occur until you have plenty of items in the sections.
UITableView With Multiple Sections
There's plenty of stuff about it & not too hard to implement.
My other guess of what you want:
If you want it to remain static regardless of anything, perhaps you could just create a view and place it above the table view. why does it need to be a part of it if it doesn't change?

UITableView Show a "loading spinner" when scrolled passed bottom

I would like to show a "spinner" at the bottom of my table (like the current Twitter iPhone App) when my users scroll passed the last cell in my table.
I thought about adding a static cell and adding 1 additional row to show the cell at the bottom, however, I think this is going to look crappy if I only have, say, 2 cells.
I looked through a bunch of Google searches, however, I didn't really see an answer. I thought about pulling up a "loading view" once my scroll view for the table reached a certain point, however, I think I may be over-thinking the situation.
Any help or direction would be awesome... thanks.
I would recommend that you add a UIActivityIndicator to a view and set that view as the UITableView's footer view.

How to create a layout like Featured page in App Store?

I'm new in iOS development. Based on my assumption, Feature page in App Store was created using a combination of UITableView and UICollectionView. But how to do that in theory and code? I know it's a bit vague, because it's quite hard to describe it, but I just need some people to help me explain it.
For this case I will try to use these naming:
1. Top section, it's a view which showing banners of apps, people can swipe it to view another banner.
2. Middle section, views which can be scrolled horizontally. (Best New Apps, Best New Games, etc).
3. Bottom section, starts from Quick Links to the bottom.
Questions:
1. The scroll indicator is starts from the root view's top guide, that's normal, but:
a. When we scroll it up, the bounciness is start from the middle section. How to do that? Is the top section and middle section is a separated view? But how can the scroll indicator is started from the root view's top guide if top and middle section is a separated view? (Separated view means that the views should have different scroll indicator unless it's actually subviews of UIScrollView).
b. When we scroll it down, there is nothing that floating. So it looks like that the whole page is a subview of a single scroll view but the bounciness is starts from the middle section. How to create that bounciness effect while only have one scroll indicator for the whole page?
2. In the middle section, there's a several collection view that has horizontal scroll direction. Is it the best way to create it like that is to use UITableView with cell that has UICollectionView inside it? It looks like it was created that way, but:
a. Is it the most efficient way to do that?
b. Because of the case in my first question is my source of confusion.
3. The bottoms section has a different separator from the middle section. The middle section has indentation while the bottom section doesn't. How can I do that if the case is it's a UITableView?
My whole question is just how to create a layout like that. If you cannot help me by providing me some sample codes that's fine, please just explain me the concept or theory of how to do that.
If the whole answer is just I have to create it using vertical/horizontal UIScrollView from scratch that's fine. I just want to make sure of that since I tried to avoid dealing with creating manual tiling.
OK, I think I finally found my own answer.
First, I need a UIScrollView to be root of the view. Then I set the contentSize to be a specific value.
The top section can be a UIPageController or a horizontal UIScrollView.
The middle section is a UITableView with scrollEnabled to NO and cells are static. The static cells (could also be dynamic cells) will contains UICollectionView. Since the scroll is disable, it will use the scroll from the parent UIScrollView. So that's why I can get the same bouncy effect in the middle section.
The bottom section is just another cell of a UITableView.
Thanks.
This might help you with implementing UICollectionViews in your UITableViewCell: http://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell
To make the first cell "float" in the TableView you could make sure that cell never goes out of screen in scrollViewDidScroll

Resources