Instagram iPhone application questions - iphone

I'm developing an application like Instagram for learning iOS programming.
My application is a client for an images hosting website where users can share picture from own iPhone.
I have few questions:
When you open Instagram and you're not logged in you don't see the tabbar with five buttons. You see a black bar with two button for login and signup. How can I hide the tabbar and show a bar like that (probably it's a standard bar, right) if the user is not logged in?
Relying on your opinion, what is the role of the application's model? (should I use a model or you hint me to use only view controllers?) The first thing that comes in my mind as "data model" it's the images array. This array will refresh when a user click on the "Refresh posts" button. There's also "Popular images", so I think it's another array separated from the global images array. Should it inserted in the model, right? I ask this because I would to organize in a good way my application for model/controllers/view pattern.
If you give me some hints I would be very grateful!

Present the modal view controller without animation, like siuying said. The modal view controller can hold its own instance of UITabBarController, so you can have a tab bar there that has a login tab and signup tab or similar. Behind, in the real, main view controller, have your normal five or however you're doing it. That way, once the user is signed in, you can just dismiss the modal view controller. Easy
I don't entirely understand your question here. Load the images on their own thread when the tab is clicked on for speed/resource use. I don't see how a model comes into this. Can you clarify this? Thanks.

You may modally present a view controller (without animation) on launch, when user is not logged in. You may then dismiss the modal view controller after login finished successfully.
Model here usually not only refers to the data (images array), but the logic and behavior of the app. For instance, download images from server should be implemented in model. You may want to check MVC Pattern.

Related

View-Based Application? - Please explain

XCode: "This template provides a starting point for an application that uses a single view. It provides a view controller to manage the view, and a nib file that contains the view."
What does that even mean? (ie what does Single view actually mean)
1) This means that your application will only have a single view screen that is active
2) This means that your application will be able to have as many screens as you like using a single view controller.
Ok now what if your application has multiple screens? not a single view screen, is still suitable under a view based application template?
Example
Screen1(main): on this screen you have 3 buttons, "Open Form1", "Open Form2", "Open Form3"
When the button is clicked it opens up the associated screen,
Press the "Open Form1" button opens up "Form1" screen2
Press the "Open Form2" button opens up "Form2" screen3
Press the "Open Form3" button opens up "Form3" screen4
When the user completes the form and submits it, a thank you screen is displayed
therefore in this example there would be a total of 5 screens.
Each form screen contains is different, textfield inputs, and information, is this considered as a view based application?
View-based app is just a template to say that your app will be view-based. That means that you can have any number of views you want, as this template comes with a view controller (that, as the name says, can be used to control the views... show/hide them with animation, for example).
The template starts with ONE VIEW that is added to the app view controller. You can add any number of views to that controller.
So, yes to your questions. You can use this to create the app you mention, where any of the "screens" you mention would be a view, for example and you can show each one using, for instance, the app view controller to animate each view showing or hiding.
That means the template will create one view and corresponding view controller along with app delegate, main window. That will also do the necessary things to add this view to main windows, and load when app runs. This is just a template. Then you can crate any number of views and view controllers as you want.
This means that the template you are starting the project with provides a single ViewController, and associated XIB for the View. As the first answer says you could use this template to build the application mentioned.
HOWEVER you may wish to think about how the user is going to interact with your app. Will you allow stepping back and forwards through the screens, in which case you may want to consider the Navigation Based app where you push/pop screens onto a stack to allow easy movement between then.
You might also have a concept of allowing the user to jump at will between each of the screen pages in which case you might want to implement a TabBar application.
Or you could just implement it all yourself. At the end of the day it will be your application design, and the template is only a starting point to get you going. I would suggest that if you are starting out with iOS development however to go with 1 ViewController matched a XIB for each screen you wish to implement to keep things simple.

UITabBarController Initial View?

I'm wondering if it is possible to start my app with all my tabs in the "up" state and show a "landing" view to the user. Kind of like a welcome/quick start. When they select one of the tabs, it switches views as normal.
Will you point me in the right direction?
Kind of like this:
If you're using a UITabBar/UITabBarController, I think you must have the selectedIndex set to some legal value. I don't think this is possible, nor can I find an app on my iPhone or iPod that mimics the behaviour you're looking for.
(The App Store app is as close as it gets, where it looks like it has an empty tab bar before it loads data from the Internet, but it could very well be that they are just re-using the Default.png and superimposing an activity indicator during loading.)
Note that if you tried to submit your app to Apple, they could easily reject it for using non-standard UI.
The way I would probably do this is to create a new ViewController that's just for this screen, but make sure it's last in the viewControllers array managed by the UITabBarController. That way, when you show the tab bar on the screen, you get the 4 tabs and the more button, but the currently selected view controller is not in the bar, meaning that all of the other tabs are unselected.
Once the user has satisfied the condition for showing the screen, you can discretely remove the view controller from the tab bar, and the user will never be the wiser.

iphone RootViewController Login or Menu

This is kind of on the back of a previous question. Im currently throwing together a simple social networking iphone. For my question you can think of the application to be quite similar to the facebook iphone app.
It is based off the navigation template and the menu view is the top level view controller for my navigation controller. The user needs to log in to use the application.
Im just wondering whether the navigation controller should be the starting view and if the user has not logged in (when the user logs in I will store the login information so that they do not have to login next time the open the app) than it will throw the login page up modally. Or if the login page should be the startup view and on login the login control will create and go to the navigation control.
Thanks in advance
If the user needs to log in before using the application, then showing the login screen modally is probably the best bet for the first view that gets displayed.
Apple does this with their iTunes Connect app that is available when you go to view your sales data. They show a black screen while the app is loading, modally display the login screen, then dismiss the view to show the guts of the app.
Plus in your case it would be nice to have the navigation controller ready in the background by the time the user login screen gets dismissed (i.e. you could delay it with an activity indicator while readying the view). It would give the impression of a more responsive app

How can I have a view and a subview under one tab on the iphone?

Here is my situation. I have an app with four tabs. The first tab contains a registration screen. Once the user is registered I want the SAME tab to load a separate "Latest News" screen instead of the registration screen. Any help would be appreciated.
This sounds like a design issue. It's usually a better idea to display a registration/login view as a modal view. So when the registration is complete, you can dismiss the modal view, and underneath your "latest news" view would already be there. Most likely, you don't want your users to be able to switch to another tab in the middle of the registration process, displaying it modally would take care of that issue as well.
Don't forget that UITabBarController is a UIViewController as well. So you can simply do:
[tabBarController presentModalViewController:registrationController];
And when you are done, dismiss it, and make sure your latest news tab is selected.
Use navigation controller (UINavigationController).
There are plenty of tutorials about iPhone apps navigation on the Web...

How do I get a login screen on an iPhone app (using tabBarController)?

I am developing a web app (using rails) that I will be launching within a week. I've "jumped the gun" and started working on the iPhone app for the site (I'm new to iPhone development). Using the peepcode iPhone screencasts and the expense/budget demo app from clarkware I've been able to get things going (using ObjectiveResource for iPhone-to-Rails communication). So I'm able to get a tabBarController loading a table with test data populated from my staging server online. Great.
My problem lies in that I need login functionality. The budgets demo app has this nailed but it uses a navigationController. I would like to use a tabBarController (which I'm using currently) to handle the basic functionality of the app.
Here's how I see the app login functionality working when completed:
When a user first runs the iPhone app, the iPhone app will present a login screen (username and password). If a correct username and password is entered the session/user info is saved (preferably to the general/settings app section of the iPhone). The user won't be presented with the login screen again unless the session expires, the user edits the username/password in the general/settings section of the iPhone, or the user deletes the application and reinstalls.
The closest thing to what I have in mind for this process is the Gowalla app.
So I suppose my question is: What is the best way to get a login screen to appear when using a tabBarController? Once I can do this and get authentication taken care of the rest should fall into place.
Please let me know if there's anything I need to clarify - THANK YOU!
-Tony
Do you want to have the tab bar to display at the bottom? Then just put the Login View Controller as the selected tab by setting the selectedViewController or selectedIndex properties of UITabBarController.
Do you want to have the tab bar display at the bottom but not be actionable until they've logged in? Then set a UITabBarDelegate and override the tabBarController:shouldSelectViewController: method to disallow until login has happened.
Do you not want the tab bar to display until login has been entered (personally I would think this is most desireable)? Then either don't show the TabBarController until you're ready, show the Login View Controller instead... or, alternatively, show the Login Controller as a Modal View Controller over the TabBarController and don't allow it to be dismissed until login was successful.
I am new to iPhone programming, but have done C++ coding moons ago. So far I have created everything programmatically rather than use the nib approach.
For what you what to achieve, I would create a main view controller from the app delegate. Then from this main view controller I would create the login view (UIView) that initially displays and seeks the users login credentials. Once validated, your main view contoller can the create and display (or just display if you created it initially) a tab bar controller with the appropriate view controllers for each tab.
So appDelegate -> Main View Controller -> Logon View
-> Tab View Controller + View Controllers
Hope this helps?!
Matthew.