Difference between table view controller and a table view placed within a viewcontroller - swift

I am making an app and would like to direct my user once they log in into their dashboard, I have seen some apps display things in what seem like a table view controller or a view controller with a table view. I would like to display the logo up top and then a table displaying their username then about 4 more rows displaying other info then at the bottom a tab bar. What would be the best way to go about this?
any advice welcomed. If relevant I am using swift, Xcode7 and parse to handle my users

Use a UITableView. This a bit more customizable in terms of Storyboard layout. You can place UIImageViews, toolbars, and other elements all over your UIViewController. You can then put a UITableView in the exact place that would work for you, with the dimensions you need.
Of course, you could always use a UITableViewController. You could embed this controller in a variety of combinations, which would let you add tab bars or navigation bars.
The only real difference in implementation is that you have to remember to explicitly write the delegate and data source methods when using a UITableView.
For your case, I would pick whatever seems easiest to implement in your case. Probably a UITableView in my opinion.

Some differences between UITableViewController (TV) and UIViewController with TableView (VT) I know:
You can add other controls into VT and pin it to anywhere you want. TV can't do that.
You can add many same group of controls without add constraints with TV. VT you have to add constraints.
You don't want to worry about scrolling in TV with many group of controls.
With TV you can create static table cell but you can't with VT. Static table works on TableViewController only.
In your situation, I use UITableViewController with static table to achieve that.
Hope this can help.

Related

How to make a horizontal scrollable UITabBar in iOS?

The UITabBar in my app consists of 10+ items, but the width is enough to put all 10+ items.
How to make a horizontal scrollable UITabBar in iOS ?
Thanks.
You'll have to roll your own to at least some extent.
What might work, would be to create a UITabBar view (not the controller) and embedded it in a UIScrollView. You could then use that in place of your regular Tab Bar control by adding it to your TabBarController.view/tabBarView or something. Of course you'd have to play around to get it to look right, and I'm not sure if just setting the view to something wider will actually make it display more items or not.
Of course, for best results you'd probably want to do something entirely custom.
From Apple's Developer Portal:
If you add more than five items to the viewControllers property, the tab bar controller automatically inserts a special view controller (called the More view controller) to handle the display of the additional items.
Source
Seems like you will need to make a custom tab bar.
They also said this in the next paragraph:
Although the tab bar view is a key part of your tab bar interface, you do not modify that view directly.
You might be breaking Apple's design guidelines by doing this.
You can certainly go and create a custom class of the UITabBar (embedding it into a scrollview etc.)..but why re-invent the wheel? After searching around I found several third-party classes already created that work well and are easy to use and highly customizable..In order of personal preference:
M13InfiniteTabBar -
https://github.com/Marxon13/M13InfiniteTabBar
JSScrollableTabBar -
https://github.com/jasarien/JSScrollableTabBar
InfiniTabBar -
https://github.com/iosdeveloper/InfiniTabBar

How to switch to a TableView from a first View?

I'm working on my first app and I've issues on how to layout some of its logics.
Basically, what the app is supposed to do is to show a first screen when launched where user can fill in some values and press a button that opens a tableview which shows results. The first screen (view), outlets and connections are all working fine. The issue I'm having is how to leave this "home" search view and show the results to the end user on a table view. Right now, I've only 1 view with its related View Controler and this controller handles the tasks of taking user inputs and get results throughout a HTTP post request.
I need your guidance...Thx in advance
Stephane
Is there a reason that this all has to happen on one screen? iOS is set up to allow for this to happen very easily and (I think) attractively by using a UINavigationController and pushing in a new view controller (could be a UITableViewController or simply a UIViewController that contains a UITableView).
If you MUST have all of this take place in one view, Swastik is correct that it will require some view acrobatics. One way to do it attractively is to use the UIView animations introduced with iOS 4.
Here's Apple's UIView documentation: UIView Class Reference
Specifically, check out the CLASS methods of:
1. animateWithDuration:animations: (with or without completion:)
2. transitionWithView:duration:options:animations:completion:
Note that these methods will require you to learn a little bit about blocks, but it's worth it and I think blocks give tremendous power!
With the methods mentioned above, you could fade out your form and fade in your tableview, or maybe just move the form off-screen while the table view flies in. The possibilities are limited only by your imagination.
u can add a table in ur xib.Initially make it hidden, & when u need to show it unhide it & also if u want to update table's data , you can reload the data of the table.

Cocoa Touch drop down box on iPad

I am implementing an iPad app that needs to make use of a drop down box or something to filter items in a tableview.
Can anyone suggest a control? I can't use the picker view (because you can't adjust height) and the segment view can't hold enough items.
In this instance, I'd be tempted to use a UIPicker view in an UIActionSheet. (Or other similar modal dialog.)
That said, it might be more appropriate to use a Search Controller to filter the UITableView. (Really depends on the application.)
Sounds like you could just use a Search Controller to me, is your data categorisable? You could be better off just creating a hierarchy and navigating through it using a Navigation Controller to move between tableviews.

How to recreate the iPhone app store application detail view?

I'm trying to get a view that is similar to the the application detail view presented in the app store but I can't figure out how it is implemented. It looks like a UITableView with 3 or 4 custom cells. Does that sound right? Any insight would be great.
Thanks.
Nah it's not like that at all. What it is, is a couple of scrollviews (ie., the screenshots is just a scroll view tied to a paging control), directly above that is either a web view or a scroll view (hard to tell) -- with the actual content. Above the content you'll have a few items in the content view that holds everything, the app icon, name, company, etc. And at the very buttom, you can implement it as a table view if you want, but yes, you'll need custom cells, which isn't difficult to do, you just have to implement the tableView:heightForRowAtIndexPath: delegate, and return the appropriate height for each cell in that view, then in your tableView:cellForRowAtIndexPath: switch on the indexPath's row property, and if it's one type of cell, set it up how you need to, if it's another, do that custom cell, etc.
It's not really hard at all. I reproduce a view similar to this in one app that I work on in the store, and I do it pretty much just as I described above.

How can I simulate UISegmentedControl with custom buttons?

I'm just beginning to try out development for the iPhone. My requirement is very similar to thar provided by a UISegmentedControl except I need custom buttons instead of those in a UISegmentedControl.
Here's more detail:
I need one view controller which loads the first view having 3 custom buttons on the top. Below the buttons, I need to load different views (Views?) based on which button is tapped.
Is it possible to use IB to design just the lower part of the view talked about here? I want to use as much of IB I can here.
I don't understand why you can't use a UISegmentedControl here? If you drag a UISegmented control onto a Navigation Controller in IB it will be added as a "custom" button control that looks just like a UISegmentedControl. It's found in Apps like YouTube etc. You can then configure it to have three sections and connect up an IBOutlet/IBAction to it easily too.
Edit: Also, if you use a Navigation Controller, you can very easily use IB to design your other views, as that is how Navigation Controllers work - they load their subviews typically from other nibs. Therefore this would accomplish all you want.