Need some advice whether to use static stable view or dynamic table for my project - ios

I am exploring the development of my first iPhone app (Xcode and Swift 3) and I need some direction and advice. I have a need of a multiple level expanding and collapsing table. I've attached some screens of a web app I developed to help you understand where I am going. In my app there are main level items, which expand to show sub items, which expand to show the contents of that item. And not every sub item (when expanded) has the same elements. Some sub items have simple text fields while other items have questions with yes and no answer options. I am so green I don't even know where to start with pulling this off in an app. I have worked through some tutorials on expanding and collapsing dynamic cells but I am unaware if that is the best way because not all of my sub cells contain the same contents. Should I use static cells instead? Or is there a way to create cell templates (like include files in php) and call them in to the table and populate them when I need them? I am lost and need some direction. Any help you can give me would be greatly appreciated. I would love tutorials as well. I have a Lynda.com account if you are aware of tutorials there I should follow. Thank you!
one of the simple layouts
a different layout

I think this lib could help you.

Related

How to create a dynamic drop down within a table view?

I need to create a tableview with at least two sections, transportation and hotel. Tapping on either one creates a drop down view showing info on 1 to n examples of the topic selected. You don't know in advance what data is going to be there so it has to be dynamic to present any number of results with some having lengthy descriptions below each example and some not. I've been racking my brain and I can't figure out how to do this. The dynamic nature of this makes it extra difficult. Here is a mock up of what it should look like: click here
Check out this Git-Repo. I am using it inside my app and its working quite well. You can also watch the tutorial for it: https://www.youtube.com/watch?v=22zu-OTS-3M&t=1s
Hope that helps!

What is the best way to make a data grid in swift?

example
Good evening everyone!
Part of my requirements for the app I am building has me creating a data grid similar to the example linked. I have spent the entire day searching google and this site in order to find the best way to get started in swift. I have read so far that both a table view and a collection view could work, but that a collection view is preferred. My data grid doesn't necessarily have to be scrollable but the data does need to be editable. I don't have much experience using either tableviews or collectionviews and I'm looking for the simplest implementation without relying on a third party dependency. Any help or direction is greatly appreciated.
Since I don't know your experience level, I will explain at a basic level - my apologies in advance if it's too basic :) A UITableView displays rows of data, while a UICollectionView displays cells in a grid.
So, at first, a UICollectionView might appear to be the better option. But as always, things get complicated pretty quickly :) For example, are you going to implement your UICollectionView as one cell for the whole row, or are you going to implement a cell per column in your table of data? And if you implement cells per column of data, how are you going to handle the different types of cells you might (or might not) need for each column?
There are multiple decisions that might need to be made, and only you know the answers to a lot of these :)
But the simpler option probably is to go with UITableView and that's what I'd suggest if you are new to both UITableViews and UICollectionView. Try out a UITableView-based approach first and if that doesn't work, or you see limitations, then try a UICollectionView. The experience you had in building the UITableView will help you in moving on to UICollectionView anyway :)

TVOS about App layout (Like in iTunes and similar)

I have played a lot with my app and I do not understand how to make layout like in for example iTunes (also many apps uses it).
How it is made? It is one big CollectionView, but with special Flow or it is TableView with many CollectionView?
Collection headers. In iTunes App if I select item (with adjustImageWhenFocused) under the header then the header will jump up and the item will not overlap the header. It is special magic or it is system behavior and I just do know how to use it?
Below is two screenshots about what I am trying to tell you and example with my app.
In iTunes there are movie preview page. With what type of View it is made? TableView,CollectionView or just ViewController with ScrollView?
I have read many sources and looked up demo projects, but nowhere I have found answers for this questions.
1) I think it would be a stackTemplate containing a couple collectionLists.
2) AFAIK the headers "jump up" on their own, no need to prepare anything special.
3) productTemplate?
For examples, see https://github.com/iBaa/PlexConnectApp, /TVMLTemplates/Default/Movie_OnDeck.xml (1) or Movie_PrePlay.xml (3).
Or check the gold source: https://developer.apple.com/library/tvos/documentation/LanguagesUtilities/Conceptual/ATV_Template_Guide/StackTemplate.html, plus other Templates.
If you want to use native Swift way it can be achieved in following ways:
You can use table view and have collection view within each cell. I am using same approach to achieve this.
We have focus update delegate from there you can find the focused frame of image view. With the help of focused frame and label frame you can check if they are intersecting or not. Based on that you can move label up and down.
This is native TVML template, in order to achieve in swift you need to create view using tableview and collection view.

IOS table view inside of a table view

I have a table view with expanding cells for each of them. I want to make every expanding cell be a new table inside of the bigger one. Is that possible? I've done the research, someone said that duplicate UITableView cannot put in one file.
For example
dish order1
=================
dish order2
rice
coke
===============
dish order3
which every "dish order #" is a cell of a table, and when you expand one cell, there will be a smaller table appears. I've done all the expanding stuff. But don't know how to put a small table into a bigger one. Thanks
Well if i understand your question correctly, what you search is called nested tableView, here's some examples:
SDNestedTable
ExtensiveCell
CollapseClick
JKExpandTableView
Good luck.
It would likely be impossible to put one table view inside of another table view, and if you did manage to do it, it would be awful. Ask yourself, have you EVER seen this in a commercial app? If not, as a novice iOS developer, you are out of your depth trying to invent new UI paradigms.
Master the existing UI tools first. Don't try to use the UI elements in totally novel ways until you have a strong feel for the standard way to use them. Expect this to take 6 months or more.
Others have suggested a sectioned table view where initially only the first element of a section is visible, but when you tap on it, it expands to add other rows. This works quite well.
Another approach would be to use a master/detail UI, where tapping on one table view cell pushes a new view controller the uses a new table view to display detail information about the previously selected item. There are some use cases where you might have several levels of increasing detail.
I really do not think you want two instance of UITableView, instead what you want is a sectioned UITableView which expands when it's header is tapped. Apple has a good sample code for this here:
UITableView expand/collapse
i have demo for you , just got from github..
https://github.com/mitsBhadeshiya/ExpandingCell
i hope this is helpfull for you...
Have you considered using one UITableView with multiple sections? You can accomplish what you are depicting above with only one tableView.
Since this was a problem for many people in the past, iOS 9 has a thing called Stack View, it does exactly what you are saying.
Check out this article.

indexed list with static cells

Newbie here,
A couple of questions:
I must use a static cell type in order to use an indexed list, correct?
I ask this because I've created an app with dynamic prototype cells and have realized
that I want to use an Index List for navigation. It's a dictionary app.
If I must a static cell type, how do I add a search bar?
I want users to be able to search at the top as well as use the Indexed List. Like
Contacts.
How do I go about converting my code for each tab (there are 5 of them) to work with
static cells instead of dynamic prototype cells?
I' feeling fairly lost right now. Would it be better to start from scratch?
thanks
I think that you can use dynamic, but better will be when you show some code from your app.
You can ceck this video for some experience with static, dynamic and custom cells:
http://youtu.be/fnzkcV_XUw8
Sorry for write this as answer but i cant adding comments for now.

Resources