SlideShare una empresa de Scribd logo
1 de 25
iOS Development (Part III)
(Additional GUI Components)
COMPILED BY: ASIM RAIS SIDDIQUI
Outline
 Image Views
 Scroll Views
 Web Views
 Map Views
 Icons and the App Launch Image
ImageView
 An image view object provides a view-based container for displaying either a
single image or for animating a series of images.
//To display an image from filename:
[imgBackground setImage:[UIImage imageNamed:@"fileName.png"]];
//or
[imgBackground setImage:[UIImage imageWithContentsOfFile:imageFilename]];
//or
UIImage *imageToDisplay = ...
[imageView setImage:imageToDisplay];
//To clear the image:
[imageView setImage:nil];
ScrollView
 Scroll views are found in iOS applications when content that needs
to be displayed and manipulated won’t fit entirely on the screen.
Scroll views have two main purposes:
 To let users drag the area of the content they want to display
 To let users zoom into or out of the displayed content using the
pinch gestures
 The following figure shows a typical use of a UIScrollView class. The subview is a
UIImageView containing the image of a boy. When the user drags his or her finger on
the screen, the viewport onto the image moves and, as you can see in the diagram, the
scrol l indicators are shown. When the user lifts the finger, the indicators disappear.
ScrollView
 The UIScrollView class provides the following functionality:
 Scrolling content that will not fit entirely on the screen
 Zooming content, allowing your application to support the standard
pinch gestures to zoom in and out
 Restricting scrolling to a single screen of content at a time (paging
mode)
 The UIScrollView class contains no specially defined view for the
content that it displays; instead it simply scrolls its subviews. This
simple model is possible because scroll views on iOS have no
additional controls for initiating scrolling.
MapView/MapKit
 The MapKit Framework is based on the Google Earth
and Google Maps data and APIs and provides iPhone
developers with a simple mechanism for integrating
detailed and interactive mapping capabilities into any
application.
 The current location of the device may also be
displayed and tracked on the map view.
 The MapKit framework also includes support for adding
annotations to a map. This takes the form of a pin or
custom image, title and subview that may be used to
mark specific locations on a map.
 implement the MKMapViewDelegate protocol within our view
controller class
 the code will require that the <MapKit/MapKit.h>
 Add mapkit framework
 mapView.showsUserLocation = YES; //to show user on the scren
Changing the MapView Region
- (void)zoomIn: (id)sender
{
MKUserLocation *userLocation = mapView.userLocation;
MKCoordinateRegion region =
MKCoordinateRegionMakeWithDistance (
userLocation.location.coordinate, 50, 50);
[mapView setRegion:region animated:NO];
}
Changing the Map Type
- (void) changeMapType: (id)sender
{
if (mapView.mapType == MKMapTypeStandard)
mapView.mapType = MKMapTypeSatellite;
else
mapView.mapType = MKMapTypeStandard;
}
This very simple method simply toggles between the two map types
when the button is tapped by the user.
Web Views
 The UITextView and UIWebView classes both fall into this category
and are designed to provide a mechanism for displaying formatted
text to the user. The UIWebView class, for example, is designed to
display HTML content formatted so that it appears as it would if
loaded into a web browser.
Web Views
 NSURL class is used to create an object
which will hold the URL information.
 NSURLRequest is used to create a request
to the URL.
 Method loadRequest of UIWebView is
used to load the request in the
UIWebView.
UIPickerView
 The UIPickerView class implements
objects, called picker views, that use a spinning-
wheel or slot-machine metaphor to show one or
more sets of values. Users select values by
rotating the wheels so that the desired row of
values aligns with a selection indicator.
 The UIDatePicker class uses a custom subclass of
UIPickerView to display dates and times. To see
an example, tap the add (“+”) button in the the
Alarm pane of the Clock application.
StoryBoarding
 Storyboarding is a feature built into Xcode that allows both the various screens
that comprise an iOS application and the navigation path through those
screens to be visually assembled. Using the Interface Builder component of
Xcode, the developer simply drags and drops view and navigation controllers
onto a canvas and designs the user interface of each view in the normal
manner. The developer then drags lines to link individual trigger controls (such as
a button) to the corresponding view controllers that are to be displayed when
the control is selected by the user.
 Having designed both the screens (referred to in the context of storyboarding as
scenes) and specified the transitions between scenes (referred to as segues)
Xcode generates all the code necessary to implement the defined behavior in
the completed application. The style of transition for each segue (page
fold, cross dissolve etc) may also be defined within Interface Builder.
Further, segues may also be triggered programmatically in situations where
behavior cannot be defined graphically using Interface Builder.
 The finished design is saved by Xcode to a storyboard file. Typically, an
application will have a single storyboard file, though there is no restriction
preventing the use of multiple storyboard files within a single application.
Adding Scenes to the Storyboard
 To add a second scene to the storyboard, simply drag a view
controller object from the Object Library panel onto the canvas.
Configuring Storyboard Segues
 a segue is the transition from one scene to another within a storyboard
Configuring Storyboard Transitions
 Xcode provides the option to change the visual appearance of the
transition that takes place during a segue. By default a Cover
Vertical transition is performed whereby the new scene slides
vertically upwards from the bottom of the view to cover the
currently displayed scene. To change the transition, select the
corresponding segue line, display the attributes inspector (View ->
Utilities -> Show Attributes Inspector) and modify the Transition
setting.
Associating a View Controller with
a Scene
 At this point in the example we have two scenes but only one view
controller (the one created by Xcode when we selected Single View
Application). Clearly in order to be able to add any functionality
behind scene 2 it too will need a view controller. The first
step, therefore, is to add the files for a view controller to the project.
Ctrl-click on the Storyboard target at the top of the project navigator
panel and select New File… from the resulting menu. In the new file
panel select Objective-C class and click Next to proceed. On the
options screen verify that the Subclass of menu is set to UIViewController
and that the Targeted for iPad and With XIB for user interface options
are both deselected (since the view already exists in the storyboard
there is no need for an NIB user interface file) and name the class
Scene2ViewContoller
With the view controller for scene 2 selected within the storyboard canvas, display
the Identity Inspector (View -> Utilities -> Identity Inspector) and change the Class
from UIViewController to Scene2ViewController:
Passing Data Between Scenes
 One of the most common requirements when working with
storyboards involves the transfer of data from one scene to another
during a segue transition. This is achieved using the
prepareForSegue: method.
 Before a segue is performed by the storyboard runtime
environment, a call is made to the prepareForSegue: method of the
current view controller. If any tasks need to be performed prior to
the segue taking place simply implement this method in the current
view controller and add code to perform any necessary tasks.
Passed as an argument to this method is a segue object from which
a reference to the destination view controller may be obtained and
subsequently used to transfer data.
 To see this in action, begin by selecting Scene2ViewController.h and
adding a new data property:
Unwinding Storyboard Segues
 The next step is to configure the button on scene 2 to return to scene 1.
It might seem as though the obvious choice is to simply implement a
segue from the button on scene 2 to scene 1.
 Instead of returning the original instance of scene 1, however, this
would create an entirely new instance of the StoryboardViewController
class. If a user were to perform this transition repeatedly, therefore, the
application would continue to use more memory and would eventually
be terminated by the operating system.
 The application should, instead, make use of the Storyboard unwind
feature introduced into Xcode 4.5. This involves implementing a method
in the view controller of the scene to which the user is to be returned
and then connecting a segue to that method from the source view
controller. This enables an unwind action to be performed across
multiple levels of scene.
 The next step is to establish the
unwind segue. To achieve
this, locate scene 2 within the
storyboard canvas and ctrl-
click and drag from the
button to the “exit” icon in the
panel located beneath the
view. Release the line and
select the returned: method
from the resulting menu:

Más contenido relacionado

La actualidad más candente

What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)Google
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Kavya Barnadhya Hazarika
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycleAhsanul Karim
 
Firebase. Предмет и область применения — Тимур Ахметгареев
Firebase. Предмет и область применения — Тимур АхметгареевFirebase. Предмет и область применения — Тимур Ахметгареев
Firebase. Предмет и область применения — Тимур АхметгареевPeri Innovations
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Android programming
Android programmingAndroid programming
Android programmingvijay_uttam
 
Android application-component
Android application-componentAndroid application-component
Android application-componentLy Haza
 
What's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseWhat's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseParis Android User Group
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
Trimantra - Project Portfolio_NET
Trimantra - Project Portfolio_NETTrimantra - Project Portfolio_NET
Trimantra - Project Portfolio_NETMihir G.
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariSurekha Gadkari
 

La actualidad más candente (14)

What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
 
Firebase. Предмет и область применения — Тимур Ахметгареев
Firebase. Предмет и область применения — Тимур АхметгареевFirebase. Предмет и область применения — Тимур Ахметгареев
Firebase. Предмет и область применения — Тимур Ахметгареев
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Android programming
Android programmingAndroid programming
Android programming
 
jsf2 Notes
jsf2 Notesjsf2 Notes
jsf2 Notes
 
Android application-component
Android application-componentAndroid application-component
Android application-component
 
What's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet HaaseWhat's new in android 4.4 - Romain Guy & Chet Haase
What's new in android 4.4 - Romain Guy & Chet Haase
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Trimantra - Project Portfolio_NET
Trimantra - Project Portfolio_NETTrimantra - Project Portfolio_NET
Trimantra - Project Portfolio_NET
 
Angular
AngularAngular
Angular
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
 

Destacado

2009 11 11 Pm Kwtc Report52
2009 11 11 Pm Kwtc Report522009 11 11 Pm Kwtc Report52
2009 11 11 Pm Kwtc Report52Invest Ment
 
Mental Models Game Prototype Presentation May 2013 update
Mental Models Game Prototype Presentation May 2013 updateMental Models Game Prototype Presentation May 2013 update
Mental Models Game Prototype Presentation May 2013 updateVille Keranen
 
Mental Models, Empathy, and Design
Mental Models, Empathy, and DesignMental Models, Empathy, and Design
Mental Models, Empathy, and DesignIndi Young
 
Information professional and digital economy
Information professional and digital economyInformation professional and digital economy
Information professional and digital economyMaykin Likitboonyalit
 
Storyboard การออกแบบ application
Storyboard การออกแบบ applicationStoryboard การออกแบบ application
Storyboard การออกแบบ applicationWeerachat Martluplao
 
วารสารรถไฟสัมพันธ์
วารสารรถไฟสัมพันธ์วารสารรถไฟสัมพันธ์
วารสารรถไฟสัมพันธ์Boonlert Aroonpiboon
 
Story board y cómic
Story board y cómicStory board y cómic
Story board y cómicEva Avila
 
Digital Storytelling Tips, Apps, & Resources
Digital Storytelling Tips, Apps, & ResourcesDigital Storytelling Tips, Apps, & Resources
Digital Storytelling Tips, Apps, & ResourcesShelly Sanchez Terrell
 
Mental models - Final Presentation
Mental models - Final PresentationMental models - Final Presentation
Mental models - Final PresentationKishan Salian
 

Destacado (11)

2009 11 11 Pm Kwtc Report52
2009 11 11 Pm Kwtc Report522009 11 11 Pm Kwtc Report52
2009 11 11 Pm Kwtc Report52
 
Storyboard55[1]
Storyboard55[1]Storyboard55[1]
Storyboard55[1]
 
Storyboard Diagram
Storyboard DiagramStoryboard Diagram
Storyboard Diagram
 
Mental Models Game Prototype Presentation May 2013 update
Mental Models Game Prototype Presentation May 2013 updateMental Models Game Prototype Presentation May 2013 update
Mental Models Game Prototype Presentation May 2013 update
 
Mental Models, Empathy, and Design
Mental Models, Empathy, and DesignMental Models, Empathy, and Design
Mental Models, Empathy, and Design
 
Information professional and digital economy
Information professional and digital economyInformation professional and digital economy
Information professional and digital economy
 
Storyboard การออกแบบ application
Storyboard การออกแบบ applicationStoryboard การออกแบบ application
Storyboard การออกแบบ application
 
วารสารรถไฟสัมพันธ์
วารสารรถไฟสัมพันธ์วารสารรถไฟสัมพันธ์
วารสารรถไฟสัมพันธ์
 
Story board y cómic
Story board y cómicStory board y cómic
Story board y cómic
 
Digital Storytelling Tips, Apps, & Resources
Digital Storytelling Tips, Apps, & ResourcesDigital Storytelling Tips, Apps, & Resources
Digital Storytelling Tips, Apps, & Resources
 
Mental models - Final Presentation
Mental models - Final PresentationMental models - Final Presentation
Mental models - Final Presentation
 

Similar a iOS Development (Part III): Additional GUI Components

Android Navigation Component
Android Navigation ComponentAndroid Navigation Component
Android Navigation ComponentŁukasz Ciupa
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxGevitaChinnaiah
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseKranthi Kumar
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsDiego Grancini
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLAkhil Mittal
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 seriesopenbala
 
Ios development 2
Ios development 2Ios development 2
Ios development 2elnaqah
 
Create Location Sharing apps using the Ionic framework
Create Location Sharing apps using the Ionic framework					Create Location Sharing apps using the Ionic framework
Create Location Sharing apps using the Ionic framework Shelly Megan
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...Akira Hatsune
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1Hussain Behestee
 
Session 15 - Working with Image, Scroll, Collection, Picker, and Web View
Session 15  - Working with Image, Scroll, Collection, Picker, and Web ViewSession 15  - Working with Image, Scroll, Collection, Picker, and Web View
Session 15 - Working with Image, Scroll, Collection, Picker, and Web ViewVu Tran Lam
 
Dynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFDynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFIJERD Editor
 
Jetpack Compose beginner.pdf
Jetpack Compose beginner.pdfJetpack Compose beginner.pdf
Jetpack Compose beginner.pdfAayushmaAgrawal
 

Similar a iOS Development (Part III): Additional GUI Components (20)

04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
 
Android Navigation Component
Android Navigation ComponentAndroid Navigation Component
Android Navigation Component
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptx
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Swift
SwiftSwift
Swift
 
Data binding
Data bindingData binding
Data binding
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exercise
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
Compose Camp by GDSC NSUT
Compose Camp by GDSC NSUTCompose Camp by GDSC NSUT
Compose Camp by GDSC NSUT
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 
IOS Storyboards
IOS StoryboardsIOS Storyboards
IOS Storyboards
 
Ios development 2
Ios development 2Ios development 2
Ios development 2
 
Create Location Sharing apps using the Ionic framework
Create Location Sharing apps using the Ionic framework					Create Location Sharing apps using the Ionic framework
Create Location Sharing apps using the Ionic framework
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
Session 15 - Working with Image, Scroll, Collection, Picker, and Web View
Session 15  - Working with Image, Scroll, Collection, Picker, and Web ViewSession 15  - Working with Image, Scroll, Collection, Picker, and Web View
Session 15 - Working with Image, Scroll, Collection, Picker, and Web View
 
Dynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFDynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPF
 
Jetpack Compose beginner.pdf
Jetpack Compose beginner.pdfJetpack Compose beginner.pdf
Jetpack Compose beginner.pdf
 

Más de Asim Rais Siddiqui

Understanding Blockchain Technology
Understanding Blockchain TechnologyUnderstanding Blockchain Technology
Understanding Blockchain TechnologyAsim Rais Siddiqui
 
IoT Development - Opportunities and Challenges
IoT Development - Opportunities and ChallengesIoT Development - Opportunities and Challenges
IoT Development - Opportunities and ChallengesAsim Rais Siddiqui
 
Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#Asim Rais Siddiqui
 
Introduction to iOS Development
Introduction to iOS DevelopmentIntroduction to iOS Development
Introduction to iOS DevelopmentAsim Rais Siddiqui
 

Más de Asim Rais Siddiqui (8)

Understanding Blockchain Technology
Understanding Blockchain TechnologyUnderstanding Blockchain Technology
Understanding Blockchain Technology
 
IoT Development - Opportunities and Challenges
IoT Development - Opportunities and ChallengesIoT Development - Opportunities and Challenges
IoT Development - Opportunities and Challenges
 
iOS Memory Management
iOS Memory ManagementiOS Memory Management
iOS Memory Management
 
iOS Development (Part 2)
iOS Development (Part 2)iOS Development (Part 2)
iOS Development (Part 2)
 
iOS Development (Part 1)
iOS Development (Part 1)iOS Development (Part 1)
iOS Development (Part 1)
 
Introduction to Objective - C
Introduction to Objective - CIntroduction to Objective - C
Introduction to Objective - C
 
Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#Coding Standards & Best Practices for iOS/C#
Coding Standards & Best Practices for iOS/C#
 
Introduction to iOS Development
Introduction to iOS DevelopmentIntroduction to iOS Development
Introduction to iOS Development
 

Último

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

iOS Development (Part III): Additional GUI Components

  • 1. iOS Development (Part III) (Additional GUI Components) COMPILED BY: ASIM RAIS SIDDIQUI
  • 2. Outline  Image Views  Scroll Views  Web Views  Map Views  Icons and the App Launch Image
  • 3. ImageView  An image view object provides a view-based container for displaying either a single image or for animating a series of images. //To display an image from filename: [imgBackground setImage:[UIImage imageNamed:@"fileName.png"]]; //or [imgBackground setImage:[UIImage imageWithContentsOfFile:imageFilename]]; //or UIImage *imageToDisplay = ... [imageView setImage:imageToDisplay]; //To clear the image: [imageView setImage:nil];
  • 4. ScrollView  Scroll views are found in iOS applications when content that needs to be displayed and manipulated won’t fit entirely on the screen. Scroll views have two main purposes:  To let users drag the area of the content they want to display  To let users zoom into or out of the displayed content using the pinch gestures
  • 5.  The following figure shows a typical use of a UIScrollView class. The subview is a UIImageView containing the image of a boy. When the user drags his or her finger on the screen, the viewport onto the image moves and, as you can see in the diagram, the scrol l indicators are shown. When the user lifts the finger, the indicators disappear.
  • 6. ScrollView  The UIScrollView class provides the following functionality:  Scrolling content that will not fit entirely on the screen  Zooming content, allowing your application to support the standard pinch gestures to zoom in and out  Restricting scrolling to a single screen of content at a time (paging mode)  The UIScrollView class contains no specially defined view for the content that it displays; instead it simply scrolls its subviews. This simple model is possible because scroll views on iOS have no additional controls for initiating scrolling.
  • 7.
  • 8. MapView/MapKit  The MapKit Framework is based on the Google Earth and Google Maps data and APIs and provides iPhone developers with a simple mechanism for integrating detailed and interactive mapping capabilities into any application.  The current location of the device may also be displayed and tracked on the map view.  The MapKit framework also includes support for adding annotations to a map. This takes the form of a pin or custom image, title and subview that may be used to mark specific locations on a map.
  • 9.  implement the MKMapViewDelegate protocol within our view controller class  the code will require that the <MapKit/MapKit.h>  Add mapkit framework  mapView.showsUserLocation = YES; //to show user on the scren
  • 10. Changing the MapView Region - (void)zoomIn: (id)sender { MKUserLocation *userLocation = mapView.userLocation; MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance ( userLocation.location.coordinate, 50, 50); [mapView setRegion:region animated:NO]; }
  • 11. Changing the Map Type - (void) changeMapType: (id)sender { if (mapView.mapType == MKMapTypeStandard) mapView.mapType = MKMapTypeSatellite; else mapView.mapType = MKMapTypeStandard; } This very simple method simply toggles between the two map types when the button is tapped by the user.
  • 12. Web Views  The UITextView and UIWebView classes both fall into this category and are designed to provide a mechanism for displaying formatted text to the user. The UIWebView class, for example, is designed to display HTML content formatted so that it appears as it would if loaded into a web browser.
  • 13. Web Views  NSURL class is used to create an object which will hold the URL information.  NSURLRequest is used to create a request to the URL.  Method loadRequest of UIWebView is used to load the request in the UIWebView.
  • 14. UIPickerView  The UIPickerView class implements objects, called picker views, that use a spinning- wheel or slot-machine metaphor to show one or more sets of values. Users select values by rotating the wheels so that the desired row of values aligns with a selection indicator.  The UIDatePicker class uses a custom subclass of UIPickerView to display dates and times. To see an example, tap the add (“+”) button in the the Alarm pane of the Clock application.
  • 15. StoryBoarding  Storyboarding is a feature built into Xcode that allows both the various screens that comprise an iOS application and the navigation path through those screens to be visually assembled. Using the Interface Builder component of Xcode, the developer simply drags and drops view and navigation controllers onto a canvas and designs the user interface of each view in the normal manner. The developer then drags lines to link individual trigger controls (such as a button) to the corresponding view controllers that are to be displayed when the control is selected by the user.  Having designed both the screens (referred to in the context of storyboarding as scenes) and specified the transitions between scenes (referred to as segues) Xcode generates all the code necessary to implement the defined behavior in the completed application. The style of transition for each segue (page fold, cross dissolve etc) may also be defined within Interface Builder. Further, segues may also be triggered programmatically in situations where behavior cannot be defined graphically using Interface Builder.  The finished design is saved by Xcode to a storyboard file. Typically, an application will have a single storyboard file, though there is no restriction preventing the use of multiple storyboard files within a single application.
  • 16.
  • 17. Adding Scenes to the Storyboard  To add a second scene to the storyboard, simply drag a view controller object from the Object Library panel onto the canvas.
  • 18. Configuring Storyboard Segues  a segue is the transition from one scene to another within a storyboard
  • 19. Configuring Storyboard Transitions  Xcode provides the option to change the visual appearance of the transition that takes place during a segue. By default a Cover Vertical transition is performed whereby the new scene slides vertically upwards from the bottom of the view to cover the currently displayed scene. To change the transition, select the corresponding segue line, display the attributes inspector (View -> Utilities -> Show Attributes Inspector) and modify the Transition setting.
  • 20. Associating a View Controller with a Scene  At this point in the example we have two scenes but only one view controller (the one created by Xcode when we selected Single View Application). Clearly in order to be able to add any functionality behind scene 2 it too will need a view controller. The first step, therefore, is to add the files for a view controller to the project. Ctrl-click on the Storyboard target at the top of the project navigator panel and select New File… from the resulting menu. In the new file panel select Objective-C class and click Next to proceed. On the options screen verify that the Subclass of menu is set to UIViewController and that the Targeted for iPad and With XIB for user interface options are both deselected (since the view already exists in the storyboard there is no need for an NIB user interface file) and name the class Scene2ViewContoller
  • 21. With the view controller for scene 2 selected within the storyboard canvas, display the Identity Inspector (View -> Utilities -> Identity Inspector) and change the Class from UIViewController to Scene2ViewController:
  • 22. Passing Data Between Scenes  One of the most common requirements when working with storyboards involves the transfer of data from one scene to another during a segue transition. This is achieved using the prepareForSegue: method.  Before a segue is performed by the storyboard runtime environment, a call is made to the prepareForSegue: method of the current view controller. If any tasks need to be performed prior to the segue taking place simply implement this method in the current view controller and add code to perform any necessary tasks. Passed as an argument to this method is a segue object from which a reference to the destination view controller may be obtained and subsequently used to transfer data.  To see this in action, begin by selecting Scene2ViewController.h and adding a new data property:
  • 23.
  • 24. Unwinding Storyboard Segues  The next step is to configure the button on scene 2 to return to scene 1. It might seem as though the obvious choice is to simply implement a segue from the button on scene 2 to scene 1.  Instead of returning the original instance of scene 1, however, this would create an entirely new instance of the StoryboardViewController class. If a user were to perform this transition repeatedly, therefore, the application would continue to use more memory and would eventually be terminated by the operating system.  The application should, instead, make use of the Storyboard unwind feature introduced into Xcode 4.5. This involves implementing a method in the view controller of the scene to which the user is to be returned and then connecting a segue to that method from the source view controller. This enables an unwind action to be performed across multiple levels of scene.
  • 25.  The next step is to establish the unwind segue. To achieve this, locate scene 2 within the storyboard canvas and ctrl- click and drag from the button to the “exit” icon in the panel located beneath the view. Release the line and select the returned: method from the resulting menu:

Notas del editor

  1. Understanding Map RegionsThe area of the map that is currently displayed to the user is referred to as the region. This is defined in terms of a center location (declared by longitude and latitude) and span of the surrounding area to be displayed. Adjusting the span has the effect of zooming in and out of the map relative to the specified center location. The region’s span may be specified using either distance (in meters) or coordinate based degrees. When using degrees, one degree of latitude is equivalent to 111 km. Latitude, however, varies depending on the longitudinal distance from the equator. Given this complexity, the map view tutorial in this chapter will declare the span in terms of distance.
  2. This method performs some very simple operations in order to achieve the desired effect in the mapView object. Firstly, the user’s current location is ascertained by accessing the userLocation property of the map view object. This is stored in the form of an MKUserLocation object which, in turn, contains the coordinates of the user. Next, the MKCoordinateRegionMakeWithDistance function is called in order to generate an MKCoordinateRegion object consisting of the user’s location coordinates and a span that stretches 50 meters both to the North and South of the current location. Finally, this region object is passed through to the setRegion method of the mapView object.
  3. The arrow pointing inwards to the left side of the view indicates that this is the initial view and will be the first view displayed when the application launches. Objects may be added to the view in the usual manner by dragging and dropping items from the Object library (View -&gt; Utilities -&gt; Show Object Library) onto the view canvas.
  4. To establish a segue, hold down the Ctrl key on the keyboard, click over a control (in this case the button on scene 1) and drag the resulting line to the scene 2 view. Upon releasing the mouse button a menu will appear. Select the modal menu option to establish the segue.
  5. All this method does is obtain a reference to the destination view controller and then assigns a string to the labelText property of the object so that it appears on the label.