This document discusses iOS application development with navigation and tab bar controllers. It begins with an introduction to navigation controllers and how they manage a stack of view controllers. It discusses the anatomy of navigation bars and how to customize navigation bar appearance. It also covers understanding application data flow and best practices. The document then discusses toolbars, their anatomy and customization. It covers creating tab bar interfaces with storyboards or programmatically. It discusses customizing tab bar items and badges. Overall it provides a comprehensive overview of working with navigation and tab bar controllers in iOS applications.
18 Invaluable Lessons About ADF-JSF InteractionSteven Davelaar
While coaching ADF development teams over the years, Steven has noticed that many developers lack a thorough understanding of the JSF lifecycle and how ADF optimizes this lifecycle in specific situations. As a result ADF developers who are tasked to build a seemingly simple ADF page, get extremely frustrated by the -in their eyes- unexpected or unlogical behavior of ADF.
Using simple examples, this presentation teaches you step-by-step 18 invaluable lessons which will greatly enhance your insight in how ADF and JSF work together under the covers. With this knowledge you will build your pages quicker and better, while avoiding some common mistakes.
The following slides summarize and curate most of the knowledge and patterns gathered to date on Node error handling.
Without clear understanding and strategy, Node error handling might be the Achilles heel of your app – its unique single-threaded execution model and loose types raise challenges that don’t exist in any other frameworks. Node by itself doesn’t provide patterns for critical paths like where to put error handling code, even worst it suggest patterns that were rejected by the community like passing errors in callbacks.
It covers topics like promises, generators, callbacks, unhandled exceptions, APM products, testing errors, operational errors vs development errors and much more
MVVM or Model - View - ViewModel is a design pattern aimed for modularising your code and build it on a Test Driven Development environment. When Apple's traditional MVC design pattern makes our controllers bulky and our unit tests painful, different design patterns such as MVVM, VIPER, MVP, etc come to our rescue. MVVM comes quite handy as it provides a loosely coupled mechanism between all components segregating your view, business and data logic.
Modernizing Adobe Experience Manager (AEM)Gabriel Walt
See the features that will allow you to most efficiently create engaging customer experiences with AEM Sites. Learn how to avoid waiting for long project work before starting to create content, and how the content can be styled iteratively later. Discover some strategies that will help you to modernize your existing project to leverage these time-saving features.
Learn about:
* Core Components – Create content efficiently by using out-of-the-box building blocks.
* Editable Templates – Manage templates and setup the Style System and the Responsive Layout.
* Content and Experience Fragments – Easily reuse content across pages and channels.
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.
Android의 Window와 WindowInsets에 대해서 알아봅니다. System UI 영역에 우리 앱을 draw하거나 풀스크린 모드로 화면을 구성 할 때, Display Cutout 대응 등 WindowInset이 활용되는 경우와 주의해야 할 점들에 대해 알아봅니다. Google 개발자 Chris Banes가 발표한 Becoming a master window fitters(Droidcon NYC 2017)를 기반으로 준비하였으며, 최신사항을 반영하였습니다.
A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module.
ngif
ngFor
If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.
One of the most challenging tasks when developing an ADF application is achieving a proper layout. Both
stretching components and the ones that don't stretch can make a developer's life into a nightmare. In this
session you will learn best practices for creating complex layouts with ADF Faces. You will see how to use the
various ADF Layout components and build the layout that you need.
https://youtu.be/_yLt_abcK2w
Angular is a TypeScript-based open-source front-end platform that makes it easy to build applications with in web/mobile/desktop. The major features of this framework such as declarative templates, dependency injection, end to end tooling, and many more other features are used to ease the development.
Angular 7 is a Javascript framework built around the concept of components, and more precisely, with the Web Components standard in mind. It was rewritten from scratch by the Angular team using Typescript (although we can use it with ES5, ES6, or Dart as well).
Angular 7 is a big change for us compared to 1.x. Because it is a completely different framework than 1.x, and is not backward-compatible. Angular 7 is written entirely in Typescript and meets the ECMAScript 6 specification
angular interview questions and answers, angular 7 interview questions and answers, angular interview question, angular interview questions and answers for experienced, angular 7 interview questions, angular 6 interview questions,
angular interview questions, angular 6 interview questions and answers, angular 2 interview questions, angular7, angular 5 interview questions, angular interview, angular 2 interview questions and answers, angular questions and answers
18 Invaluable Lessons About ADF-JSF InteractionSteven Davelaar
While coaching ADF development teams over the years, Steven has noticed that many developers lack a thorough understanding of the JSF lifecycle and how ADF optimizes this lifecycle in specific situations. As a result ADF developers who are tasked to build a seemingly simple ADF page, get extremely frustrated by the -in their eyes- unexpected or unlogical behavior of ADF.
Using simple examples, this presentation teaches you step-by-step 18 invaluable lessons which will greatly enhance your insight in how ADF and JSF work together under the covers. With this knowledge you will build your pages quicker and better, while avoiding some common mistakes.
The following slides summarize and curate most of the knowledge and patterns gathered to date on Node error handling.
Without clear understanding and strategy, Node error handling might be the Achilles heel of your app – its unique single-threaded execution model and loose types raise challenges that don’t exist in any other frameworks. Node by itself doesn’t provide patterns for critical paths like where to put error handling code, even worst it suggest patterns that were rejected by the community like passing errors in callbacks.
It covers topics like promises, generators, callbacks, unhandled exceptions, APM products, testing errors, operational errors vs development errors and much more
MVVM or Model - View - ViewModel is a design pattern aimed for modularising your code and build it on a Test Driven Development environment. When Apple's traditional MVC design pattern makes our controllers bulky and our unit tests painful, different design patterns such as MVVM, VIPER, MVP, etc come to our rescue. MVVM comes quite handy as it provides a loosely coupled mechanism between all components segregating your view, business and data logic.
Modernizing Adobe Experience Manager (AEM)Gabriel Walt
See the features that will allow you to most efficiently create engaging customer experiences with AEM Sites. Learn how to avoid waiting for long project work before starting to create content, and how the content can be styled iteratively later. Discover some strategies that will help you to modernize your existing project to leverage these time-saving features.
Learn about:
* Core Components – Create content efficiently by using out-of-the-box building blocks.
* Editable Templates – Manage templates and setup the Style System and the Responsive Layout.
* Content and Experience Fragments – Easily reuse content across pages and channels.
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.
Android의 Window와 WindowInsets에 대해서 알아봅니다. System UI 영역에 우리 앱을 draw하거나 풀스크린 모드로 화면을 구성 할 때, Display Cutout 대응 등 WindowInset이 활용되는 경우와 주의해야 할 점들에 대해 알아봅니다. Google 개발자 Chris Banes가 발표한 Becoming a master window fitters(Droidcon NYC 2017)를 기반으로 준비하였으며, 최신사항을 반영하였습니다.
A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module.
ngif
ngFor
If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.
One of the most challenging tasks when developing an ADF application is achieving a proper layout. Both
stretching components and the ones that don't stretch can make a developer's life into a nightmare. In this
session you will learn best practices for creating complex layouts with ADF Faces. You will see how to use the
various ADF Layout components and build the layout that you need.
https://youtu.be/_yLt_abcK2w
Angular is a TypeScript-based open-source front-end platform that makes it easy to build applications with in web/mobile/desktop. The major features of this framework such as declarative templates, dependency injection, end to end tooling, and many more other features are used to ease the development.
Angular 7 is a Javascript framework built around the concept of components, and more precisely, with the Web Components standard in mind. It was rewritten from scratch by the Angular team using Typescript (although we can use it with ES5, ES6, or Dart as well).
Angular 7 is a big change for us compared to 1.x. Because it is a completely different framework than 1.x, and is not backward-compatible. Angular 7 is written entirely in Typescript and meets the ECMAScript 6 specification
angular interview questions and answers, angular 7 interview questions and answers, angular interview question, angular interview questions and answers for experienced, angular 7 interview questions, angular 6 interview questions,
angular interview questions, angular 6 interview questions and answers, angular 2 interview questions, angular7, angular 5 interview questions, angular interview, angular 2 interview questions and answers, angular questions and answers
This presentation provides an overview of many of the user interface classes available for your use within UIKit, Apple's user interface framework for iOS.
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)Jonathan Engelsma
This lecture investigates iOS user interface essentials. In particular, we look at UINavigation Controllers, and UITableViews.
This lecture is part of a course intended to be an intensive and very compressed deep dive into iOS development in Swift. Visit the course web page to get copies of the course outline, lecture notes, sample code, etc.
Course website: http://www.themobilemontage.com/2015/05/12/ios-bootcamp-learning-to-create-awesome-apps-on-ios-using-swift/
YouTube Link to lecture: TBD
A webinar by Rameez Akram, Sitecore Commerce MVP on Extending Sitecore Experience Commerce 9 Business Tools for Sitecore User Group Bangalore on 4th November 2018
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
2. Working with Navigation and Tab Bar
These are confidential sessions - please refrain from streaming, blogging, or taking pictures
Session 13
Vu Tran Lam
IAD-2013
3. • iOS 7 app anatomy
• Navigation controllers introduction
• Understanding application data flow
• Working with navigation bar
• Working with toolbar
• Tab bar controllers introduction
• Customizing tab bar appearance
• Working with tab bar
• Combining navigation and tab bar controller
Today’s Topics
4. • UI elements provided by UIKit fall into four broad categories:
• Bars
• Content views
• Controls
• Temporary views
iOS App Anatomy
7. • A navigation controller manages a stack of view controllers to
provide a drill-down interface for hierarchical content.
• The view hierarchy of a navigation controller is self contained. It is
composed of views that the navigation controller manages directly
and views that are managed by content view controllers you
provide.
• Each content view controller manages a distinct view hierarchy, and
the navigation controller coordinates the navigation between these
view hierarchies
Navigation Controller Introduction
12. • Presence
• A controller for each screen
• Connecting view controllers
• How not to share data
• Best practices for data flow
Understanding Application Data Flow
15. A Controller for Each Screen
List View
Controller
Detail View
Controller
16. • Multiple view controllers may need to share data
• One may need to know about what another is doing
• Watch for added, removed or edited data
• Other interesting events
Connecting View Controllers
17. • Global variables or singletons
• This includes your application delegate
• Direct dependencies make your code less reusable
• And more difficult to debug & test
How Not to Share Data
20. • Figure out exactly what needs to be communicated
• Define input parameters for your view controller
• For communicating back up the hierarchy, use loose coupling
• Define a generic interface for observers (like delegation)
Best Practices for Data Flow
22. • Navigation bar introduction
• Anatomy of navigation bar
• Customizing navigation bar appearance
• Creating navigation bar
Navigation Bar
23. • Navigation bars allow you to present your app’s content in an
organised and intuitive way.
• A navigation bar is displayed at the top of the screen, and contains
buttons for navigating through a hierarchy of screens.
• A navigation bar generally has a back button, a title, and a right
button.
• The most common way to use a navigation bar is with a navigation
controller.
Navigation Bar Introduction
24. • Navigate to the previous view
• Transition to a new view
Purpose
25. • Navigation bars are implemented in the UINavigationBar class
• Navigation items are implemented in the UINavigationItem class
• Bar button items are implemented in the UIBarButtonItem class
• Bar items are implemented in the UIBarItem class
Implementation
26. • A navigation bar is a view that manages the controls in a navigation
interface, and it takes on a special role when managed by a
navigation controller object.
• The structure of a navigation bar is similar to the structure of a
navigation controller in many ways.
• Like a navigation controller, a navigation bar is a container for
content that is provided by other objects.
Anatomy of Navigation Bar
27. Anatomy of Navigation Bar
View controller View controller
UINavigationItem UINavigationItem
UIBarButtonItem
Previous view controller Current view controller
navigationItem navigationItem
backBarButtonItem
rightBarButtonItem
title
28. • You can customize the appearance of a navigation bar by setting
the properties depicted below:
Customizing Navigation Bar Appearance
• When a navigation bar is used with a navigation controller, you
always use the setNavigationBarHidden:animated: method of
UINavigationController to show and hide the navigation bar.
• You must never hide navigation bar by modifying UINavigationBar
object’s hidden property directly.
29. • To customize the appearance of the navigation bar for a specific
view controller, modify the attributes of UINavigationItem object.
• You can get the navigation item for a view controller from its
navigationItem property.
Customizing Bar Buttons
30. Customizing Bar Buttons
• To customize the appearance of the navigation bar for a specific
view controller, modify the attributes of UINavigationItem object.
• You can get the navigation item for a view controller from its
navigationItem property.
31. Customizing Bar Buttons
• To customize the appearance of the navigation bar for a specific
view controller, modify the attributes of UINavigationItem object.
• You can get the navigation item for a view controller from its
navigationItem property.
32. Customizing Bar Buttons
• To customize the appearance of the navigation bar for a specific
view controller, modify the attributes of UINavigationItem object.
• You can get the navigation item for a view controller from its
navigationItem property.
33. • Creating a navigation bar using storyboard
• Creating a navigation bar programmatically
• Creating a navigation bar button programmatically
Creating Navigation Bar
34. • Drag a navigation controller from the library.
• Interface Builder creates a navigation controller and a view controller,
and it creates a relationship between them.
• Display it as the first view controller by selecting the option “Is Initial
View Controller” in the Attributes inspector.
Creating a Navigation Bar Using Storyboard
1
2
3
35. • Create the root view controller for the navigation object.
Creating a Navigation Bar Programmatically
1
UIViewController *myViewController = [[MyViewController alloc] init]
36. • Create root view controller for navigation object.
• Initializing initWithRootViewController: method (navigation
controller).
Creating a Navigation Bar Programmatically
1
2
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:myViewController];
37. • Create root view controller for navigation object.
• Initializing initWithRootViewController: method (navigation
controller).
• Set navigation controller as root view controller of your window.
Creating a Navigation Bar Programmatically
1
2
3
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.rootViewController = navigationController;
[window makeKeyAndVisible];
38. Creating a Navigation Bar Programmatically
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// Create the root view controller for the navigation object
UIViewController *myViewController = [[MyViewController alloc] init];
// Initializing navigation controller using initWithRootViewController: method
navigationController = [[UINavigationController alloc]
initWithRootViewController:myViewController];
!
// Set navigation controller as root view controller of your window
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.rootViewController = navigationController;
[window makeKeyAndVisible];
}
39. • Adding the right bar button
Creating a Navigation Bar Button
Programmatically
UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithTitle:@"Done"
style:UIBarButtonItemStyleBordered target:self action:@selector(addAction:)]
autorelease];
self.navigationItem.rightBarButtonItem = addButton;
42. • A toolbar usually appears at the bottom of a screen, and displays
one or more buttons called toolbar items.
• Generally, these buttons provide some sort of tool that is relevant to
the screen’s current content.
• A toolbar is often used in conjunction with a navigation controller,
which manages both the navigation bar and the toolbar.
Toolbar Introduction
43. • Select one of a set of performable actions within a given view
Purpose
44. • Toolbars are implemented in the UIToolbar class
• Navigation items are implemented in the UINavigationItem class
• Bar items are implemented in the UIBarItem class
Implementation
45. • A navigation interface can display a toolbar and populate it with
items provided by the currently visible view controller.
• The toolbar itself is managed by the navigation controller object.
• To configure a toolbar for your navigation interface, you must do the
following:
• Show the toolbar by setting the toolbarHidden property of the
navigation controller object to NO.
• Assign an array of UIBarButtonItem objects to the toolbarItem
property of each of your content view controllers.
Anatomy of Toolbar
47. • You can customize appearance of a toolbar by setting the
properties depicted below:
Customizing Navigation Bar Appearance
• To hide the toolbar, set hidesBottomBarWhenPushed property of
that view controller to YES.
48. • Creating a toolbar using storyboard
• Configuring a toolbar with a centered segmented control
Creating Toolbar
49. • Drag a toolbar from the library.
• Add two flexible space bar button items to the toolbar, by dragging
them from the library.
• Add a segmented control from the library, between the flexible
space bar buttons, by dragging it from the library.
Creating a Toolbar Using Storyboard
1
2
3
50. • Create flexible space button item for the toolbar
Creating a Toolbar Programmatically
1
UIBarButtonItem *flexibleSpaceButtonItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil
action:nil];
51. • Create flexible space button item for the toolbar
• Create and configure the segmented control
Creating a Toolbar Programmatically
1
2
UISegmentedControl *sortToggle = [[UISegmentedControl alloc] initWithItems:
[NSArray arrayWithObjects:@"Ascending", @"Descending", nil]];
sortToggle.segmentedControlStyle = UISegmentedControlStyleBar;
sortToggle.selectedSegmentIndex = 0;
[sortToggle addTarget:self action:@selector(toggleSorting:)
forControlEvents:UIControlEventValueChanged];
!
52. • Create flexible space button item for the toolbar
• Create and configure the segmented control
• Create the bar button item for the segmented control
Creating a Toolbar Programmatically
1
2
3
UIBarButtonItem *sortToggleButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:sortToggle]
53. • Create flexible space button item for the toolbar
• Create and configure the segmented control
• Create the bar button item for the segmented control
• Set our toolbar items
Creating a Toolbar Programmatically
1
2
3
self.toolbarItems = [NSArray arrayWithObjects:flexibleSpaceButtonItem,
sortToggleButtonItem,flexibleSpaceButtonItem, nil];
4
54. Creating a Toolbar Programmatically
- (void)configureToolbarItems
{
// Create flexible space button item for the toolbar.
UIBarButtonItem *flexibleSpaceButtonItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil
action:nil];
// Create and configure the segmented control
UISegmentedControl *sortToggle = [[UISegmentedControl alloc]
initWithItems:[NSArray arrayWithObjects:@"Ascending", @"Descending", nil]];
sortToggle.segmentedControlStyle = UISegmentedControlStyleBar;
sortToggle.selectedSegmentIndex = 0;
[sortToggle addTarget:self action:@selector(toggleSorting:)
forControlEvents:UIControlEventValueChanged];
// Create the bar button item for the segmented control
UIBarButtonItem *sortToggleButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:sortToggle];
// Set our toolbar items
self.toolbarItems = [NSArray arrayWithObjects:flexibleSpaceButtonItem,
sortToggleButtonItem,flexibleSpaceButtonItem, nil];
}
57. • A tab bar provides easy access to different views in an app. Use a
tab bar to organize information in your app by subtask.
• The most common way to use a tab bar is with a tab bar controller.
You can also use a tab bar as a standalone object in your app.
• The view hierarchy of a tab bar controller is self contained. It is
composed of views that the tab bar controller manages directly and
views that are managed by content view controllers you provide.
Tab Bar Controller Introduction
58. • Quickly navigate within an app
• Get an understanding of the app’s layout
Purpose
59. • Tab bars are implemented in the UITabBar class
• Tab bar items are implemented in the UITabBarItem class
Implementation
60. • The manager for a tab bar interface is a tab bar controller object.
• The tab bar controller creates and manages tab bar view and also
manages view controllers that provide content view for each mode.
• Each content view controller is designated as the view controller for
one of the tabs in the tab bar view.
• When a tab is tapped by the user, the tab bar controller object
selects the tab and displays the view associated with
corresponding content view controller.
Anatomy of Tab Bar
61. Anatomy of Tab Bar Interface
“Favorites”
bar
item
“Favorites”
view controller
Tab
bar
Tab
bar
tabBarItem
“Search”
view controller
“Featured”
view controller
Tab bar controller
NSArray
viewControllers
Tab
bar
tabBarItem
62. • You can customize appearance of a tab bar by setting the properties
depicted below:
Customizing Tab Bars Appearance
• UITabBarItem = Title + Image (System Item)
• Each view controller comes with a tab bar item for customizing
63. • Creating a tab bar interface using storyboard
• Creating a tab bar interface programmatically
• Creating a tab bar item programmatically
• Displaying more tab bar items
• Changing the tab’s badge
Working with Tab Bar
64. • Drag a tab bar controller from the library.
• Interface Builder creates a tab bar controller and two view
controllers, and it creates relationships between them.
• These relationships identify each of the newly created view
controllers as the view controller for one tab of the tab bar controller.
• Display it as the first view controller by selecting the option “Is Initial
View Controller” in the Attributes inspector
Creating a Tab Bar Interface Using Storyboard
1
2
3
4
65. • Create a new UITabBarController object
Creating a Tab Bar Interface Programmatically
tabBarController = [[UITabBarController alloc] init];
1
66. • Create a new UITabBarController object
• Create a content view controller for each tab
Creating a Tab Bar Interface Programmatically
MyViewController *vc1 = [[MyViewController alloc] init];
MyOtherViewController *vc2 = [[MyOtherViewController alloc] init];
1
2
67. • Create a new UITabBarController object
• Create a content view controller for each tab
• Add the view controllers to an array and assign that array to your
tab bar controller’s viewControllers property
Creating a Tab Bar Interface Programmatically
NSArray* controllers = [NSArray arrayWithObjects:vc1, vc2, nil];
tabBarController.viewControllers = controllers;
1
2
3
68. • Create a new UITabBarController object
• Create a content view controller for each tab
• Add the view controllers to an array and assign that array to your
tab bar controller’s viewControllers property
• Set the tab bar controller as the root view controller of your window
Creating a Tab Bar Interface Programmatically
window.rootViewController = tabBarController;
1
2
3
4
69. Creating a Tab Bar Interface Programmatically
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// Create a tab bar controller
tabBarController = [[UITabBarController alloc] init];
!
// Create content view controller for each tab
MyViewController *vc1 = [[MyViewController alloc] init];
MyOtherViewController *vc2 = [[MyOtherViewController alloc] init];
// Set the array of view controllers
NSArray* controllers = [NSArray arrayWithObjects:vc1, vc2, nil];
tabBarController.viewControllers = controllers;
// Add the tab bar controller’s view to the window
window.rootViewController = tabBarController;
}
70. • Custom item with title and image:
Creating a Tab Bar Item Programmatically
self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Footprints"
image:[UIImage imageNamed:@"footprints.png"] tag:0];
71. • Custom item with title and image:
• System item:
Creating a Tab Bar Item Programmatically
self.tabBarItem = [[UITabBarItem alloc]initWithTabBarSystemItem:
UITabBarSystemItemContacts tag:0];
72. • When there are more than four tab bar items, you must you More
view controller.
• If you use the storyboard to create tab bar items, Xcode will
automatically add More view controller in the tab bar.
• Purpose of More view controller:
• Choose more tab bar item
• Rearrange the tab bar item
Displaying More Tab Bar Items
76. • A badge is a small red marker displayed in the corner of the tab.
Inside the badge is some custom text that you provide.
• Typically, badges contain numerical values reflecting the number of
new items available on the tab, but you can also specify very short
character strings too.
Changing Tab’s Badge
NSString *value = self.badgeField.text;
self.tabBarItem.badgeValue = value;