making views for quiz type of application - ios

I am working on a project, in this project after login user has to answer 199 question.
there is for kind of questions like true/false, single selection, multiple selection, and short answer
so can you guys tell me what approach i should use to make views, becoz client strictly saying that each question will show on single screen.
Thanks

Yes I have create this type of Application.You just use the One Custom Cell and make design of your view and return your array in Tableview cell. so it is better to use custom cell. Otherwise you use PageView Controller to display Question.Even I have also use this and it works fine.

Related

How to create a table in swift with segue?

I'm brand new to Swift but I want to create an app that has a table and each entry in that table will lead to a new screen (but this new screen is the same for all the table entries) but depending on which table cell you click on, that screen has different information posted on it.
What are the steps I need to do to complete this? I have my story board I'm just not sure how to put this all together with code
Thanks in advance!
Well your question is very broad and not very specific. Therefore it is not easy to give a helpful answer. What I would do:
Create a UITableViewController that holds your "table".
Define a UITableViewControllerDelegate for the UITableView that will be informed about UserInteractions (especially when the user
didSelect a certain row of the table).
Based on the specific row (that was selected) you can create a second UIViewController class the shows your intended information.
I can not show some code samples because your question is to broad and things depend on a lot of things (especially on the kind of data you want to show) and how you implement your UIElements on the ViewControllers in InterfaceBuilder.
And if you are not yet familiar with the concept of a UITableViewController and its Delegate, than you should find some tutorials first about that basic technique in developing iOS apps.
You want to use the master/detail pattern. I suggest doing a search on that.

Implementing PageViewController in Swift

I can't seem to get a simple answer to this anywhere. I have a Page View Controller and similar lay-outs for all of the other view-controllers.
This is working without problems if I have one view-controller per view, but it seems very inefficient given that all the lay-outs are the same.
I've seen tutorials like this, but not for Swift. Is it possible to use a single view controller for all the pages and just switch out the text or images? If so, can you please explain how this is done?
All you have to do is make each page link to the same viewController and then dynamically change the content on each page based on the page number associated with it. You could easily have some elements that were hidden or diabled on certain views.

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.

Do I need to create a Storyboard for every Q&A in a quiz/trivia type of iOS applicaiton

Please forgive me for my n00bishness.
I am creating an app that asks several questions, and scores the result. Similar to something like an IQ test.
I would like to not have to create a storyboard for every question. I was wondering if I could create a storyboard for each question "type" and then populate that storyboard with questions from an array? For instance, while I may have 100 questions in the app, I want to only give the user 20 each time they run the app and I really only have three question "types":
Multiple Choice (one correct answer)
Multiple Selection (multiple selections allowed)
Yes or No
I would like to be able to create a standard screen for each of these types of questions and then populate the screen with text and scoring parameters from some sort of array.
If that is possible, I would probably like to create a large question set and then only feed in say 20 of 100 possible questions in a random fashion.
It seems like I also should create a "Question" class, and then spawn instances of that class for each question.
Is the the correct way to proceed?
You only need to create only one view controller for all the questions you are going to display, maintain an array of questions and make IBOutlets and IBActions for all the display components, Maintain current index of the question and write the logic for updating the question.
You can create one view controller in storyboard and then you can use different View for each category. Whenever any category is selected you can Hide/Show those corresponding views.
What you are thinking is the right approach.
You need to create just one storyboard which you'll be using to display the questions. The questions and the options being displayed on it would be dynamic.
Comment in case you are not able to find a tutorial for the same.

iOS: Coding tips to prevent redundancy

I'm making a UITableView that is going to act as a settings view controller. Obviously its going to have a few types of input. One cell might have a slider, one might drill down to another view controller, one with a textbox etc. Is there any way to avoid making umpteen different subclasses for UITableViewCell?
Try this github project: QuickDialog.

Resources