IPhone Development - Application Templates

There are many resources regarding encoding on iPhone. Most of them concern "how to make X", for example. "configure navigation controller" or "download text from a URL". Everything is good and beautiful.

Now I'm more interested in questions that follow simpler things - how to best structure your complex user interface or your application or the general problems that arise. To illustrate: The iPhone 3 Getting Started book tells you how to set up an application with multiple viewcontrollers using the β€œSwitcher” top view manager, which switches between views belonging to other view controllers. Ok, but they only tell you how to do this and nothing about the problems that may arise: for example, if I use their paradigm to switch to the UINavigationViewController, the navigation bar gets too low on the screen because the UINavigationViewController expects to be the topmost UIViewController (by apparently). In addition, delegation methods (for example, those related to orientation changes) go to the top controller of the switch view, and not to the actual controller responsible for the current view. I have corrections for these things, but they feel like hacks, which makes me unhappy and makes me feel like I missed something.

One of the productive things might be to view some open source iPhone projects (see this question ). But beyond that?

Update

To clarify: I guess what I'm asking about could be summarized as "Recipes and Gotchas for iPhone Design". Such things that are interesting to developers, but not covered in any of the iPhone-books, etc., which I saw, for example:

  • I am writing an application for the iPad and I want the UISplitViewController to be presented to the user only for a while, which Apple seems to say that I can not do this. Is it possible? How?

  • Apple does not give me a way to style my application in a convenient, transverse direction (for example, font or color settings). How can I fit the style of my application?

  • Memory management is not simplified due to some inconsistencies in the UIViewController method names (for example, viewDidUnload is not opposite viewDidLoad, despite the name). Is there an easy way to remove this and make view manager memory management less error prone?

  • How can I constantly and easily test the controllers of my view for the correct behavior when a memory warning arrives? It is easy to simulate a memory warning in the simulator, but if the user interface I want to check shows (and is a "sheet-level view controller"), it will not unload its view because it is currently visible.

NB I do not really ask the questions above. . I think I have decent answers to them! - just giving examples of β€œgood” questions that illustrate this stackoverflow question.

+6
design-patterns iphone
source share
4 answers

As far as I can tell, there is no book or resource that deals with the kind of advanced recipes and recipes I was looking for. Loads of useful resources exist, but things that I think are simply not considered.

0
source share

WWDC talks available on iTunes U ( http://developer.apple.com/videos/wwdc/2010/ ) provide excellent structuring information, especially in the Application Frameworks section.

If you are talking about code, use the Model / View / Controller pattern, as in most web applications:

  • The model code defines the objects that your program represents. For example, a time tracking application may have model objects such as Task, TimeSlice, and User (especially in the network settings).
  • The submission code is provided for "free" using the iOS SDK, if you do not need a special viewing code. These are UIImageView, UIButton, etc.
  • The controller code connects a space between the model and the view. The controller will change views to display the model selected by the user and facilitate the selection of model objects.

This is the basic design template for any iPhone application, and one that will be used the most.

If, on the other hand, you are referring to what we in my company call UX design (user experience), however you cannot win the Apple HIG guide in the Apple iOS SDK documentation set available online or in Xcode from the help menu.

Another thing that I recommend quite highly is to play around with some test / dummy code. Nothing can survive the experience. Experiments with the iOS SDK and dirty hands will allow you to truly explore the best ways to develop applications.

Edit:

In addition, delegation methods (for example, those related to orientation changes) go to the top controller of the switch view, and not to the actual controller responsible for the current view.

Can you clarify? In all the applications I wrote, the current rendered view controller receives orientation change methods. Please note that there are two methods. shouldAutorotateToInterfaceOrientation: allows you to decide whether the view should rotate, and didRotateFromInterfaceOrientation: allows you to redraw the view if necessary.

+4
source share

Please follow this link. In this they clearly explained the design of the templates.

http://www.raywenderlich.com/46988/ios-design-patterns

+1
source share

You might want to consider watching videos, such as CS193p, from Stanford on iTunes U. They go through the most important parts of iOS development in depth and provide some source code.

0
source share

All Articles