Nikmesoft Ltd
Basic UI Elements
Linh NGUYEN
Lecture 2
Nikmesoft Ltd
Contents
Overview1
Employing Basic UI Elements2
Working with Containers3
Example 24
Exercise 25
2
Nikmesoft Ltd
Basic UI Elements
Overview
3
Nikmesoft Ltd
Overview
 What UI elements are?
 UI elements are visual elements that we can see in our
applications. Some of these elements respond to user
interactions such as buttons, text fields and others are
informative such as images, labels.
 How to add UI elements?
 We can add UI elements both in code and with the help of
interface builder. Depending on the need we can use either
one of them.
4
Nikmesoft Ltd
Overview
5
UI
Elements Properties
Delegates
Nikmesoft Ltd
Overview
 Delegates
 Let's assume an object A calls object B to perform an action,
once the action is complete object A should know that B has
completed the task and take necessary action. This is achieved
with the help of delegates.
6
Nikmesoft Ltd
Overview
 Delegates(cont.)
 The key concepts in the above example are:
• A is delegate object of B
• B will have a reference of A
• A will implement the delegate methods of B.
• B will notify A through the delegate methods.
7
Nikmesoft Ltd
Overview
 Delegates(cont.)
8
Nikmesoft Ltd
Overview
 Delegates(cont.)
9
Nikmesoft Ltd
Basic UI Elements
Employing Basic UI Elements
10
Nikmesoft Ltd
Employing Basic UI Elements
 UITextField
 A text field is an UI element that enables the app to get user
input
 Important Properties
• Placeholder text which is shown when there is no user input
• Normal text
• Auto correction type
• Key board type
• Return key type
• Clear button mode
• Alignment
11
Nikmesoft Ltd
Employing Basic UI Elements
 UITextField
 Delegates
• - (void)textFieldDidBeginEditing:(UITextField *)textField
• - (void)textFieldDidEndEditing:(UITextField *)textField
12
Nikmesoft Ltd
Employing Basic UI Elements
 UITextField
 Input Types
• UIKeyboardTypeASCIICapable
• UIKeyboardTypeURL
• UIKeyboardTypeNumberPad
• UIKeyboardTypePhonePad
• UIKeyboardTypeNamePhonePad
• UIKeyboardTypeEmailAddress
• UIKeyboardTypeDecimalPad
• UIKeyboardTypeTwitter
13
Nikmesoft Ltd
Employing Basic UI Elements
 UITextField
 Create a text field by codes
14
Nikmesoft Ltd
Employing Basic UI Elements
 UIButton
 Buttons are used for handling user actions. It intercepts the
touch events and sends message to the target object.
 Important properties
• State Config
• Image
• TitleLabel
15
Nikmesoft Ltd
Employing Basic UI Elements
 UIButton
 Button types
• UIButtonTypeCustom
• UIButtonTypeRoundedRect
• UIButtonTypeDetailDisclosure
• UIButtonTypeInfoLight
• UIButtonTypeInfoDark
• UIButtonTypeContactAdd
16
Nikmesoft Ltd
Employing Basic UI Elements
 UIButton
 Important methods
17
Nikmesoft Ltd
Employing Basic UI Elements
 UILabel
 Labels are used for displaying static content which consists of a
single line or multiple lines.
 Important properties
• textAlignment
• textColor
• text
• numberOflines
• lineBreakMode
18
Nikmesoft Ltd
Employing Basic UI Elements
 UILabel
 Create a Label by code
19
Nikmesoft Ltd
Employing Basic UI Elements
 UIImageView
 Image view is used for displaying a single image or animated
sequence of images.
 Important properties
• image
• highlightedImage
• contentModes
• animationImages
• animationRepeatCount
20
Nikmesoft Ltd
Employing Basic UI Elements
 UIImageView
 Important methods
21
Nikmesoft Ltd
Employing Basic UI Elements
 UITextView
 Text View is used displaying multi line of scrollable text which is
optionally editable.
 Important properties
• editable
• text
• textAlignment
• textColor
22
Nikmesoft Ltd
Employing Basic UI Elements
 UITextView
 Important delegate methods
23
Nikmesoft Ltd
Employing Basic UI Elements
 UISwitch
 Switches are used to toggle between on and off states.
 Important properties
• onImage
• offImage
• on
24
Nikmesoft Ltd
Employing Basic UI Elements
 UISwitch
 Create a switch by code
25
Nikmesoft Ltd
Employing Basic UI Elements
 UISlider
 Sliders are used to choose a single value from a range of values.
 Important properties
• Continuous (If YES, the slider sends update events continuously to the
associated target’s action method. If NO, the slider only sends an action
event when the user releases the slider’s thumb control to set the final
value.)
• maximumValue
• minimumValue
• value
26
Nikmesoft Ltd
Employing Basic UI Elements
 UISlider
 Create a slider by code
27
Nikmesoft Ltd
Employing Basic UI Elements
 UIAlertView
 Alerts are used to give important information to user. Only after
selecting the option in the alert view we can proceed further
using the app.
 Important properties
• alertViewStyle(http://mobile.tutsplus.com/tutorials/iphone/ios-5-sdk-
uialertview-text-input-and-validation/)
• cancelButtonIndex
• message
• numberOfButtons
• title
28
Nikmesoft Ltd
Employing Basic UI Elements
 UIAlertView
 Important methods
29
Nikmesoft Ltd
Employing Basic UI Elements
 UIAlertView
 Create an alert view by code
30
Nikmesoft Ltd
Employing Basic UI Elements
 UIAlertView
 Important delegate methods
31
Nikmesoft Ltd
Basic UI Elements
Working with Containers
32
Nikmesoft Ltd
Employing Basic UI Elements
 UIScrollView
 Scroll View is used for displaying content more than the size of
the screen. It can contain all of the other UI elements like image
views, labels, text views and even another scroll view itself.
 Important properties
• contentSize
• contentInset
• contentOffset
• delegate
33
Nikmesoft Ltd
Employing Basic UI Elements
 UIScrollView
 Important properties
• ContentInset
34
Nikmesoft Ltd
Employing Basic UI Elements
 UIScrollView
 Important methods
35
Nikmesoft Ltd
Employing Basic UI Elements
 UIScrollView
 Create a scroll view by code
36
Nikmesoft Ltd
Example 2.1
37
Nikmesoft Ltd
Employing Basic UI Elements
 UITableView
 It is used for displaying a vertically scrollable view which consists
of number of cells (generally reusable cells). It has special
features like headers, footers, rows and section.
 Important properties
• delegate
• dataSource
• rowHeight
• sectionFooterHeight
• sectionHeaderHeight
38
Nikmesoft Ltd
Employing Basic UI Elements
 UITableView
 Important properties(cont.)
• separatorColor
• tableHeaderView
• tableFooterView
• Style(Plain or Group)
39
Nikmesoft Ltd
Employing Basic UI Elements
 UITableView
 Important data source methods
40
Nikmesoft Ltd
Employing Basic UI Elements
 UITableView
 Important delegate methods
41
Nikmesoft Ltd
Example 2.2
42
Nikmesoft Ltd
Example 2.2
43
Nikmesoft Ltd
Employing Basic UI Elements
 UIPickerView
 Pickers consist of a rotating scrollable view which is used for
picking a value from the list of items.
 Important properties
• delegate
• dataSource
44
Nikmesoft Ltd
Employing Basic UI Elements
 UIPickerView
 Important data source methods
45
Nikmesoft Ltd
Employing Basic UI Elements
 UIPickerView
 Important delegate methods
46
Nikmesoft Ltd
Exercise 2
47
 Contact App
 TableView with XIB custom cell
 Section by first character of Last Name
 Bold font for Last Name
 Index (http://www.iphonedevcentral.com/indexed-uitableview-tutorial/)
Nikmesoft Ltd
48

More Related Content

PDF
[iOS] Navigation
PDF
Mobile Means Business
PDF
[iOS] Multiple Background Threads
PDF
[iOS] Introduction to iOS Programming
PDF
Mobile app ux_principles
PDF
SXSW 2012: We made this, and it's not an ad
PDF
Naked Insights
PDF
How to become a product manager
[iOS] Navigation
Mobile Means Business
[iOS] Multiple Background Threads
[iOS] Introduction to iOS Programming
Mobile app ux_principles
SXSW 2012: We made this, and it's not an ad
Naked Insights
How to become a product manager

Viewers also liked (16)

PPTX
Why users can't find answers in help material
PPTX
Haas Innovation Challenges Presentation
PDF
UX Design for Mobile Apps
PDF
Mobile App Design course (iOS & Android)
PDF
TechTalk 77 UI & UX Presentation
PDF
Indonesia Digital & Social Media Case Study
PDF
5 UX Mistakes that are killing your products
PPTX
Mobile First Design Strategy & Process
PDF
So you want to be a Service Designer
PDF
Data in the city
PPTX
Ui ux designing principles
PDF
Introduction on Service Design
PDF
ProductTank: What do UX people want from PMs and how can they best work toget...
PDF
UX Experience Design: Processes and Strategy
PPTX
Service Design Workshop: Designing the Customer Experience
PDF
Agile explained
Why users can't find answers in help material
Haas Innovation Challenges Presentation
UX Design for Mobile Apps
Mobile App Design course (iOS & Android)
TechTalk 77 UI & UX Presentation
Indonesia Digital & Social Media Case Study
5 UX Mistakes that are killing your products
Mobile First Design Strategy & Process
So you want to be a Service Designer
Data in the city
Ui ux designing principles
Introduction on Service Design
ProductTank: What do UX people want from PMs and how can they best work toget...
UX Experience Design: Processes and Strategy
Service Design Workshop: Designing the Customer Experience
Agile explained
Ad

Similar to [iOS] Basic UI Elements (20)

PPTX
What is ui element in i phone developmetn
PPTX
Basic iOS Training with SWIFT - Part 3
PDF
Assignment2 B Walkthrough
PPTX
Code camp 2011 Getting Started with IOS, Una Daly
PDF
Beginning iOS6 Development CH04 More User Interface Fun
PDF
iOS 7 Programming Cookbook 2nd Edition Vandad Nahavandipoor
PDF
iOS 7 Programming Cookbook 2nd Edition Vandad Nahavandipoor
PPTX
iOS for C# Developers - DevConnections Talk
PDF
Dev101
PPTX
iOS UI best practices
PPT
Ios - Intorduction to view controller
PDF
Building a Completed iPhone App
PDF
iPhone Application Develpment With Iscope Digital
PDF
I pad uicatalog_lesson02
PDF
Fred Spencer: Designing a Great UI
PDF
Designing a Great UI
PDF
I Phone101
PPTX
UI development company
PDF
Ios 7 Programming Cookbook 2nd Edition Vandad Nahavandipoor
PPTX
Creating Mobile Aps without Coding
What is ui element in i phone developmetn
Basic iOS Training with SWIFT - Part 3
Assignment2 B Walkthrough
Code camp 2011 Getting Started with IOS, Una Daly
Beginning iOS6 Development CH04 More User Interface Fun
iOS 7 Programming Cookbook 2nd Edition Vandad Nahavandipoor
iOS 7 Programming Cookbook 2nd Edition Vandad Nahavandipoor
iOS for C# Developers - DevConnections Talk
Dev101
iOS UI best practices
Ios - Intorduction to view controller
Building a Completed iPhone App
iPhone Application Develpment With Iscope Digital
I pad uicatalog_lesson02
Fred Spencer: Designing a Great UI
Designing a Great UI
I Phone101
UI development company
Ios 7 Programming Cookbook 2nd Edition Vandad Nahavandipoor
Creating Mobile Aps without Coding
Ad

More from Nikmesoft Ltd (15)

PDF
[iOS] Networking
PDF
[iOS] Data Storage
PDF
[Android] Multimedia Programming
PDF
[Android] Android Animation
PDF
[Android] 2D Graphics
PDF
[Android] Services and Broadcast Receivers
PDF
[Android] Web services
PDF
[Android] Multiple Background Threads
PDF
[Android] Maps, Geocoding and Location-Based Services
PDF
[Android] Data Storage
PDF
[Android] Intent and Activity
PDF
[Android] Widget Event Handling
PDF
[Android] Using Selection Widgets
PDF
[Android] Basic Widgets and Containers
PDF
[Android] Introduction to Android Programming
[iOS] Networking
[iOS] Data Storage
[Android] Multimedia Programming
[Android] Android Animation
[Android] 2D Graphics
[Android] Services and Broadcast Receivers
[Android] Web services
[Android] Multiple Background Threads
[Android] Maps, Geocoding and Location-Based Services
[Android] Data Storage
[Android] Intent and Activity
[Android] Widget Event Handling
[Android] Using Selection Widgets
[Android] Basic Widgets and Containers
[Android] Introduction to Android Programming

Recently uploaded (20)

PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Benefits of Physical activity for teenagers.pptx
PPT
What is a Computer? Input Devices /output devices
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Five Habits of High-Impact Board Members
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
Flame analysis and combustion estimation using large language and vision assi...
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PDF
Architecture types and enterprise applications.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPT
Geologic Time for studying geology for geologist
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
Custom Battery Pack Design Considerations for Performance and Safety
sustainability-14-14877-v2.pddhzftheheeeee
Benefits of Physical activity for teenagers.pptx
What is a Computer? Input Devices /output devices
NewMind AI Weekly Chronicles – August ’25 Week III
Consumable AI The What, Why & How for Small Teams.pdf
Convolutional neural network based encoder-decoder for efficient real-time ob...
Five Habits of High-Impact Board Members
Module 1.ppt Iot fundamentals and Architecture
A review of recent deep learning applications in wood surface defect identifi...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Build Your First AI Agent with UiPath.pptx
Flame analysis and combustion estimation using large language and vision assi...
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Architecture types and enterprise applications.pdf
Getting started with AI Agents and Multi-Agent Systems
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Geologic Time for studying geology for geologist
UiPath Agentic Automation session 1: RPA to Agents
A proposed approach for plagiarism detection in Myanmar Unicode text

[iOS] Basic UI Elements

  • 1. Nikmesoft Ltd Basic UI Elements Linh NGUYEN Lecture 2
  • 2. Nikmesoft Ltd Contents Overview1 Employing Basic UI Elements2 Working with Containers3 Example 24 Exercise 25 2
  • 3. Nikmesoft Ltd Basic UI Elements Overview 3
  • 4. Nikmesoft Ltd Overview  What UI elements are?  UI elements are visual elements that we can see in our applications. Some of these elements respond to user interactions such as buttons, text fields and others are informative such as images, labels.  How to add UI elements?  We can add UI elements both in code and with the help of interface builder. Depending on the need we can use either one of them. 4
  • 6. Nikmesoft Ltd Overview  Delegates  Let's assume an object A calls object B to perform an action, once the action is complete object A should know that B has completed the task and take necessary action. This is achieved with the help of delegates. 6
  • 7. Nikmesoft Ltd Overview  Delegates(cont.)  The key concepts in the above example are: • A is delegate object of B • B will have a reference of A • A will implement the delegate methods of B. • B will notify A through the delegate methods. 7
  • 10. Nikmesoft Ltd Basic UI Elements Employing Basic UI Elements 10
  • 11. Nikmesoft Ltd Employing Basic UI Elements  UITextField  A text field is an UI element that enables the app to get user input  Important Properties • Placeholder text which is shown when there is no user input • Normal text • Auto correction type • Key board type • Return key type • Clear button mode • Alignment 11
  • 12. Nikmesoft Ltd Employing Basic UI Elements  UITextField  Delegates • - (void)textFieldDidBeginEditing:(UITextField *)textField • - (void)textFieldDidEndEditing:(UITextField *)textField 12
  • 13. Nikmesoft Ltd Employing Basic UI Elements  UITextField  Input Types • UIKeyboardTypeASCIICapable • UIKeyboardTypeURL • UIKeyboardTypeNumberPad • UIKeyboardTypePhonePad • UIKeyboardTypeNamePhonePad • UIKeyboardTypeEmailAddress • UIKeyboardTypeDecimalPad • UIKeyboardTypeTwitter 13
  • 14. Nikmesoft Ltd Employing Basic UI Elements  UITextField  Create a text field by codes 14
  • 15. Nikmesoft Ltd Employing Basic UI Elements  UIButton  Buttons are used for handling user actions. It intercepts the touch events and sends message to the target object.  Important properties • State Config • Image • TitleLabel 15
  • 16. Nikmesoft Ltd Employing Basic UI Elements  UIButton  Button types • UIButtonTypeCustom • UIButtonTypeRoundedRect • UIButtonTypeDetailDisclosure • UIButtonTypeInfoLight • UIButtonTypeInfoDark • UIButtonTypeContactAdd 16
  • 17. Nikmesoft Ltd Employing Basic UI Elements  UIButton  Important methods 17
  • 18. Nikmesoft Ltd Employing Basic UI Elements  UILabel  Labels are used for displaying static content which consists of a single line or multiple lines.  Important properties • textAlignment • textColor • text • numberOflines • lineBreakMode 18
  • 19. Nikmesoft Ltd Employing Basic UI Elements  UILabel  Create a Label by code 19
  • 20. Nikmesoft Ltd Employing Basic UI Elements  UIImageView  Image view is used for displaying a single image or animated sequence of images.  Important properties • image • highlightedImage • contentModes • animationImages • animationRepeatCount 20
  • 21. Nikmesoft Ltd Employing Basic UI Elements  UIImageView  Important methods 21
  • 22. Nikmesoft Ltd Employing Basic UI Elements  UITextView  Text View is used displaying multi line of scrollable text which is optionally editable.  Important properties • editable • text • textAlignment • textColor 22
  • 23. Nikmesoft Ltd Employing Basic UI Elements  UITextView  Important delegate methods 23
  • 24. Nikmesoft Ltd Employing Basic UI Elements  UISwitch  Switches are used to toggle between on and off states.  Important properties • onImage • offImage • on 24
  • 25. Nikmesoft Ltd Employing Basic UI Elements  UISwitch  Create a switch by code 25
  • 26. Nikmesoft Ltd Employing Basic UI Elements  UISlider  Sliders are used to choose a single value from a range of values.  Important properties • Continuous (If YES, the slider sends update events continuously to the associated target’s action method. If NO, the slider only sends an action event when the user releases the slider’s thumb control to set the final value.) • maximumValue • minimumValue • value 26
  • 27. Nikmesoft Ltd Employing Basic UI Elements  UISlider  Create a slider by code 27
  • 28. Nikmesoft Ltd Employing Basic UI Elements  UIAlertView  Alerts are used to give important information to user. Only after selecting the option in the alert view we can proceed further using the app.  Important properties • alertViewStyle(http://mobile.tutsplus.com/tutorials/iphone/ios-5-sdk- uialertview-text-input-and-validation/) • cancelButtonIndex • message • numberOfButtons • title 28
  • 29. Nikmesoft Ltd Employing Basic UI Elements  UIAlertView  Important methods 29
  • 30. Nikmesoft Ltd Employing Basic UI Elements  UIAlertView  Create an alert view by code 30
  • 31. Nikmesoft Ltd Employing Basic UI Elements  UIAlertView  Important delegate methods 31
  • 32. Nikmesoft Ltd Basic UI Elements Working with Containers 32
  • 33. Nikmesoft Ltd Employing Basic UI Elements  UIScrollView  Scroll View is used for displaying content more than the size of the screen. It can contain all of the other UI elements like image views, labels, text views and even another scroll view itself.  Important properties • contentSize • contentInset • contentOffset • delegate 33
  • 34. Nikmesoft Ltd Employing Basic UI Elements  UIScrollView  Important properties • ContentInset 34
  • 35. Nikmesoft Ltd Employing Basic UI Elements  UIScrollView  Important methods 35
  • 36. Nikmesoft Ltd Employing Basic UI Elements  UIScrollView  Create a scroll view by code 36
  • 38. Nikmesoft Ltd Employing Basic UI Elements  UITableView  It is used for displaying a vertically scrollable view which consists of number of cells (generally reusable cells). It has special features like headers, footers, rows and section.  Important properties • delegate • dataSource • rowHeight • sectionFooterHeight • sectionHeaderHeight 38
  • 39. Nikmesoft Ltd Employing Basic UI Elements  UITableView  Important properties(cont.) • separatorColor • tableHeaderView • tableFooterView • Style(Plain or Group) 39
  • 40. Nikmesoft Ltd Employing Basic UI Elements  UITableView  Important data source methods 40
  • 41. Nikmesoft Ltd Employing Basic UI Elements  UITableView  Important delegate methods 41
  • 44. Nikmesoft Ltd Employing Basic UI Elements  UIPickerView  Pickers consist of a rotating scrollable view which is used for picking a value from the list of items.  Important properties • delegate • dataSource 44
  • 45. Nikmesoft Ltd Employing Basic UI Elements  UIPickerView  Important data source methods 45
  • 46. Nikmesoft Ltd Employing Basic UI Elements  UIPickerView  Important delegate methods 46
  • 47. Nikmesoft Ltd Exercise 2 47  Contact App  TableView with XIB custom cell  Section by first character of Last Name  Bold font for Last Name  Index (http://www.iphonedevcentral.com/indexed-uitableview-tutorial/)