ios app development with storyboard

Post on 09-May-2015

1.432 Views

Category:

Education

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

iOS App Development With Storyboard

Babul MirdhaSenior Software Engineer

LeadSoft Bangladesh Limited

About Babul MirdhaAbout Babul MirdhaFounder at

সcা.net (www.seccha.net)

Senior Software Engineer at

LeadSoft Bangladesh Limitedg

www.fb.com/BabulMirdha

Having more than 5 years ofworking experiences with iOS,Android, Windows Phone, Web &D k ( N ) d l IDesktop (.Net) app development, Ihave worked with variouslanguages, technologies & tools indifferent environment.

ContentsContentsUnderstanding MVC architectureXib vs StoryboardXib vs Storyboard

Understanding MVC architectureUnderstanding MVC architecture

Understanding MVC architectureUnderstanding MVC architectureThe Model-View-Controller (MVC) design pattern assigns objects in an application one of three roles: j pp

model, view, orcontroller controller.

The pattern defines not only the roles objects play in the application, it defines the way objects communicate with each other. Each of the three types of objects is separated from the others by abstract boundaries and communicates with objects of the by abstract boundaries and communicates with objects of the other types across those boundaries.

MVC is central to a good design for a Cocoa application.

Advantages of MVCAdvantages of MVCThe benefits of adopting this pattern are numerous.

Many objects in applications tend to be more reusable and Many objects in applications tend to be more reusable, and their interfaces tend to be better defined. Applications having an MVC design are also more easily extensible than other applications. Many Cocoa technologies and architectures are based on MVC and require that your custom objects play one of the MVC and require that your custom objects play one of the MVC roles.

MVC architecture in iOSMVC architecture in iOS

Xib (Old)Interface Builder

•allows Cocoa and Carbon developers to create interfaces for applications using a graphical user interface. •The resulting interface is stored as a nib file short •The resulting interface is stored as a .nib file, short for NeXT Interface Builder, or more later, as a .xib filea .xib file

XibXibApple remove it from xcode 5. You have only one option to choose storyboard You have only one option to choose storyboard.

if you want to xibs then remove storyboard after creating singleView application and add xib manually. another option is to create application in xcode 4.6 or earliarversion then run it on xcode 5.

What is storyboardWhat is storyboardStoryboard is an exciting new feature in iOS 5 that will save a lot of time building user interfaces for Apps save a lot of time building user interfaces for Apps

Advantages of StoryboardAdvantages of StoryboardWith a storyboard you have a better conceptual overview of all the screens in your app and the overview of all the screens in your app and the connections between them. The storyboard describes the transitions between the various screens.Storyboards make working with table views a lot easier

i h h ll d i ll f with the new prototype cells and static cells features. Can also use .xibs if needed with storyboards.

Disadvantages of StoryboardDisadvantages of StoryboardYou also need a big monitor, especially when write iPadapps! apps! it is only available in iOS 5 onward Merges can be very difficult if not impossible if there are g y pconflicts.

Creating Storyboard Project Creating Storyboard Project Fire up Xcode and create a new Empty App project.

Product Name: RatingsProduct Name: RatingsCompany Identifier: the identifier that you use foryour apps, in reverse domain notation Class Prefix: leave this empty Device Family: iPhoneUse Storyboard: check this Use Storyboard: check this Use Automatic Reference Counting: check this Include Unit Tests: this should be unchecked

Creating Storyboard Project Creating Storyboard Project

Add a storyboard for iPhoneAdd a storyboard for iPhoneClick >File>oNew>FileClick> User Interface> StoryboardClick> User Interface> StoryboardClick>NextSelect>iPhoneSelect>iPhoneClick>NextType >Storyboard iPhoneType Storyboard_iPhone

StoryboardStoryboard

Set Storyboard to be loadedSet Storyboard to be loadedSpecify the name of the storyboard that must be loaded when the app startswhen the app starts

Info.plistInfo.plist

In info.plist file, Storyboard apps use the key UIM S b dF l “M b d f l b ” UIMainStoryboardFile, or “Main storyboard file base name”, to specify the name of the storyboard that must be loaded when the app starts.

Design Scene or SecreenDesign Scene or Secreen

Storyboard SeguesStoryboard Segues

A segue is a transition from one view to another.gE.g. select the + button and ctrl-drag to the new Navigation Controller.

DemoDemo

New TerminilogiesNew TerminilogiesMVCxCodexCodeXibStoryboardStoryboardSegue

top related