SlideShare a Scribd company logo
1 of 28
Download to read offline
Multiview Applications




Mobile Applications         iabdulrazzaq@outlook.com   1
Types of Multiview Apps
•    Utility Applications
•    Tab bar applications
•    Navigation-based applications
•    Toolbar applications




Mobile Applications           iabdulrazzaq@outlook.com   2
Utility Applications
• A utility application focuses primarily
  on a single view but offers a second
  view that can be used to
  configure the application
  or to provide more detail
  than the primary view
         −The Stocks application that ships
         with iPhone has two views: one to
         display the data and another to
         configure the stock list

Mobile Applications            iabdulrazzaq@outlook.com   3
Tab bar applications
• A tab bar application is a multiview
  application that displays a row of
  buttons, called the tab bar, at the
  bottom of the screen. Tapping one
  of the buttons causes a new view
  controller to become active and a
  new view to be shown. such as The
  Phone application

Mobile Applications         iabdulrazzaq@outlook.com   4
Navigation-based applications
• The navigation-based application
  features a navigation controller that
  uses a navigation bar to control a
  hierarchical series of views.
       – The navigation controller keeps track
         of how deep you go and gives you a
         control to let you make your way back
         to the previous view.


Mobile Applications      iabdulrazzaq@outlook.com   5
Toolbar applications
• Some applications make use of a
  toolbar.
• Tab bar vs. Toolbar
       – A tab bar is used for selecting one
         and only one option from among
         two or more.
       – A toolbar can hold buttons and
         certain other controls, but those
         items are not mutually exclusive.

Mobile Applications         iabdulrazzaq@outlook.com   6
The Architecture of a Multiview Application
  • S




  Mobile Applications   iabdulrazzaq@outlook.com   7
The Root Controller
• The root controller is the primary view
  controller for the application.
• It is the first controller the user sees and the
  controller that is loaded when the application
  loads.




Mobile Applications        iabdulrazzaq@outlook.com   8
Anatomy of a Content View
• Each content view generally consists of up to
  three pieces:
• The view controller.
• The nib.
• Subclass of UIView.




Mobile Applications    iabdulrazzaq@outlook.com   9
UINavigationController
• Create a new project using the Empty
  Application project template




Mobile Applications          iabdulrazzaq@outlook.com   10
Creating View Controller and Nib Files
• Create a new Objective-C Class
  BIDSwitchViewController.
       – File ➤ New ➤ File, select Cocoa Touch from the left
         pane, select Objective-C Class.
• 2 more and name them BIDBlueViewController &
     BIDYellowViewController.
• Create a nib file for each of the content views.
       – File ➤ New ➤ File, select User Interface from the left
         pane, select View.(SwitchView.xib, BlueView.xib
         YellowView.xib)

Mobile Applications        iabdulrazzaq@outlook.com            11
Modifying the App Delegate
• In BIDAppDelegate.h:




• In BIDAppDelegate.m:

Mobile Applications   iabdulrazzaq@outlook.com   12
Modifying the App Delegate




Mobile Applications   iabdulrazzaq@outlook.com   13
Modifying BIDSwitchViewController.h




Mobile Applications   iabdulrazzaq@outlook.com   14
Adding a View Controller
• Change File’s Owner Class field from NSObject
  to BIDSwitchViewController.
       – SwitchView.xib




Mobile Applications       iabdulrazzaq@outlook.com   15
Building a View with a Toolbar
• Drag a toolbar onto the view, rename its
  button title to Switch Views.
• control-drag from it over to the File’s Owner
  icon and select the switchViews: action.
       – make sure you have the button rather than the
         toolbar selected.




Mobile Applications      iabdulrazzaq@outlook.com        16
Writing the Root View Controller
• In BIDSwitchViewController.m:(Top)



• In viewDidLoad:




Mobile Applications   iabdulrazzaq@outlook.com   17
Writing the Root View Controller
• in the switchViews: method:




Mobile Applications   iabdulrazzaq@outlook.com   18
Writing the Root View Controller
• In didReceiveMemoryWarning method:




Mobile Applications   iabdulrazzaq@outlook.com   19
Implementing the Content Views
• in BIDBlueViewController.h:



• In BIDYellowViewController.h:




Mobile Applications   iabdulrazzaq@outlook.com   20
Implementing the Content Views
• Change File’s Owner Class field from NSObject
  to BIDBlueViewController for BlueView.xib &
  to BIDYellowViewController for YellowView.xib.
• Then change the background color of both
  views to blue & yellow.




Mobile Applications   iabdulrazzaq@outlook.com   21
Implementing the Content Views
• Then change the size of the view in the nib




Mobile Applications   iabdulrazzaq@outlook.com   22
Implementing the Content Views
• Then Drag a Round Rect Button to
  BlueView.xib (Press Me) drag from the Touch
  Up Inside event to the File’s Owner icon, and
  connect to the blueButtonPressed action
  method.
• Control-drag from the File’s Owner icon to the
  View icon, and select the view outlet.
       – Do the same with YellowView.xib with changing
         names.

Mobile Applications      iabdulrazzaq@outlook.com        23
Implementing the Content Views
• In BIDBlueViewController.m:




Mobile Applications   iabdulrazzaq@outlook.com   24
Implementing the Content Views
• In BIDYellowViewController.m:




Mobile Applications   iabdulrazzaq@outlook.com   25
Animating the Transition
• In BIDSwitchViewController.m:




Mobile Applications           iabdulrazzaq@outlook.com   26
Animating the Transition




Mobile Applications           iabdulrazzaq@outlook.com   27
Animating the Transition
• Some iOS view transitions:
       –   UIViewAnimationTransitionFlipFromLeft
       –   UIViewAnimationTransitionFlipFromRight
       –   UIViewAnimationTransitionCurlUp
       –   UIViewAnimationTransitionCurlDown




Mobile Applications           iabdulrazzaq@outlook.com   28

More Related Content

Similar to Beginning iOS6 Development CH06 Multiview Applications

Wireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsWireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControls
Teamstudio
 
Creating Mobile Aps without Coding
Creating Mobile Aps without CodingCreating Mobile Aps without Coding
Creating Mobile Aps without Coding
Jack Molisani
 
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Paul Della-Nebbia
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
Vu Tran Lam
 
Session 16 - Designing universal interface which used for iPad and iPhone
Session 16  -  Designing universal interface which used for iPad and iPhoneSession 16  -  Designing universal interface which used for iPad and iPhone
Session 16 - Designing universal interface which used for iPad and iPhone
Vu Tran Lam
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Michael Shrove
 
Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Assignment 4 Paparazzi1
Assignment 4 Paparazzi1
Mahmoud
 

Similar to Beginning iOS6 Development CH06 Multiview Applications (20)

Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Introduction To Ionic3
Introduction To Ionic3Introduction To Ionic3
Introduction To Ionic3
 
Visual basic
Visual basic Visual basic
Visual basic
 
Wireless Wednesdays: Part 3
Wireless Wednesdays: Part 3Wireless Wednesdays: Part 3
Wireless Wednesdays: Part 3
 
In-Flight Infotainment and e-Shopping App | iPad App for shopping
In-Flight Infotainment and e-Shopping App | iPad App for shoppingIn-Flight Infotainment and e-Shopping App | iPad App for shopping
In-Flight Infotainment and e-Shopping App | iPad App for shopping
 
What is ui element in i phone developmetn
What is ui element in i phone developmetnWhat is ui element in i phone developmetn
What is ui element in i phone developmetn
 
Wireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsWireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControls
 
Creating Mobile Aps without Coding
Creating Mobile Aps without CodingCreating Mobile Aps without Coding
Creating Mobile Aps without Coding
 
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
 
Jmp103-Get the Jump on Mobilizing Your Notes and Domino Applications Today!
Jmp103-Get the Jump on Mobilizing Your Notes and Domino Applications Today!Jmp103-Get the Jump on Mobilizing Your Notes and Domino Applications Today!
Jmp103-Get the Jump on Mobilizing Your Notes and Domino Applications Today!
 
04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
 
Shield UI JavaScript Chart
Shield UI JavaScript ChartShield UI JavaScript Chart
Shield UI JavaScript Chart
 
watch_kit_v_1.0
watch_kit_v_1.0watch_kit_v_1.0
watch_kit_v_1.0
 
Session 16 - Designing universal interface which used for iPad and iPhone
Session 16  -  Designing universal interface which used for iPad and iPhoneSession 16  -  Designing universal interface which used for iPad and iPhone
Session 16 - Designing universal interface which used for iPad and iPhone
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
 
Importance of Mobile App Architecture For Mobile App Development
Importance of Mobile App Architecture For Mobile App DevelopmentImportance of Mobile App Architecture For Mobile App Development
Importance of Mobile App Architecture For Mobile App Development
 
iPhone Programming [7/17] : Behind the Scene
iPhone Programming [7/17] : Behind the SceneiPhone Programming [7/17] : Behind the Scene
iPhone Programming [7/17] : Behind the Scene
 
IOS- Designing with ui tool bar in ios
IOS-  Designing with ui tool bar in iosIOS-  Designing with ui tool bar in ios
IOS- Designing with ui tool bar in ios
 
Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Assignment 4 Paparazzi1
Assignment 4 Paparazzi1
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

Beginning iOS6 Development CH06 Multiview Applications

  • 1. Multiview Applications Mobile Applications iabdulrazzaq@outlook.com 1
  • 2. Types of Multiview Apps • Utility Applications • Tab bar applications • Navigation-based applications • Toolbar applications Mobile Applications iabdulrazzaq@outlook.com 2
  • 3. Utility Applications • A utility application focuses primarily on a single view but offers a second view that can be used to configure the application or to provide more detail than the primary view −The Stocks application that ships with iPhone has two views: one to display the data and another to configure the stock list Mobile Applications iabdulrazzaq@outlook.com 3
  • 4. Tab bar applications • A tab bar application is a multiview application that displays a row of buttons, called the tab bar, at the bottom of the screen. Tapping one of the buttons causes a new view controller to become active and a new view to be shown. such as The Phone application Mobile Applications iabdulrazzaq@outlook.com 4
  • 5. Navigation-based applications • The navigation-based application features a navigation controller that uses a navigation bar to control a hierarchical series of views. – The navigation controller keeps track of how deep you go and gives you a control to let you make your way back to the previous view. Mobile Applications iabdulrazzaq@outlook.com 5
  • 6. Toolbar applications • Some applications make use of a toolbar. • Tab bar vs. Toolbar – A tab bar is used for selecting one and only one option from among two or more. – A toolbar can hold buttons and certain other controls, but those items are not mutually exclusive. Mobile Applications iabdulrazzaq@outlook.com 6
  • 7. The Architecture of a Multiview Application • S Mobile Applications iabdulrazzaq@outlook.com 7
  • 8. The Root Controller • The root controller is the primary view controller for the application. • It is the first controller the user sees and the controller that is loaded when the application loads. Mobile Applications iabdulrazzaq@outlook.com 8
  • 9. Anatomy of a Content View • Each content view generally consists of up to three pieces: • The view controller. • The nib. • Subclass of UIView. Mobile Applications iabdulrazzaq@outlook.com 9
  • 10. UINavigationController • Create a new project using the Empty Application project template Mobile Applications iabdulrazzaq@outlook.com 10
  • 11. Creating View Controller and Nib Files • Create a new Objective-C Class BIDSwitchViewController. – File ➤ New ➤ File, select Cocoa Touch from the left pane, select Objective-C Class. • 2 more and name them BIDBlueViewController & BIDYellowViewController. • Create a nib file for each of the content views. – File ➤ New ➤ File, select User Interface from the left pane, select View.(SwitchView.xib, BlueView.xib YellowView.xib) Mobile Applications iabdulrazzaq@outlook.com 11
  • 12. Modifying the App Delegate • In BIDAppDelegate.h: • In BIDAppDelegate.m: Mobile Applications iabdulrazzaq@outlook.com 12
  • 13. Modifying the App Delegate Mobile Applications iabdulrazzaq@outlook.com 13
  • 15. Adding a View Controller • Change File’s Owner Class field from NSObject to BIDSwitchViewController. – SwitchView.xib Mobile Applications iabdulrazzaq@outlook.com 15
  • 16. Building a View with a Toolbar • Drag a toolbar onto the view, rename its button title to Switch Views. • control-drag from it over to the File’s Owner icon and select the switchViews: action. – make sure you have the button rather than the toolbar selected. Mobile Applications iabdulrazzaq@outlook.com 16
  • 17. Writing the Root View Controller • In BIDSwitchViewController.m:(Top) • In viewDidLoad: Mobile Applications iabdulrazzaq@outlook.com 17
  • 18. Writing the Root View Controller • in the switchViews: method: Mobile Applications iabdulrazzaq@outlook.com 18
  • 19. Writing the Root View Controller • In didReceiveMemoryWarning method: Mobile Applications iabdulrazzaq@outlook.com 19
  • 20. Implementing the Content Views • in BIDBlueViewController.h: • In BIDYellowViewController.h: Mobile Applications iabdulrazzaq@outlook.com 20
  • 21. Implementing the Content Views • Change File’s Owner Class field from NSObject to BIDBlueViewController for BlueView.xib & to BIDYellowViewController for YellowView.xib. • Then change the background color of both views to blue & yellow. Mobile Applications iabdulrazzaq@outlook.com 21
  • 22. Implementing the Content Views • Then change the size of the view in the nib Mobile Applications iabdulrazzaq@outlook.com 22
  • 23. Implementing the Content Views • Then Drag a Round Rect Button to BlueView.xib (Press Me) drag from the Touch Up Inside event to the File’s Owner icon, and connect to the blueButtonPressed action method. • Control-drag from the File’s Owner icon to the View icon, and select the view outlet. – Do the same with YellowView.xib with changing names. Mobile Applications iabdulrazzaq@outlook.com 23
  • 24. Implementing the Content Views • In BIDBlueViewController.m: Mobile Applications iabdulrazzaq@outlook.com 24
  • 25. Implementing the Content Views • In BIDYellowViewController.m: Mobile Applications iabdulrazzaq@outlook.com 25
  • 26. Animating the Transition • In BIDSwitchViewController.m: Mobile Applications iabdulrazzaq@outlook.com 26
  • 27. Animating the Transition Mobile Applications iabdulrazzaq@outlook.com 27
  • 28. Animating the Transition • Some iOS view transitions: – UIViewAnimationTransitionFlipFromLeft – UIViewAnimationTransitionFlipFromRight – UIViewAnimationTransitionCurlUp – UIViewAnimationTransitionCurlDown Mobile Applications iabdulrazzaq@outlook.com 28