SlideShare ist ein Scribd-Unternehmen logo
1 von 25
1/82
2/82
Designing with a UIToolBarDesigning with a UIToolBar
iPhone/iPad, iOS Development Tutorial
2
3/82
UINavigation ControllerUINavigation Controller
• The UINavigationController maintains a UIToolBar for
each view controller in its stack.
• This toolbar is normally hidden, but we can place
buttons on it and display it any time we want.
3
4/82
Open a new “Single View” appOpen a new “Single View” app
• Start Xcode, choose “Create a new Xcode
project,” select the Single View Application
template, and click Next.
• Select “Use Auto Reference Counting”
• Don’t select the storyboard. Don’t really need it for
this application.
• Select ‘iPhone’ as the app type
4
5/82
Add a new ClassAdd a new Class
• Select the Objective-C class template, click Next
• Name the class MainViewController.
• Make sure that the class is a subclass of
UIViewController and also create a XIB file for the
controller’s view as shown:
5
6/82
Create: MainViewControllerCreate: MainViewController
6
7/82
Edit AppDelegate.hEdit AppDelegate.h
• Now we’re going to set up a navigation controller
having a MainViewController object as its root view
controller.
• Select the AppDelegate.h file, and add the two
properties for the UINavigationController and the
MainViewController as shown on the next slide.
7
8/82
Add 2 properties + headerAdd 2 properties + header
#import "MainViewController.h“
@property (strong, nonatomic) UINavigationController
*navController;
@property (strong, nonatomic) MainViewController
*rootViewController;
8
9/82
Edit: AppDelegate.mEdit: AppDelegate.m
First synthesize our properties:
@synthesize navController = _navController;
@synthesize rootViewController = _rootViewController;
9
10/82
Edit: AppDelegate.mEdit: AppDelegate.m
• Change the didFinishLaunchingWithOptions:
method
• It’s the only method we will be making changes to.
• Leave the remaining methods in place.
10
11/82
didFinishLaunchingWithOptionsdidFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen
mainScreen] bounds]];
// Override point for customization after application
launch.
self.rootViewController = [[MainViewController alloc]
initWithNibName:nil bundle:nil];
self.rootViewController.title = @"Main View";
self.navController = [[UINavigationController alloc]
initWithRootViewController:self.rootViewController];
[self.window addSubview:self.navController.view];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
11
12/82
What are we doing?What are we doing?
• First, we allocate and initialize the rootViewController.
• The nib name of nil in this case directs the compiler to
associate this controller with the XIB file that was
created with it (MainViewController.xib).
• A bundle of nil directs the compiler to use this
application’s bundle.
• After we initialize this controller, we set its title to
@”Main View.” This title will appear in the navigation
bar for this view controller.
12
13/82
navController ObjectnavController Object
• Next, we set up the navController object.
• We make rootViewController this object’s Root View
Controller.
• Adding the navController’s view to the main window
as a subview, we then make the main window key
and visible, and we’re off and running.
13
14/82
MainViewController.xibMainViewController.xib
14
15/82
@”Main View”@”Main View”
• Since the view
controller’s title
property was set to
@”Main View” in the
AppDelegate, that title
will appear at the top
of the interface when
we run the app:
15
16/82
MainViewController.mMainViewController.m
• Open the MainViewController.m file, and make
these additions to initWithNibName:
bundle.
16
17/82
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// set up the nav bar button:
UIBarButtonItem *btnShow = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self
action:@selector(toggleToolBar)];
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:btnShow,
nil];
// set up the tool bar buttons:
UIBarButtonItem *btnRed = [[UIBarButtonItem alloc] initWithTitle:@"Red"
style:UIBarButtonItemStyleDone target:self action:@selector(btnRedTouched)];
UIBarButtonItem *btnBlue = [[UIBarButtonItem alloc] initWithTitle:@"Blue"
style:UIBarButtonItemStyleDone target:self action:@selector(btnBlueTouched)];
UIBarButtonItem *spacer = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil
action:nil];
UIBarButtonItem *btnGreen = [[UIBarButtonItem alloc] initWithTitle:@"Green"
style:UIBarButtonItemStyleDone target:self action:@selector(btnGreenTouched)];
self.toolbarItems = [NSArray arrayWithObjects:btnRed, btnBlue, spacer,
btnGreen, nil];
}
return self;
}
17
18/82
What did we do?What did we do?• We add a UIBarButtonSystemItemSearch button to the navigationItem’s
rightBarButtonItems array.
• This button will be placed at the right of the top navigation bar. Next, we set
up three bar buttons (btnRed, btnBlue, and btnGreen) and a spacer.
• The three buttons each have a selector, these will be defined shortly. Each
also is initialized with a title, and a style of UIBarButtonItemStyleDone, which will
produce a button with a blue background and white bolded text.
18
19/82
What did we do?What did we do?
• The function of the spacer is to add “flexible
space” between btnBlue and btnGreen.
• Flexible space will act as a “spring” between
the two buttons, pushing btnGreen all the
way to the right of the tool bar.
• Since this space is invisible, it makes no sense
to assign it an action method, so we have
set both the target and action of this object
to nil.
19
20/82
What did we do?What did we do?
• Now that we have the buttons, we need to add
them to the tool bar.
• Each view controller has it’s own toolBarItems
property, which is an NSArray of UIBarButtonItem
objects.
• We stuffed the toolBarButtons array with the three
buttons and the spacer.
20
21/82
Add to: MainViewController.mAdd to: MainViewController.m
• The last step…
• Implement the four methods we set as actions in
the buttons as shown in the code on the next slide.
21
22/82
- (void)toggleToolBar
{
BOOL barState = self.navigationController.toolbarHidden;
[self.navigationController setToolbarHidden:!barState
animated:YES];
}
- (void)btnRedTouched
{
self.view.backgroundColor = [UIColor redColor];
}
- (void)btnBlueTouched
{
self.view.backgroundColor = [UIColor cyanColor];
}
- (void)btnGreenTouched
{
self.view.backgroundColor = [UIColor greenColor];
}
22
23/82
What did we do?What did we do?
• toggleToolBar gets the hidden property of the tool
bar, then sets that property to its negation. In other
words, if the tool bar is hidden it will be shown, if it is
shown it will be hidden.
• The three btn…Touched methods set the color of
the view’s background to red, cyan, or green when
they are touched.
23
24/82
Program OutputProgram Output
24
25/82
ThankThank You !!!You !!!
For More Information click below link:
Follow Us on:
http://vibranttechnologies.co.in/ios-classes-in-mumbai.html

Weitere ähnliche Inhalte

Was ist angesagt?

Mule java part-2
Mule java part-2Mule java part-2
Mule java part-2Karnam Karthik
 
Deep diving into building lightning components
Deep diving into building lightning componentsDeep diving into building lightning components
Deep diving into building lightning componentsCloud Analogy
 
android activity
android activityandroid activity
android activityDeepa Rani
 
React-Native Lecture 11: In App Storage
React-Native Lecture 11: In App StorageReact-Native Lecture 11: In App Storage
React-Native Lecture 11: In App StorageKobkrit Viriyayudhakorn
 
Build your first android mobile app
Build your first android mobile appBuild your first android mobile app
Build your first android mobile appekipaco
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycleKumar
 
Android | Android Activity Launch Modes and Tasks | Gonçalo Silva
Android | Android Activity Launch Modes and Tasks | Gonçalo SilvaAndroid | Android Activity Launch Modes and Tasks | Gonçalo Silva
Android | Android Activity Launch Modes and Tasks | Gonçalo SilvaJAX London
 
Getting Started with Developing for the Apple Watch
Getting Started with Developing for the Apple WatchGetting Started with Developing for the Apple Watch
Getting Started with Developing for the Apple WatchMurtza Manzur
 
Android activity
Android activityAndroid activity
Android activityKrazy Koder
 
Unity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and AndroidUnity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and AndroidKobkrit Viriyayudhakorn
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - AndroidWingston
 
[Made Easy] How to use IFTT - Tutorial
[Made Easy] How to use IFTT - Tutorial[Made Easy] How to use IFTT - Tutorial
[Made Easy] How to use IFTT - TutorialEdison Villareal
 
08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)Oum Saokosal
 
Getting Started With Developing For Apple Watch
Getting Started With Developing For Apple WatchGetting Started With Developing For Apple Watch
Getting Started With Developing For Apple WatchInMobi
 
iPhone Development Tools
iPhone Development ToolsiPhone Development Tools
iPhone Development ToolsOmar Cafini
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your appsJuan C Catalan
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2Kobkrit Viriyayudhakorn
 
Android tutorial (2)
Android tutorial (2)Android tutorial (2)
Android tutorial (2)Kumar
 

Was ist angesagt? (20)

Mule java part-2
Mule java part-2Mule java part-2
Mule java part-2
 
Deep diving into building lightning components
Deep diving into building lightning componentsDeep diving into building lightning components
Deep diving into building lightning components
 
android activity
android activityandroid activity
android activity
 
React-Native Lecture 11: In App Storage
React-Native Lecture 11: In App StorageReact-Native Lecture 11: In App Storage
React-Native Lecture 11: In App Storage
 
Build your first android mobile app
Build your first android mobile appBuild your first android mobile app
Build your first android mobile app
 
Android lifecycle
Android lifecycleAndroid lifecycle
Android lifecycle
 
Android | Android Activity Launch Modes and Tasks | Gonçalo Silva
Android | Android Activity Launch Modes and Tasks | Gonçalo SilvaAndroid | Android Activity Launch Modes and Tasks | Gonçalo Silva
Android | Android Activity Launch Modes and Tasks | Gonçalo Silva
 
Getting Started with Developing for the Apple Watch
Getting Started with Developing for the Apple WatchGetting Started with Developing for the Apple Watch
Getting Started with Developing for the Apple Watch
 
Android activity
Android activityAndroid activity
Android activity
 
Unity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and AndroidUnity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and Android
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
[Made Easy] How to use IFTT - Tutorial
[Made Easy] How to use IFTT - Tutorial[Made Easy] How to use IFTT - Tutorial
[Made Easy] How to use IFTT - Tutorial
 
08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)
 
Getting Started With Developing For Apple Watch
Getting Started With Developing For Apple WatchGetting Started With Developing For Apple Watch
Getting Started With Developing For Apple Watch
 
iPhone Development Tools
iPhone Development ToolsiPhone Development Tools
iPhone Development Tools
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
 
Ios - Introduction to memory management
Ios - Introduction to memory managementIos - Introduction to memory management
Ios - Introduction to memory management
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
 
Android tutorial (2)
Android tutorial (2)Android tutorial (2)
Android tutorial (2)
 
Let's do SPA
Let's do SPALet's do SPA
Let's do SPA
 

Andere mochten auch (12)

Android - Api & Debugging in Android
Android - Api & Debugging in AndroidAndroid - Api & Debugging in Android
Android - Api & Debugging in Android
 
Android - Android Intent Types
Android - Android Intent TypesAndroid - Android Intent Types
Android - Android Intent Types
 
Android - Android Application Fundamentals
Android - Android Application FundamentalsAndroid - Android Application Fundamentals
Android - Android Application Fundamentals
 
Android - Getting started with Android
Android - Getting started with Android Android - Getting started with Android
Android - Getting started with Android
 
Android - Anatomy of android elements & layouts
Android - Anatomy of android elements & layoutsAndroid - Anatomy of android elements & layouts
Android - Anatomy of android elements & layouts
 
Ios - Introduction to platform & SDK
Ios - Introduction to platform & SDKIos - Introduction to platform & SDK
Ios - Introduction to platform & SDK
 
Weblogic - overview of application server
Weblogic - overview of application serverWeblogic - overview of application server
Weblogic - overview of application server
 
Android - Anroid Pproject
Android - Anroid PprojectAndroid - Anroid Pproject
Android - Anroid Pproject
 
Android - Android Geocoding and Location based Services
Android - Android Geocoding and Location based ServicesAndroid - Android Geocoding and Location based Services
Android - Android Geocoding and Location based Services
 
Ios - Introduction to swift programming
Ios - Introduction to swift programmingIos - Introduction to swift programming
Ios - Introduction to swift programming
 
Android - Graphics Animation in Android
Android - Graphics Animation in AndroidAndroid - Graphics Animation in Android
Android - Graphics Animation in Android
 
Ios - Intorduction to view controller
Ios - Intorduction to view controllerIos - Intorduction to view controller
Ios - Intorduction to view controller
 

Ähnlich wie IOS- Designing with ui tool bar in ios

Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of XcodeDhaval Kaneria
 
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
 
iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's NewNascentDigital
 
Alloy Simple App Demonstration
Alloy Simple App DemonstrationAlloy Simple App Demonstration
Alloy Simple App DemonstrationAaron Saunders
 
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 developmetnTOPS Technologies
 
Building your first iOS app using Xamarin
Building your first iOS app using XamarinBuilding your first iOS app using Xamarin
Building your first iOS app using XamarinGill Cleeren
 
Apple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewApple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewSammy Sunny
 
iOS Contact List Application Tutorial
iOS Contact List Application TutorialiOS Contact List Application Tutorial
iOS Contact List Application TutorialIshara Amarasekera
 
I pad uicatalog_lesson02
I pad uicatalog_lesson02I pad uicatalog_lesson02
I pad uicatalog_lesson02Rich Helton
 
Creating a comp
Creating a compCreating a comp
Creating a compKranthi Kumar
 
Creating simple comp
Creating simple compCreating simple comp
Creating simple compKranthi Kumar
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS appKetan Raval
 
Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Mahmoud
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outletsveeracynixit
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outletsveeracynixit
 
Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App DevelopmentKetan Raval
 
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 SceneIMC Institute
 
Project anatomy & hello world
Project anatomy & hello worldProject anatomy & hello world
Project anatomy & hello worldnationalmobileapps
 

Ähnlich wie IOS- Designing with ui tool bar in ios (20)

Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
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)
 
iOS: View Controllers
iOS: View ControllersiOS: View Controllers
iOS: View Controllers
 
iOS Development: What's New
iOS Development: What's NewiOS Development: What's New
iOS Development: What's New
 
Alloy Simple App Demonstration
Alloy Simple App DemonstrationAlloy Simple App Demonstration
Alloy Simple App Demonstration
 
IOS Storyboards
IOS StoryboardsIOS Storyboards
IOS Storyboards
 
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
 
Building your first iOS app using Xamarin
Building your first iOS app using XamarinBuilding your first iOS app using Xamarin
Building your first iOS app using Xamarin
 
Apple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewApple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical Overview
 
iOS Contact List Application Tutorial
iOS Contact List Application TutorialiOS Contact List Application Tutorial
iOS Contact List Application Tutorial
 
I pad uicatalog_lesson02
I pad uicatalog_lesson02I pad uicatalog_lesson02
I pad uicatalog_lesson02
 
Creating a comp
Creating a compCreating a comp
Creating a comp
 
Creating simple comp
Creating simple compCreating simple comp
Creating simple comp
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
 
Assignment 4 Paparazzi1
Assignment 4 Paparazzi1Assignment 4 Paparazzi1
Assignment 4 Paparazzi1
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS 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
 
Project anatomy & hello world
Project anatomy & hello worldProject anatomy & hello world
Project anatomy & hello world
 

Mehr von Vibrant Technologies & Computers

SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables Vibrant Technologies & Computers
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Vibrant Technologies & Computers
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingVibrant Technologies & Computers
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change managementVibrant Technologies & Computers
 

Mehr von Vibrant Technologies & Computers (20)

Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
 
ITIL - introduction to ITIL
ITIL - introduction to ITILITIL - introduction to ITIL
ITIL - introduction to ITIL
 
Salesforce - Introduction to Security & Access
Salesforce -  Introduction to Security & Access Salesforce -  Introduction to Security & Access
Salesforce - Introduction to Security & Access
 
Data ware housing- Introduction to olap .
Data ware housing- Introduction to  olap .Data ware housing- Introduction to  olap .
Data ware housing- Introduction to olap .
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housing
 
Salesforce - classification of cloud computing
Salesforce - classification of cloud computingSalesforce - classification of cloud computing
Salesforce - classification of cloud computing
 
Salesforce - cloud computing fundamental
Salesforce - cloud computing fundamentalSalesforce - cloud computing fundamental
Salesforce - cloud computing fundamental
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
 
SQL- Introduction to advanced sql concepts
SQL- Introduction to  advanced sql conceptsSQL- Introduction to  advanced sql concepts
SQL- Introduction to advanced sql concepts
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
 
Sas - Introduction to designing the data mart
Sas - Introduction to designing the data martSas - Introduction to designing the data mart
Sas - Introduction to designing the data mart
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change management
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
 
Teradata - Restoring Data
Teradata - Restoring Data Teradata - Restoring Data
Teradata - Restoring Data
 

KĂźrzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂşjo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

KĂźrzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

IOS- Designing with ui tool bar in ios

  • 2. 2/82 Designing with a UIToolBarDesigning with a UIToolBar iPhone/iPad, iOS Development Tutorial 2
  • 3. 3/82 UINavigation ControllerUINavigation Controller • The UINavigationController maintains a UIToolBar for each view controller in its stack. • This toolbar is normally hidden, but we can place buttons on it and display it any time we want. 3
  • 4. 4/82 Open a new “Single View” appOpen a new “Single View” app • Start Xcode, choose “Create a new Xcode project,” select the Single View Application template, and click Next. • Select “Use Auto Reference Counting” • Don’t select the storyboard. Don’t really need it for this application. • Select ‘iPhone’ as the app type 4
  • 5. 5/82 Add a new ClassAdd a new Class • Select the Objective-C class template, click Next • Name the class MainViewController. • Make sure that the class is a subclass of UIViewController and also create a XIB file for the controller’s view as shown: 5
  • 7. 7/82 Edit AppDelegate.hEdit AppDelegate.h • Now we’re going to set up a navigation controller having a MainViewController object as its root view controller. • Select the AppDelegate.h file, and add the two properties for the UINavigationController and the MainViewController as shown on the next slide. 7
  • 8. 8/82 Add 2 properties + headerAdd 2 properties + header #import "MainViewController.h“ @property (strong, nonatomic) UINavigationController *navController; @property (strong, nonatomic) MainViewController *rootViewController; 8
  • 9. 9/82 Edit: AppDelegate.mEdit: AppDelegate.m First synthesize our properties: @synthesize navController = _navController; @synthesize rootViewController = _rootViewController; 9
  • 10. 10/82 Edit: AppDelegate.mEdit: AppDelegate.m • Change the didFinishLaunchingWithOptions: method • It’s the only method we will be making changes to. • Leave the remaining methods in place. 10
  • 11. 11/82 didFinishLaunchingWithOptionsdidFinishLaunchingWithOptions - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.rootViewController = [[MainViewController alloc] initWithNibName:nil bundle:nil]; self.rootViewController.title = @"Main View"; self.navController = [[UINavigationController alloc] initWithRootViewController:self.rootViewController]; [self.window addSubview:self.navController.view]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } 11
  • 12. 12/82 What are we doing?What are we doing? • First, we allocate and initialize the rootViewController. • The nib name of nil in this case directs the compiler to associate this controller with the XIB file that was created with it (MainViewController.xib). • A bundle of nil directs the compiler to use this application’s bundle. • After we initialize this controller, we set its title to @”Main View.” This title will appear in the navigation bar for this view controller. 12
  • 13. 13/82 navController ObjectnavController Object • Next, we set up the navController object. • We make rootViewController this object’s Root View Controller. • Adding the navController’s view to the main window as a subview, we then make the main window key and visible, and we’re off and running. 13
  • 15. 15/82 @”Main View”@”Main View” • Since the view controller’s title property was set to @”Main View” in the AppDelegate, that title will appear at the top of the interface when we run the app: 15
  • 16. 16/82 MainViewController.mMainViewController.m • Open the MainViewController.m file, and make these additions to initWithNibName: bundle. 16
  • 17. 17/82 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // set up the nav bar button: UIBarButtonItem *btnShow = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(toggleToolBar)]; self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:btnShow, nil]; // set up the tool bar buttons: UIBarButtonItem *btnRed = [[UIBarButtonItem alloc] initWithTitle:@"Red" style:UIBarButtonItemStyleDone target:self action:@selector(btnRedTouched)]; UIBarButtonItem *btnBlue = [[UIBarButtonItem alloc] initWithTitle:@"Blue" style:UIBarButtonItemStyleDone target:self action:@selector(btnBlueTouched)]; UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; UIBarButtonItem *btnGreen = [[UIBarButtonItem alloc] initWithTitle:@"Green" style:UIBarButtonItemStyleDone target:self action:@selector(btnGreenTouched)]; self.toolbarItems = [NSArray arrayWithObjects:btnRed, btnBlue, spacer, btnGreen, nil]; } return self; } 17
  • 18. 18/82 What did we do?What did we do?• We add a UIBarButtonSystemItemSearch button to the navigationItem’s rightBarButtonItems array. • This button will be placed at the right of the top navigation bar. Next, we set up three bar buttons (btnRed, btnBlue, and btnGreen) and a spacer. • The three buttons each have a selector, these will be defined shortly. Each also is initialized with a title, and a style of UIBarButtonItemStyleDone, which will produce a button with a blue background and white bolded text. 18
  • 19. 19/82 What did we do?What did we do? • The function of the spacer is to add “flexible space” between btnBlue and btnGreen. • Flexible space will act as a “spring” between the two buttons, pushing btnGreen all the way to the right of the tool bar. • Since this space is invisible, it makes no sense to assign it an action method, so we have set both the target and action of this object to nil. 19
  • 20. 20/82 What did we do?What did we do? • Now that we have the buttons, we need to add them to the tool bar. • Each view controller has it’s own toolBarItems property, which is an NSArray of UIBarButtonItem objects. • We stuffed the toolBarButtons array with the three buttons and the spacer. 20
  • 21. 21/82 Add to: MainViewController.mAdd to: MainViewController.m • The last step… • Implement the four methods we set as actions in the buttons as shown in the code on the next slide. 21
  • 22. 22/82 - (void)toggleToolBar { BOOL barState = self.navigationController.toolbarHidden; [self.navigationController setToolbarHidden:!barState animated:YES]; } - (void)btnRedTouched { self.view.backgroundColor = [UIColor redColor]; } - (void)btnBlueTouched { self.view.backgroundColor = [UIColor cyanColor]; } - (void)btnGreenTouched { self.view.backgroundColor = [UIColor greenColor]; } 22
  • 23. 23/82 What did we do?What did we do? • toggleToolBar gets the hidden property of the tool bar, then sets that property to its negation. In other words, if the tool bar is hidden it will be shown, if it is shown it will be hidden. • The three btn…Touched methods set the color of the view’s background to red, cyan, or green when they are touched. 23
  • 25. 25/82 ThankThank You !!!You !!! For More Information click below link: Follow Us on: http://vibranttechnologies.co.in/ios-classes-in-mumbai.html