SlideShare ist ein Scribd-Unternehmen logo
1 von 20
1
ADAPTIVE LAYOUTS
Presenter: Waseem Ahmad, Mindfire Solutions
Date: 17/05/2015
Today
Presenter: Waseem Ahmad, Mindfire Solutions
• Why do we need ADAPTIVE LAYOUTS?
• What is ADAPTIVE LAYOUTS?
• Size Classes.
• Choosing a Size Class in Interface Builder.
• Size Class, Demo.
• Other Adaptive Design Technologies
(TraitCollection).
• Trait Environment
• How to use Trait Environment?
What we had discussed…
•We had discussed AutoLayout in the last seminar.
•Autolayout is nothing just a rules (constrain) for defining UI.
•We need to put some rules on the views in their place no matter what bounds are
available. We call these rules “constraints”.
•Leading and trailing space, Horizontal space constraint, Equal widths constraint,
Aspect ratio constraint etc
• We also discussed how to manage constraints, add constraints, review & edit
existing constraints, remov constraints, Layout issues & conflicts, Misplaced views
warning, Missing constraint error.
Presenter: Waseem Ahmad, Mindfire Solutions
Why do we need ADAPTIVE
LAYOUTS?
•We can manage UI alignment using Autolayout. How UI component needs to do
adjust according to layout.
•What about rotation?
Sometimes rotating changes the geometry so drastically that autolayout is not
enough. You actually need to reposition the views to make them for properly.
Example:-
•iPhone Calculator Application. Landscape UI is different from Portrait UI.
Landscape have the buttons 10 across and 5 down versus in portrait have them 4
across and 5 down.
The Solution? Adaptive Layout.
Presenter: Waseem Ahmad, Mindfire Solutions
Presenter: Waseem Ahmad, Mindfire Solutions
What is ADAPTIVE LAYOUTS?
•Apple introduced Adaptive UI, a method of building apps that are based on the size
and characteristics of the container instead of targeting a particular device.
•Adaptive layouts which includes size classes, trait collections etc.
•We can now create a single layout, which works on all current iOS devices – without
crufty platform-specific code.
•Supporting any size display or orientation of a device allows us to create a great
user experience with our app.
Presenter: Waseem Ahmad, Mindfire Solutions
Size Classes
• A size class identifies a relative amount of display space for the height & width or
vertically & horizontally.
• Size class categories each dimension into two terms:-
• Regular
• Compact
•Our view controller always exists in a certain “size class” for width and height which
is either Regular or Compact.
• Because much of the layout of an app does not need to change for any available
screen size, there is an additional value, any.
Presenter: Waseem Ahmad, Mindfire Solutions
Size Classes
• iPhone, iPhone 6+ (Portrait)
Compact in Width, Regular in Height
•iPhone (Landscape)
Compact in Both Width and Height.
•But for the iPhone 6+ Portrait definition is same as non iPhone 6+ devices. In
landscape. It’s Compact in height and Regular in width.
•iPad always Regular in both dimension.
•An MVC that is the master in side by side split view will be Compact in Width and
Regular in Height.
Presenter: Waseem Ahmad, Mindfire Solutions
Size Classes
Presenter: Waseem Ahmad, Mindfire Solutions
Presenter: Waseem Ahmad, Mindfire Solutions
Size Classes using storyboard
- Start designing with any width and height size.
- Use Autolayout to design flexible UI.
- To design for more specific available areas, choose appropriate size classes.
- Override subviews and constraints for specific classes if needed. Example change
the font used to display text, and add, remove, or edit constraints etc.
- See preview how its layout appears on specific devices from within Xcode.
Presenter: Waseem Ahmad, Mindfire Solutions
Demo
• Size Class Demo
Presenter: Waseem Ahmad, Mindfire Solutions
Traits Collection
•Traits collection are properties to determine how to layout change of application as
environment change.
•Through it we can define
• Size class in both directions (Horizontally & Vertically)
• User interface idiom (iPhone or iPad)
• Display Scale (1, 2 or 3)
•All these properties wrapped inside one
container called the trait collection
(UITraitCollection)
Presenter: Waseem Ahmad, Mindfire Solutions
Trait Environment
•The iOS trait environment is exposed though the traitCollection property of the
UITraitEnvironment protocol.
This protocol is adopted by the following classes:
• UIScreen
• UIWindow
• UIViewController
• UIPresentationController
• UIView.
Presenter: Waseem Ahmad, Mindfire Solutions
Trait Environment
•To make your view controllers and views responsive to changes in the iOS interface
environment, override the traitCollectionDidChange: method from the trait
environment protocol.
-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection;
•To customize view controller animations in response to interface environment
changes, override the willTransitionToTraitCollection:withTransitionCoordinator:
method of the UIContentContainer protocol.
Presenter: Waseem Ahmad, Mindfire Solutions
Trait Environment
•We can create standalone trait collections to assist in matching against specific
environments. The UITraitCollection class includes four specialized constructors as
well as a constructor that lets you combine an array of trait collections,
traitCollectionWithTraitsFromCollections:.
+ (UITraitCollection *)traitCollectionWithUserInterfaceIdiom:(UIUserInterfaceIdiom)idiom;
•We can associate a trait collection with a UIImage instance by way of a
UIImageAsset instance or graphically using “Asset Catalog”.
Presenter: Waseem Ahmad, Mindfire Solutions
Demo
Presenter: Waseem Ahmad, Mindfire Solutions
References
- Apple WWDC 2013
- Apple WWDC 2014
- Apple Inc. “Autolayout Guide”.
- MATHEW SANDERS Blog http://mathewsanders.com/designing-adaptive-
layouts-for-iphone-6-plus/
- Standford Autolayout Demo “http://www.stanford.edu"
Presenter: Waseem Ahmad, Mindfire Solutions
Presenter: Waseem Ahmad, Mindfire Solutions
Question and Answer
Thank you
Presenter: Waseem Ahmad, Mindfire Solutions

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (12)

Django Models
Django ModelsDjango Models
Django Models
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Auto-Layout in iOS 7
Auto-Layout in iOS 7Auto-Layout in iOS 7
Auto-Layout in iOS 7
 
Génération de rapport avec Jasper Report
Génération de rapport avec Jasper ReportGénération de rapport avec Jasper Report
Génération de rapport avec Jasper Report
 
Autolayout
AutolayoutAutolayout
Autolayout
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReports
 
Advanced Jasper Reports
Advanced Jasper ReportsAdvanced Jasper Reports
Advanced Jasper Reports
 
Introduction to Jasper Reports
Introduction to Jasper ReportsIntroduction to Jasper Reports
Introduction to Jasper Reports
 
Japer Reports
Japer ReportsJaper Reports
Japer Reports
 

Ähnlich wie Adaptive Layout In iOS 8

Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveDesign Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveInductive Automation
 
Design guidelines for android developers
Design guidelines for android developersDesign guidelines for android developers
Design guidelines for android developersQandil Tariq
 
Common Project Mistakes: Visualization, Alarms, and Security
Common Project Mistakes: Visualization, Alarms, and SecurityCommon Project Mistakes: Visualization, Alarms, and Security
Common Project Mistakes: Visualization, Alarms, and SecurityInductive Automation
 
How to deal with Fragmentation on Android
How to deal with Fragmentation on AndroidHow to deal with Fragmentation on Android
How to deal with Fragmentation on AndroidSittiphol Phanvilai
 
Embedded Systems.pdf
Embedded Systems.pdfEmbedded Systems.pdf
Embedded Systems.pdfruvabebe
 
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentKevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentAxway Appcelerator
 
Is it possible to write cross-native apps in 2020 ?
Is it possible to write cross-native apps in 2020 ?Is it possible to write cross-native apps in 2020 ?
Is it possible to write cross-native apps in 2020 ?Chris Saez
 
Ch4 creating user interfaces
Ch4 creating user interfacesCh4 creating user interfaces
Ch4 creating user interfacesShih-Hsiang Lin
 
Win8 development lessons learned jayway
Win8 development lessons learned jaywayWin8 development lessons learned jayway
Win8 development lessons learned jaywayAndreas Hammar
 
1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterprise1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterpriseScott Simmons
 
Xamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupXamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupSeamgen
 
Neodes Uxd Profile 2012
Neodes Uxd Profile 2012Neodes Uxd Profile 2012
Neodes Uxd Profile 2012Amogh Chougule
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 
Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)
Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)
Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)Rosenfeld Media
 
Motion design in FIori
Motion design in FIoriMotion design in FIori
Motion design in FIoriRoman Rommel
 
Smarter HATS web application that automatically respond according to the scre...
Smarter HATS web application that automatically respond according to the scre...Smarter HATS web application that automatically respond according to the scre...
Smarter HATS web application that automatically respond according to the scre...Royal Cyber Inc.
 
Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...
Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...
Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...eG Innovations
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationVu Tran Lam
 

Ähnlich wie Adaptive Layout In iOS 8 (20)

Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveDesign Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
 
Design guidelines for android developers
Design guidelines for android developersDesign guidelines for android developers
Design guidelines for android developers
 
Common Project Mistakes: Visualization, Alarms, and Security
Common Project Mistakes: Visualization, Alarms, and SecurityCommon Project Mistakes: Visualization, Alarms, and Security
Common Project Mistakes: Visualization, Alarms, and Security
 
MVP Clean Architecture
MVP Clean  Architecture MVP Clean  Architecture
MVP Clean Architecture
 
How to deal with Fragmentation on Android
How to deal with Fragmentation on AndroidHow to deal with Fragmentation on Android
How to deal with Fragmentation on Android
 
Embedded Systems.pdf
Embedded Systems.pdfEmbedded Systems.pdf
Embedded Systems.pdf
 
Design Principles
Design PrinciplesDesign Principles
Design Principles
 
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentKevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
 
Is it possible to write cross-native apps in 2020 ?
Is it possible to write cross-native apps in 2020 ?Is it possible to write cross-native apps in 2020 ?
Is it possible to write cross-native apps in 2020 ?
 
Ch4 creating user interfaces
Ch4 creating user interfacesCh4 creating user interfaces
Ch4 creating user interfaces
 
Win8 development lessons learned jayway
Win8 development lessons learned jaywayWin8 development lessons learned jayway
Win8 development lessons learned jayway
 
1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterprise1221 raise expectations_for_the_ always_on_enterprise
1221 raise expectations_for_the_ always_on_enterprise
 
Xamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupXamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego Meetup
 
Neodes Uxd Profile 2012
Neodes Uxd Profile 2012Neodes Uxd Profile 2012
Neodes Uxd Profile 2012
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)
Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)
Resilient Enterprise Design (Craig Villamor at Enterprise UX 2017)
 
Motion design in FIori
Motion design in FIoriMotion design in FIori
Motion design in FIori
 
Smarter HATS web application that automatically respond according to the scre...
Smarter HATS web application that automatically respond according to the scre...Smarter HATS web application that automatically respond according to the scre...
Smarter HATS web application that automatically respond according to the scre...
 
Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...
Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...
Citrix Troubleshooting 101: How to Resolve and Prevent Business-Impacting Cit...
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
 

Mehr von Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 
Django-Queryset
Django-QuerysetDjango-Queryset
Django-Queryset
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Bower Fundamentals
Bower FundamentalsBower Fundamentals
Bower Fundamentals
 
Digesting jQuery
Digesting jQueryDigesting jQuery
Digesting jQuery
 
Django CMS & Integrating it with django shop
Django CMS & Integrating it with django shopDjango CMS & Integrating it with django shop
Django CMS & Integrating it with django shop
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
My SQL Replication and Scaling
My SQL Replication and ScalingMy SQL Replication and Scaling
My SQL Replication and Scaling
 

Kürzlich hochgeladen

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 

Kürzlich hochgeladen (20)

Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 

Adaptive Layout In iOS 8

  • 1. 1 ADAPTIVE LAYOUTS Presenter: Waseem Ahmad, Mindfire Solutions Date: 17/05/2015
  • 2. Today Presenter: Waseem Ahmad, Mindfire Solutions • Why do we need ADAPTIVE LAYOUTS? • What is ADAPTIVE LAYOUTS? • Size Classes. • Choosing a Size Class in Interface Builder. • Size Class, Demo. • Other Adaptive Design Technologies (TraitCollection). • Trait Environment • How to use Trait Environment?
  • 3. What we had discussed… •We had discussed AutoLayout in the last seminar. •Autolayout is nothing just a rules (constrain) for defining UI. •We need to put some rules on the views in their place no matter what bounds are available. We call these rules “constraints”. •Leading and trailing space, Horizontal space constraint, Equal widths constraint, Aspect ratio constraint etc • We also discussed how to manage constraints, add constraints, review & edit existing constraints, remov constraints, Layout issues & conflicts, Misplaced views warning, Missing constraint error. Presenter: Waseem Ahmad, Mindfire Solutions
  • 4. Why do we need ADAPTIVE LAYOUTS? •We can manage UI alignment using Autolayout. How UI component needs to do adjust according to layout. •What about rotation? Sometimes rotating changes the geometry so drastically that autolayout is not enough. You actually need to reposition the views to make them for properly. Example:- •iPhone Calculator Application. Landscape UI is different from Portrait UI. Landscape have the buttons 10 across and 5 down versus in portrait have them 4 across and 5 down. The Solution? Adaptive Layout. Presenter: Waseem Ahmad, Mindfire Solutions
  • 5. Presenter: Waseem Ahmad, Mindfire Solutions
  • 6. What is ADAPTIVE LAYOUTS? •Apple introduced Adaptive UI, a method of building apps that are based on the size and characteristics of the container instead of targeting a particular device. •Adaptive layouts which includes size classes, trait collections etc. •We can now create a single layout, which works on all current iOS devices – without crufty platform-specific code. •Supporting any size display or orientation of a device allows us to create a great user experience with our app. Presenter: Waseem Ahmad, Mindfire Solutions
  • 7. Size Classes • A size class identifies a relative amount of display space for the height & width or vertically & horizontally. • Size class categories each dimension into two terms:- • Regular • Compact •Our view controller always exists in a certain “size class” for width and height which is either Regular or Compact. • Because much of the layout of an app does not need to change for any available screen size, there is an additional value, any. Presenter: Waseem Ahmad, Mindfire Solutions
  • 8. Size Classes • iPhone, iPhone 6+ (Portrait) Compact in Width, Regular in Height •iPhone (Landscape) Compact in Both Width and Height. •But for the iPhone 6+ Portrait definition is same as non iPhone 6+ devices. In landscape. It’s Compact in height and Regular in width. •iPad always Regular in both dimension. •An MVC that is the master in side by side split view will be Compact in Width and Regular in Height. Presenter: Waseem Ahmad, Mindfire Solutions
  • 9. Size Classes Presenter: Waseem Ahmad, Mindfire Solutions
  • 10. Presenter: Waseem Ahmad, Mindfire Solutions
  • 11. Size Classes using storyboard - Start designing with any width and height size. - Use Autolayout to design flexible UI. - To design for more specific available areas, choose appropriate size classes. - Override subviews and constraints for specific classes if needed. Example change the font used to display text, and add, remove, or edit constraints etc. - See preview how its layout appears on specific devices from within Xcode. Presenter: Waseem Ahmad, Mindfire Solutions
  • 12. Demo • Size Class Demo Presenter: Waseem Ahmad, Mindfire Solutions
  • 13. Traits Collection •Traits collection are properties to determine how to layout change of application as environment change. •Through it we can define • Size class in both directions (Horizontally & Vertically) • User interface idiom (iPhone or iPad) • Display Scale (1, 2 or 3) •All these properties wrapped inside one container called the trait collection (UITraitCollection) Presenter: Waseem Ahmad, Mindfire Solutions
  • 14. Trait Environment •The iOS trait environment is exposed though the traitCollection property of the UITraitEnvironment protocol. This protocol is adopted by the following classes: • UIScreen • UIWindow • UIViewController • UIPresentationController • UIView. Presenter: Waseem Ahmad, Mindfire Solutions
  • 15. Trait Environment •To make your view controllers and views responsive to changes in the iOS interface environment, override the traitCollectionDidChange: method from the trait environment protocol. -(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection; •To customize view controller animations in response to interface environment changes, override the willTransitionToTraitCollection:withTransitionCoordinator: method of the UIContentContainer protocol. Presenter: Waseem Ahmad, Mindfire Solutions
  • 16. Trait Environment •We can create standalone trait collections to assist in matching against specific environments. The UITraitCollection class includes four specialized constructors as well as a constructor that lets you combine an array of trait collections, traitCollectionWithTraitsFromCollections:. + (UITraitCollection *)traitCollectionWithUserInterfaceIdiom:(UIUserInterfaceIdiom)idiom; •We can associate a trait collection with a UIImage instance by way of a UIImageAsset instance or graphically using “Asset Catalog”. Presenter: Waseem Ahmad, Mindfire Solutions
  • 17. Demo Presenter: Waseem Ahmad, Mindfire Solutions
  • 18. References - Apple WWDC 2013 - Apple WWDC 2014 - Apple Inc. “Autolayout Guide”. - MATHEW SANDERS Blog http://mathewsanders.com/designing-adaptive- layouts-for-iphone-6-plus/ - Standford Autolayout Demo “http://www.stanford.edu" Presenter: Waseem Ahmad, Mindfire Solutions
  • 19. Presenter: Waseem Ahmad, Mindfire Solutions Question and Answer
  • 20. Thank you Presenter: Waseem Ahmad, Mindfire Solutions