开发者

Instagram iPhone application questions

开发者 https://www.devze.com 2023-03-26 22:47 出处:网络
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'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 "Pop开发者_StackOverflowular 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!


  1. 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

  2. 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.


  1. 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.

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消