SlideShare une entreprise Scribd logo
1  sur  61
Télécharger pour lire hors ligne
Mastering Interface Builder
— Or how to stop cursing and love IB —
Dimitri Dupuis-Latour — @dupuislatour
Once Upon a Time
A brief History of IB
Interface Builder
1986
IB History
A Brief Story of Time…
2001
Mac OS X
1986
NeXT
2008
iPhone SDK
Modern IB History
A Dramatic Acceleration of Features
2011
iOS 5
AutoLayout(OSX)
Storyboards
Segue
2010
iOS 4
Xcode Integration
All-in-one window
2014
iOS 8
IBDesignable
IBInspectable
Size Classes
Custom Fonts
Localisation
2013
iOS 7
New AutoLayout
iOS7 makeover
Asset Catalogs
2012
iOS 6
AutoLayout(iOS)
Don’t use IB like your Grandfather !
It’s 2015
Agenda
Storyboards
TableView Controllers
Static TableViews
Unwind Segue
Custom Segue Icon Font
Vector artwork
Secret shortcuts
Storyboards
More than just a meta XIB
Storyboard
Storyboard
• Bird’s eye view
• Visual way describe workflow
• Communication Tool
• Living Documentation
Not Approved
• Split by Feature / Tab / Unit of workflow

(eg: Login, Creation)
Split Your Storyboards !
No « One Storyboard to Rule Them All »
// STORYBOARD - Instantiate from code
let storyboard = UIStoryboard(name:"LoginScreens", bundle:nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("MyCustomVC")
as MyCustomVC
• Chain your screens in IB
• Takes out the simpler .push() .presentViewController(),
didSelectRowAtIndexPath()
• Handle the more complex ones in

- prepareForSegue: (iOS)

- contextForSegue: (WatchKit, iOS 9 ?)
Build Navigation Hierarchy in IB
• Design / communication tool
• Split them
• Removes some push() / present() code
• best feature…
Storyboards : Recap
More than just a meta XIB
TableView Controller
More than just a TableView + a Controller
• TableView Controllers = awesome
• TableView Controllers + Storyboard = Even Better !
TableView Controller
• Common setup for free:

.delegate, .datasource, autoresizingMasks, editButton…
• Design your cell directly in the tableView

No more extra xib just for a cell

No more registerCell / registerClass
• Pull-to-Refresh for (almost) free
• Keyboard handling for free:

Textfield at bottom of a form : will scroll up automagically
TableViewController
Whether in a XIB or Storyboard
• Table-View like layout

with known number of items
• Good examples:

- Settings Screen

- Detail View of a List View
Static TableView Cells
Only within a Storyboard
Static TableView Cells
Only within a Storyboard
• No dequeing
• No delegate to implement
• Directly set the number of cells & sections

header/footer section title, etc…
• Outlet directly to a cell or a cell subview
• Mix static and dynamic cells

Implement delegates and call [super ] for static rows
Static TableView Cells
Only within a Storyboard
Unwind Segue
Push-pop-dismiss : sooo 2011
What are Unwind Segue ?
Auto-rewind to a specific screen
A B C D
E F G
Submit
navController.pop().pop()
presentingController.dismiss()
presentingController.navController.pop().pop().pop()
Problem 1: hardcoding Hierarchy in code
=> write custom @protocols
=> Store global variable / Singleton
Problem 2: passing data back to A
A B C D
E F G
Submit
A B C D
E F G
Submit
@IBAction func unwindTo###
@IBAction func unwindToMyScreenA(segue: UIStoryboardSegue) {}
Step 1
A B C D
E F G
Submit
a) manually (eg: immediate action)
b) programmatically (eg: deferred action)Step 2
@IBAction func unwindToMyScreenA(segue: UIStoryboardSegue) {}
A B C D
E F G
Submit
Step 2a - Manually
@IBAction func unwindToMyScreenA(segue: UIStoryboardSegue) {}
• Create a manual segue
• ctrl-drag from File's Owner (VC) to Exit
• choose Manual Segue
• Select it in the outline view
• Give it an Identifier "backToAPlease"
• Call it from Code
Step 2b - Programmatically
self.performSegueWithIdentifier("backToAPlease", sender:nil)
File's Owner Exit
• "Unwind" the navigation stack
• Including through push, modal, popover, tabs, etc…
• Passes data back (replacing custom @protocols)
• Less code
Unwind Segue : Recap
Custom Segue
Go beyond push and modal
• Step 1) Select
• Step 2) Set your class
• Step 3) Enjoy !
Setup a Custom Segue
3DFlip Segue
github.com/GlennChiu/
GC3DFlipTransitionStyleSegue
Fold Segue
https://github.com/mpospese/
MPFoldTransition
DoorwaySegue
github.com/jsmecham/DoorwaySegue
• Create your own transitions by subclassing
UIStoryBoardSegue
• Componentize transistions in reusable blocks
• Share and reuse them !
Custom Segue : Recap
Go beyond push & pop
Icon Font
Vector artwork, everywhere
Stop Using PNGs,
Start using Vector Icons
with Icon Fonts
FontAwesome
479 icons. 86 Ko.
IonIcon
733 icons. 180 Ko. iOS7 style
Google
Material
Design
Custom Font
Make Your Own !
• Vector !
• Light
• Change color, size, state, shadows… on the fly
• Works on the Web & Android too !
• No need for 3 resolutions for each icon
Advantages
Resolution Hell
Retina
Retina HD
Normal
Android : 2 more sizes !
Handle all color, size, state
Record
Recording…
recorded: Today, 7:00pm
Enregistrement #1
recorded: Today, 7:00pm
Enregistrement #1
2x 3x1x
• Use directly
• in IB
• in Code (NSAttributedString)
• Use a helper framework :
• FontAwesomeKit (iOS)
• Iconify (Android)
Helper Frameworks
New in Interface
Builder 6
• iOS library to ease FontAwesome Integration
• pod ‘FontAwesomeKit’
• Create / Modify / Stack icons from code
• Generates UIImage or NSAttributedString
• Bundles 4 popular Icon Fonts (1594 icons, 380Ko)
FontAwesomeKit
github.com/PrideChung/FontAwesomeKit
Example: Attributed Text
Nom Prénom
Paris, France
⋆ ⋆ ⋆ ⋆ ⋆ 10 reviews
@IBOutlet private weak var locationLabel: UILabel!
// …
let icon = FAKFontAwesome.locationArrowIconWithSize(30)
locationLabel.attributedText = icon.attributedString()
Example: Attributed Text
Nom Prénom
Paris, France
⋆ ⋆ ⋆ ⋆ ⋆ 4,5
@IBOutlet private weak var userPicture: UIImageView!
// …
let icon = FAKFontAwesome.userIconWithSize(30)
icon.addAttribute(NSForegroundColorAttributeName, value:UIColor.lightGrayColor())
userPicture.image = icon.imageWithSize(CGSize(width: 44, height: 44))
userPicture.layer.borderColor = UIColor.darkGrayColor().CGColor
userPicture.layer.borderWidth = 1
userPicture.layer.cornerRadius = 22
Example: User Picture Placeholder
Nom Prénom
Paris 9ème
⋆ ⋆ ⋆ ⋆ ⋆ 4,5
Example: Stacked Icons
// No Photos please !
let icons = [
FAKFontAwesome.photoIconWithSize(30),
FAKFontAwesome.banIconWithSize(30)
]
let noPhotosPlease = UIImage(stackedIcons:icons,
imageSize:CGSizeMake(30, 30))
• Great to centralize your assets, across your properties

(website, iOS app, android app)
• Desktop Tools (Glyphs.app, FontLab…)
• Online Tools (icomoon.io, prototypo.io…)
• Check thenounproject.com
Creating your own Font Icons
The Noun Project
Google Image for Icons
— Joan Zapata, Creator of Iconify Library
« If, like me, you're tired of copying 3 images (@1x, @2x, @3x)
for each icon you want to use in your app, for each color you
want to use them with, and bang your head on the wall when
you suddenly need to change their color or size, then I think
Icon Font can help you. »
Icon Fonts: One-sentence Summary
One More Thing
Keybord Shortcuts
Click Through Views
+ctrl + click⏏
shift
Measure distances
⌥
alt + mouse over
! Insert Emoji "
Or any symbol really© ✔
+ctrl + space⌘
cmd
println("⛔ Found Error: ")
println("⚠ Warning: ")
println("✅ All Good: ")
Recap
Storyboards
TableView Controllers
Static TableViews
Unwind Segue
Custom Segue Icon Font
Vector artwork
Secret shortcuts
Dimitri Dupuis-Latour @dupuislatour
Thank You !

Contenu connexe

En vedette

JS Skills: From Novice to Guru
JS Skills: From Novice to GuruJS Skills: From Novice to Guru
JS Skills: From Novice to Gurujivkopetiov
 
PechaKucha - "Siri, start presentation 'HomeKit'"
PechaKucha - "Siri, start presentation 'HomeKit'"PechaKucha - "Siri, start presentation 'HomeKit'"
PechaKucha - "Siri, start presentation 'HomeKit'"marcofolio
 
Organization Performance at Accenture
Organization Performance at AccentureOrganization Performance at Accenture
Organization Performance at AccentureFrancesco Serio
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript Rohit Bishnoi
 
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
 
Digital in Retail - Burwood Council - Social Media - Jo-Jo Burke
Digital in Retail - Burwood Council - Social Media - Jo-Jo BurkeDigital in Retail - Burwood Council - Social Media - Jo-Jo Burke
Digital in Retail - Burwood Council - Social Media - Jo-Jo BurkeMarketing Success
 
Introduce Angular2 & render & firebase flow
Introduce Angular2 & render & firebase flowIntroduce Angular2 & render & firebase flow
Introduce Angular2 & render & firebase flowCaesar Chi
 
Morden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web AppsMorden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web AppsCaesar Chi
 
Architecture mobile
Architecture mobileArchitecture mobile
Architecture mobilePatrice Cote
 

En vedette (11)

JS Skills: From Novice to Guru
JS Skills: From Novice to GuruJS Skills: From Novice to Guru
JS Skills: From Novice to Guru
 
What's new in C# 6?
What's new in C# 6?What's new in C# 6?
What's new in C# 6?
 
Title sequence 2
Title sequence 2Title sequence 2
Title sequence 2
 
PechaKucha - "Siri, start presentation 'HomeKit'"
PechaKucha - "Siri, start presentation 'HomeKit'"PechaKucha - "Siri, start presentation 'HomeKit'"
PechaKucha - "Siri, start presentation 'HomeKit'"
 
Organization Performance at Accenture
Organization Performance at AccentureOrganization Performance at Accenture
Organization Performance at Accenture
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
 
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
 
Digital in Retail - Burwood Council - Social Media - Jo-Jo Burke
Digital in Retail - Burwood Council - Social Media - Jo-Jo BurkeDigital in Retail - Burwood Council - Social Media - Jo-Jo Burke
Digital in Retail - Burwood Council - Social Media - Jo-Jo Burke
 
Introduce Angular2 & render & firebase flow
Introduce Angular2 & render & firebase flowIntroduce Angular2 & render & firebase flow
Introduce Angular2 & render & firebase flow
 
Morden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web AppsMorden F2E Education - Think of Progressive Web Apps
Morden F2E Education - Think of Progressive Web Apps
 
Architecture mobile
Architecture mobileArchitecture mobile
Architecture mobile
 

Plus de Istanbul Tech Talks

ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...Istanbul Tech Talks
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleIstanbul Tech Talks
 
ITT 2015 - Ash Furrow - Lessons from Production Swift
ITT 2015 - Ash Furrow - Lessons from Production SwiftITT 2015 - Ash Furrow - Lessons from Production Swift
ITT 2015 - Ash Furrow - Lessons from Production SwiftIstanbul Tech Talks
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingIstanbul Tech Talks
 
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloudITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloudIstanbul Tech Talks
 
ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...
ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...
ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...Istanbul Tech Talks
 
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?Istanbul Tech Talks
 
ITT 2014 - Mario Zechner - Libgdx 101
ITT 2014 - Mario Zechner - Libgdx 101ITT 2014 - Mario Zechner - Libgdx 101
ITT 2014 - Mario Zechner - Libgdx 101Istanbul Tech Talks
 
ITT 2014 - Orta Therox- Mobile and the Art World
ITT 2014 - Orta Therox- Mobile and the Art WorldITT 2014 - Orta Therox- Mobile and the Art World
ITT 2014 - Orta Therox- Mobile and the Art WorldIstanbul Tech Talks
 
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVMITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVMIstanbul Tech Talks
 
ITT 2014 - Peter Steinberger - Architecting Modular Codebases
ITT 2014 - Peter Steinberger - Architecting Modular CodebasesITT 2014 - Peter Steinberger - Architecting Modular Codebases
ITT 2014 - Peter Steinberger - Architecting Modular CodebasesIstanbul Tech Talks
 
ITT 2014 - Max Seelemann - Hello TextKit!
ITT 2014 - Max Seelemann - Hello TextKit!ITT 2014 - Max Seelemann - Hello TextKit!
ITT 2014 - Max Seelemann - Hello TextKit!Istanbul Tech Talks
 
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...Istanbul Tech Talks
 
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingIstanbul Tech Talks
 
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingIstanbul Tech Talks
 
ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0Istanbul Tech Talks
 

Plus de Istanbul Tech Talks (16)

ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
ITT 2015 - Kirk Pepperdine - The (not so) Dark Art of Performance Tuning, fro...
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
 
ITT 2015 - Ash Furrow - Lessons from Production Swift
ITT 2015 - Ash Furrow - Lessons from Production SwiftITT 2015 - Ash Furrow - Lessons from Production Swift
ITT 2015 - Ash Furrow - Lessons from Production Swift
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function Programming
 
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloudITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
ITT 2015 - Vincent Garrigues - Continuous Integration at SoundCloud
 
ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...
ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...
ITT 2015 - Simon Tennant - Your App Just Got Social: Adding Messaging to Your...
 
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
ITT 2015 - Hugo Domenech-Juarez - What's All That Hype About BLE?
 
ITT 2014 - Mario Zechner - Libgdx 101
ITT 2014 - Mario Zechner - Libgdx 101ITT 2014 - Mario Zechner - Libgdx 101
ITT 2014 - Mario Zechner - Libgdx 101
 
ITT 2014 - Orta Therox- Mobile and the Art World
ITT 2014 - Orta Therox- Mobile and the Art WorldITT 2014 - Orta Therox- Mobile and the Art World
ITT 2014 - Orta Therox- Mobile and the Art World
 
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVMITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
ITT 2014 - Niklas Therning - Truly Native Java Apps on iOS with RoboVM
 
ITT 2014 - Peter Steinberger - Architecting Modular Codebases
ITT 2014 - Peter Steinberger - Architecting Modular CodebasesITT 2014 - Peter Steinberger - Architecting Modular Codebases
ITT 2014 - Peter Steinberger - Architecting Modular Codebases
 
ITT 2014 - Max Seelemann - Hello TextKit!
ITT 2014 - Max Seelemann - Hello TextKit!ITT 2014 - Max Seelemann - Hello TextKit!
ITT 2014 - Max Seelemann - Hello TextKit!
 
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
ITT 2014 - Eric Lafortune - ProGuard, Optimizer and Obfuscator in the Android...
 
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better NetworkingITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
ITT 2014 - Erik Hellmann - Android Programming - Smarter and Better Networking
 
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
 
ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0
 

Dernier

8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 

Dernier (20)

young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 

ITT 2015 - Dimitri Dupuis-Latour - Mastering Interface Builder

  • 1. Mastering Interface Builder — Or how to stop cursing and love IB — Dimitri Dupuis-Latour — @dupuislatour
  • 2. Once Upon a Time A brief History of IB
  • 4. IB History A Brief Story of Time… 2001 Mac OS X 1986 NeXT 2008 iPhone SDK
  • 5. Modern IB History A Dramatic Acceleration of Features 2011 iOS 5 AutoLayout(OSX) Storyboards Segue 2010 iOS 4 Xcode Integration All-in-one window 2014 iOS 8 IBDesignable IBInspectable Size Classes Custom Fonts Localisation 2013 iOS 7 New AutoLayout iOS7 makeover Asset Catalogs 2012 iOS 6 AutoLayout(iOS)
  • 6. Don’t use IB like your Grandfather ! It’s 2015
  • 7. Agenda Storyboards TableView Controllers Static TableViews Unwind Segue Custom Segue Icon Font Vector artwork Secret shortcuts
  • 10. Storyboard • Bird’s eye view • Visual way describe workflow • Communication Tool • Living Documentation
  • 12. • Split by Feature / Tab / Unit of workflow
 (eg: Login, Creation) Split Your Storyboards ! No « One Storyboard to Rule Them All » // STORYBOARD - Instantiate from code let storyboard = UIStoryboard(name:"LoginScreens", bundle:nil) let vc = storyboard.instantiateViewControllerWithIdentifier("MyCustomVC") as MyCustomVC
  • 13. • Chain your screens in IB • Takes out the simpler .push() .presentViewController(), didSelectRowAtIndexPath() • Handle the more complex ones in
 - prepareForSegue: (iOS)
 - contextForSegue: (WatchKit, iOS 9 ?) Build Navigation Hierarchy in IB
  • 14. • Design / communication tool • Split them • Removes some push() / present() code • best feature… Storyboards : Recap More than just a meta XIB
  • 15. TableView Controller More than just a TableView + a Controller
  • 16. • TableView Controllers = awesome • TableView Controllers + Storyboard = Even Better ! TableView Controller
  • 17. • Common setup for free:
 .delegate, .datasource, autoresizingMasks, editButton… • Design your cell directly in the tableView
 No more extra xib just for a cell
 No more registerCell / registerClass • Pull-to-Refresh for (almost) free • Keyboard handling for free:
 Textfield at bottom of a form : will scroll up automagically TableViewController Whether in a XIB or Storyboard
  • 18. • Table-View like layout
 with known number of items • Good examples:
 - Settings Screen
 - Detail View of a List View Static TableView Cells Only within a Storyboard
  • 19. Static TableView Cells Only within a Storyboard
  • 20. • No dequeing • No delegate to implement • Directly set the number of cells & sections
 header/footer section title, etc… • Outlet directly to a cell or a cell subview • Mix static and dynamic cells
 Implement delegates and call [super ] for static rows Static TableView Cells Only within a Storyboard
  • 22. What are Unwind Segue ? Auto-rewind to a specific screen
  • 23. A B C D E F G Submit navController.pop().pop() presentingController.dismiss() presentingController.navController.pop().pop().pop() Problem 1: hardcoding Hierarchy in code
  • 24. => write custom @protocols => Store global variable / Singleton Problem 2: passing data back to A A B C D E F G Submit
  • 25. A B C D E F G Submit @IBAction func unwindTo### @IBAction func unwindToMyScreenA(segue: UIStoryboardSegue) {} Step 1
  • 26. A B C D E F G Submit a) manually (eg: immediate action) b) programmatically (eg: deferred action)Step 2 @IBAction func unwindToMyScreenA(segue: UIStoryboardSegue) {}
  • 27. A B C D E F G Submit Step 2a - Manually @IBAction func unwindToMyScreenA(segue: UIStoryboardSegue) {}
  • 28. • Create a manual segue • ctrl-drag from File's Owner (VC) to Exit • choose Manual Segue • Select it in the outline view • Give it an Identifier "backToAPlease" • Call it from Code Step 2b - Programmatically self.performSegueWithIdentifier("backToAPlease", sender:nil) File's Owner Exit
  • 29. • "Unwind" the navigation stack • Including through push, modal, popover, tabs, etc… • Passes data back (replacing custom @protocols) • Less code Unwind Segue : Recap
  • 30. Custom Segue Go beyond push and modal
  • 31. • Step 1) Select • Step 2) Set your class • Step 3) Enjoy ! Setup a Custom Segue
  • 35. • Create your own transitions by subclassing UIStoryBoardSegue • Componentize transistions in reusable blocks • Share and reuse them ! Custom Segue : Recap Go beyond push & pop
  • 37. Stop Using PNGs, Start using Vector Icons with Icon Fonts
  • 39. IonIcon 733 icons. 180 Ko. iOS7 style
  • 42. • Vector ! • Light • Change color, size, state, shadows… on the fly • Works on the Web & Android too ! • No need for 3 resolutions for each icon Advantages
  • 44. Android : 2 more sizes !
  • 45. Handle all color, size, state Record Recording… recorded: Today, 7:00pm Enregistrement #1 recorded: Today, 7:00pm Enregistrement #1 2x 3x1x
  • 46. • Use directly • in IB • in Code (NSAttributedString) • Use a helper framework : • FontAwesomeKit (iOS) • Iconify (Android) Helper Frameworks New in Interface Builder 6
  • 47. • iOS library to ease FontAwesome Integration • pod ‘FontAwesomeKit’ • Create / Modify / Stack icons from code • Generates UIImage or NSAttributedString • Bundles 4 popular Icon Fonts (1594 icons, 380Ko) FontAwesomeKit github.com/PrideChung/FontAwesomeKit
  • 48. Example: Attributed Text Nom Prénom Paris, France ⋆ ⋆ ⋆ ⋆ ⋆ 10 reviews
  • 49. @IBOutlet private weak var locationLabel: UILabel! // … let icon = FAKFontAwesome.locationArrowIconWithSize(30) locationLabel.attributedText = icon.attributedString() Example: Attributed Text Nom Prénom Paris, France ⋆ ⋆ ⋆ ⋆ ⋆ 4,5
  • 50. @IBOutlet private weak var userPicture: UIImageView! // … let icon = FAKFontAwesome.userIconWithSize(30) icon.addAttribute(NSForegroundColorAttributeName, value:UIColor.lightGrayColor()) userPicture.image = icon.imageWithSize(CGSize(width: 44, height: 44)) userPicture.layer.borderColor = UIColor.darkGrayColor().CGColor userPicture.layer.borderWidth = 1 userPicture.layer.cornerRadius = 22 Example: User Picture Placeholder Nom Prénom Paris 9ème ⋆ ⋆ ⋆ ⋆ ⋆ 4,5
  • 51. Example: Stacked Icons // No Photos please ! let icons = [ FAKFontAwesome.photoIconWithSize(30), FAKFontAwesome.banIconWithSize(30) ] let noPhotosPlease = UIImage(stackedIcons:icons, imageSize:CGSizeMake(30, 30))
  • 52. • Great to centralize your assets, across your properties
 (website, iOS app, android app) • Desktop Tools (Glyphs.app, FontLab…) • Online Tools (icomoon.io, prototypo.io…) • Check thenounproject.com Creating your own Font Icons
  • 53. The Noun Project Google Image for Icons
  • 54. — Joan Zapata, Creator of Iconify Library « If, like me, you're tired of copying 3 images (@1x, @2x, @3x) for each icon you want to use in your app, for each color you want to use them with, and bang your head on the wall when you suddenly need to change their color or size, then I think Icon Font can help you. » Icon Fonts: One-sentence Summary
  • 56. Click Through Views +ctrl + click⏏ shift
  • 58. ! Insert Emoji " Or any symbol really© ✔ +ctrl + space⌘ cmd println("⛔ Found Error: ") println("⚠ Warning: ") println("✅ All Good: ")
  • 59. Recap Storyboards TableView Controllers Static TableViews Unwind Segue Custom Segue Icon Font Vector artwork Secret shortcuts
  • 60.