How to Use a Navigation Controller in the Master View for Your iOS App
How to Create an Outlet for the Map Controller in Your iOS App
How to Create an iOS App

Using Design Patterns in iOS App Development

When it comes to iOS app development, the framework is designed around certain programming paradigms, also known as design patterns. The design pattern is a model that your own code must be consistent with. The UIKit framework does a lot of the heavy lifting for you. That’s all well and good, but working with that framework is a little more complicated than just letting it do its work.

To understand how to take best advantage of the power of frameworks — or (better put), figuring out how the framework objects want to best use your code — you need to understand design patterns.

If you don’t understand them or if you try to work around them because you’re sure that you have a “better” way of doing things, your job will actually end up being much more difficult. (Developing software can be hard enough, so making your job more difficult is definitely something you want to avoid.)

Getting a handle on the basic design patterns that the framework uses (and expects) will help you develop an app that makes the best use of the framework. This means doing the least amount of work in the shortest amount of time.

The design patterns can help you to understand not only how to structure your code but also how the framework itself is structured. They describe relationships and interactions between classes or objects, as well as how responsibilities should be distributed among classes so that the iPad does what you want it to do.

In programming terms, a design pattern is a commonly used template that gives you a consistent way to get a particular task done.

To develop an iOS app, you need to be comfortable with the following basic design patterns:

  • Model-View-Controller (MVC)

  • Delegation

  • Block Objects

  • Target-Action

  • Managed Memory Model

Of these, the Model-View-Controller design pattern is the key to understanding how an iPad or iPhone app works.

Another basic design pattern exists as well: Threads and Concurrency. This pattern enables you to execute tasks concurrently (including the use of Grand Central Dispatch, that aiding-and-abetting feature introduced in OS X Snow Leopard for taking full advantage of all that processing power available, even on the smaller iPad and much smaller iPhone).

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Use the Library Pane for iOS App Development
How to Create an Xcode Project for an iPad App
How to Add the Weather View Controller to Your iOS App
How to Customize Your iOS App Table View for the iPad
How to Use Inspector and Quick Help Pane for iOS App Development
Advertisement

Inside Dummies.com