SlideShare a Scribd company logo
CocoaHeads
14 Mai 2013
mardi 28 mai 13
Backelite...
...recrute !mardi 28 mai 13
Au programme
• Accessors Vs Direct access to properties
• Design Pattern : Categories
• Design Pattern : Associative Storage
• La chaine Météo!
mardi 28 mai 13
iVar : Accessors/Direct access
• Performance ?
• Risks / Limits ?
mardi 28 mai 13
property Using setter (ms)
Using Direct Access
(ms)
strong + nonatomic 9 6
weak + nonatomic 30 30
unsafe_unretained +
nonatomic
0,8 0,2
strong + atomic 9 6
iPhone 3GS/iOS5 + 10,000 affectactions. (average based
on several tests.)
iVar : Accessors/Direct access
Performance?
mardi 28 mai 13
• Direct affectation don’t use the property
attributes (atomic)
• KVO/KVC needs accessors,
• Don’t use accessor methods in init methods
and dealloc (You may have override your
accessors)
iVar : Accessors/Direct access
Risk / Limits?
mardi 28 mai 13
Design Pattern: Categories
• Add new methods to existing classes
#import "IBSHelper.h"
@interface IBSHelper (FileName)
+ (NSString*)filenameForGeolocData;
+ (NSString*)filenameForBrandCodeData;
+ (NSString*)filenameForTradData;
+ (NSString *)currentLanguage;
+ (NSString *)currentLanguageForDownload;
+ (NSURL*)urlForGeolocData;
+ (NSURL*)urlForBrandData;
+ (NSURL*)urlForTradData;
@end
mardi 28 mai 13
Design Pattern: Categories
• Organize/split complexity
mardi 28 mai 13
Design Pattern: Categories
• Makes easy to support multiple OS versions
@interface UITableView (BkUICore)
- (void) bkRegisterNibName:(NSString *)nibName forCellReuseIdentifier:
(NSString *)identifier;
- (id) bkDequeueReusableCellWithIdentifier:(NSString *)identifier;
@end
@interface UIViewController (BkUICore)
- (void) bkDismissModalViewControllerAnimated:(BOOL)animated;
- (void) bkPresentViewController:(UIViewController *)controller
animated:(BOOL)animated;
@end
mardi 28 mai 13
Design Pattern: Categories
• Categories can be used to declare either instance
methods or class methods but are not usually
suitable for declaring additional properties.
One other design pattern can help us !
Associated storage
@interface UITableView (BkUICore)
- (void) bkRegisterNibName:(NSString *)nibName forCellReuseIdentifier:
(NSString *)identifier;
- (id) bkDequeueReusableCellWithIdentifier:(NSString *)identifier;
@end
mardi 28 mai 13
Design Pattern: Associative references
http://developer.apple.com/library/mac/#documentation/
Cocoa/Conceptual/ObjCRuntimeGuide/Introduction/
Introduction.html#//apple_ref/doc/uid/TP40008048
Objective-C programs interact with the runtime system at three distinct
levels: through Objective-C source code; through methods defined in the
NSObject class of the Foundation framework; and through direct calls to
runtime functions.
mardi 28 mai 13
Design Pattern: Associative references
//nsobjet.h
@interface NSObject
+ (Class)superclass;
+ (Class)class;
- (BOOL)respondsToSelector:(SEL)aSelector;
+ (BOOL)conformsToProtocol:(Protocol *)protocol;
//runtime.h
OBJC_EXPORT Class class_getSuperclass(Class cls)
OBJC_EXPORT Class object_getClass(id obj)
OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel)
OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol)
Some of the NSObject methods simply query the runtime system for information.
These methods allow objects to perform introspection.
mardi 28 mai 13
• A way to add simulate new properties to an
existing class !
Design Pattern: Associative references
static const char nibsAssocKey;
@implementation UITableView (BkUICore)
- (void) bkRegisterNibName:(NSString *)nibName forCellReuseIdentifier:(NSString
*)identifier
{
if ([self respondsToSelector:@selector(registerNib:forCellReuseIdentifier:)]) {
[self registerNib:[UINib nibWithNibName:nibName bundle:[NSBundle mainBundle]]
forCellReuseIdentifier:identifier]; //NS_AVAILABLE_IOS(5_0)
} else {
NSMutableDictionary *nibs = objc_getAssociatedObject(self, &nibsAssocKey);
if (nil == nibs) {
nibs = [NSMutableDictionary dictionary];
objc_setAssociatedObject(self, &nibsAssocKey,
nibs, OBJC_ASSOCIATION_RETAIN);
}
[nibs setValue:nibName forKey:identifier];
}
}
@end
mardi 28 mai 13
La chaine meteo
Issue : How to add a new property on UINavigationBar
• Subclass UINavigationBar, dumbass !
• Use associated storage !
mardi 28 mai 13
La chaine meteo
mardi 28 mai 13
Other examples
• UIView + BkBadge
• UIView + BkLoader
....
mardi 28 mai 13
Thanks
mardi 28 mai 13

More Related Content

What's hot

Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack command
Fabio Milano
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
CocoaHeads France
 
Node.js debugging
Node.js debuggingNode.js debugging
Node.js debugging
Nicholas McClay
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
Fabio Milano
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
Mudit Gupta
 
Cocoa pods
Cocoa podsCocoa pods
Cocoa pods
CocoaHeads France
 
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeatureBlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
CocoaHeads France
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
Teng Shiu Huang
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
eleksdev
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
Chris Cowan
 
Titanium - Making the most of your single thread
Titanium - Making the most of your single threadTitanium - Making the most of your single thread
Titanium - Making the most of your single thread
Ronald Treur
 
Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
Alessio Ricco
 
Deploying JHipster Microservices
Deploying JHipster MicroservicesDeploying JHipster Microservices
Deploying JHipster Microservices
Joe Kutner
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
Philip Langer
 
React Ecosystem
React EcosystemReact Ecosystem
React Ecosystem
Craig Jolicoeur
 
OSX Complex Application Challenge Architecture
OSX Complex Application Challenge ArchitectureOSX Complex Application Challenge Architecture
OSX Complex Application Challenge Architecture
CocoaHeads France
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
Christian Papauschek
 
Play framework
Play frameworkPlay framework
Play framework
sambaochung
 
Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...
Laurent Guérin
 
F5 Automation and service discovery
F5 Automation and service discoveryF5 Automation and service discovery
F5 Automation and service discovery
Scott van Kalken
 

What's hot (20)

Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack command
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
 
Node.js debugging
Node.js debuggingNode.js debugging
Node.js debugging
 
"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
 
Cocoa pods
Cocoa podsCocoa pods
Cocoa pods
 
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeatureBlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
BlaBlaCar et la mise en place d'une fonctionnalité FlagFeature
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Titanium - Making the most of your single thread
Titanium - Making the most of your single threadTitanium - Making the most of your single thread
Titanium - Making the most of your single thread
 
Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
 
Deploying JHipster Microservices
Deploying JHipster MicroservicesDeploying JHipster Microservices
Deploying JHipster Microservices
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
React Ecosystem
React EcosystemReact Ecosystem
React Ecosystem
 
OSX Complex Application Challenge Architecture
OSX Complex Application Challenge ArchitectureOSX Complex Application Challenge Architecture
OSX Complex Application Challenge Architecture
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
 
Play framework
Play frameworkPlay framework
Play framework
 
Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...Telosys tutorial - Code generation for a Python web application based on Bott...
Telosys tutorial - Code generation for a Python web application based on Bott...
 
F5 Automation and service discovery
F5 Automation and service discoveryF5 Automation and service discovery
F5 Automation and service discovery
 

Viewers also liked

CocoaHeads Rennes #14: iOS7 Controllers Transitions
 CocoaHeads Rennes #14: iOS7 Controllers Transitions CocoaHeads Rennes #14: iOS7 Controllers Transitions
CocoaHeads Rennes #14: iOS7 Controllers Transitions
CocoaHeadsRNS
 
Place it
Place itPlace it
Responsive design bookmarklet
Responsive design bookmarkletResponsive design bookmarklet
Responsive design bookmarklet
CocoaHeads France
 
CocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical RecordCocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical Record
CocoaHeadsRNS
 
Nm paginator
Nm paginatorNm paginator
Nm paginator
CocoaHeads France
 
Icon preview tool
Icon preview toolIcon preview tool
Icon preview tool
CocoaHeads France
 
Design: a necessary evil by Roderic Andrews
Design: a necessary evil by Roderic AndrewsDesign: a necessary evil by Roderic Andrews
Design: a necessary evil by Roderic Andrews
CocoaHeads France
 
CocoaHeads Rennes #14: Programmation Responsive par Celedev
CocoaHeads Rennes #14: Programmation Responsive par CeledevCocoaHeads Rennes #14: Programmation Responsive par Celedev
CocoaHeads Rennes #14: Programmation Responsive par Celedev
CocoaHeadsRNS
 
Présentation Raspberry Pi (cocoaheads remix)
Présentation Raspberry Pi (cocoaheads remix)Présentation Raspberry Pi (cocoaheads remix)
Présentation Raspberry Pi (cocoaheads remix)Arnaud Boudou
 
CocoaHeads Toulouse - Xcode et les tests - Epitez
CocoaHeads Toulouse - Xcode et les tests - EpitezCocoaHeads Toulouse - Xcode et les tests - Epitez
CocoaHeads Toulouse - Xcode et les tests - Epitez
CocoaHeads France
 

Viewers also liked (15)

Test flight
Test flightTest flight
Test flight
 
CocoaHeads Rennes #14: iOS7 Controllers Transitions
 CocoaHeads Rennes #14: iOS7 Controllers Transitions CocoaHeads Rennes #14: iOS7 Controllers Transitions
CocoaHeads Rennes #14: iOS7 Controllers Transitions
 
Place it
Place itPlace it
Place it
 
iTunes Stats
iTunes StatsiTunes Stats
iTunes Stats
 
Responsive design bookmarklet
Responsive design bookmarkletResponsive design bookmarklet
Responsive design bookmarklet
 
Drag & drop
Drag & dropDrag & drop
Drag & drop
 
Fail better
Fail betterFail better
Fail better
 
CocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical RecordCocoaHeads Rennes #13 : Magical Record
CocoaHeads Rennes #13 : Magical Record
 
Nm paginator
Nm paginatorNm paginator
Nm paginator
 
Icon preview tool
Icon preview toolIcon preview tool
Icon preview tool
 
Design: a necessary evil by Roderic Andrews
Design: a necessary evil by Roderic AndrewsDesign: a necessary evil by Roderic Andrews
Design: a necessary evil by Roderic Andrews
 
Ns operationqueue
Ns operationqueueNs operationqueue
Ns operationqueue
 
CocoaHeads Rennes #14: Programmation Responsive par Celedev
CocoaHeads Rennes #14: Programmation Responsive par CeledevCocoaHeads Rennes #14: Programmation Responsive par Celedev
CocoaHeads Rennes #14: Programmation Responsive par Celedev
 
Présentation Raspberry Pi (cocoaheads remix)
Présentation Raspberry Pi (cocoaheads remix)Présentation Raspberry Pi (cocoaheads remix)
Présentation Raspberry Pi (cocoaheads remix)
 
CocoaHeads Toulouse - Xcode et les tests - Epitez
CocoaHeads Toulouse - Xcode et les tests - EpitezCocoaHeads Toulouse - Xcode et les tests - Epitez
CocoaHeads Toulouse - Xcode et les tests - Epitez
 

Similar to Accessors Vs Direct access to properties & Design Pattern

Java programming concept
Java programming conceptJava programming concept
Java programming concept
Sanjay Gunjal
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Nicolas HAAN
 
Application Security from the Inside - OWASP
Application Security from the Inside - OWASPApplication Security from the Inside - OWASP
Application Security from the Inside - OWASP
Sqreen
 
Mobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileMobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve Mobile
Konstantin Loginov
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
Werner Keil
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
Michael Vorburger
 
Method, Constructor, Method Overloading, Method Overriding, Inheritance In Java
Method, Constructor, Method Overloading, Method Overriding, Inheritance In  JavaMethod, Constructor, Method Overloading, Method Overriding, Inheritance In  Java
Method, Constructor, Method Overloading, Method Overriding, Inheritance In Java
Jamsher bhanbhro
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
Netcetera
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
Masatoshi Tada
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
Saltmarch Media
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
Yuri Visser
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
Andreas Kurtz
 
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkNative Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Zachary Klein
 
Cocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design PatternsCocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design Patterns
Maciej Burda
 
Intro to iOS Development • Made by Many
Intro to iOS Development • Made by ManyIntro to iOS Development • Made by Many
Intro to iOS Development • Made by Many
kenatmxm
 
[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅
岳華 杜
 
Test-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptxTest-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptx
Victor Rentea
 
Data herding
Data herdingData herding
Data herding
unbracketed
 
Data herding
Data herdingData herding
Data herding
unbracketed
 

Similar to Accessors Vs Direct access to properties & Design Pattern (20)

Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
 
Application Security from the Inside - OWASP
Application Security from the Inside - OWASPApplication Security from the Inside - OWASP
Application Security from the Inside - OWASP
 
Mobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve MobileMobile Developers Talks: Delve Mobile
Mobile Developers Talks: Delve Mobile
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
Method, Constructor, Method Overloading, Method Overriding, Inheritance In Java
Method, Constructor, Method Overloading, Method Overriding, Inheritance In  JavaMethod, Constructor, Method Overloading, Method Overriding, Inheritance In  Java
Method, Constructor, Method Overloading, Method Overriding, Inheritance In Java
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
 
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkNative Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
 
Cocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design PatternsCocoa Heads Tricity - Design Patterns
Cocoa Heads Tricity - Design Patterns
 
Intro to iOS Development • Made by Many
Intro to iOS Development • Made by ManyIntro to iOS Development • Made by Many
Intro to iOS Development • Made by Many
 
[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅
 
Test-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptxTest-Driven Design Insights@DevoxxBE 2023.pptx
Test-Driven Design Insights@DevoxxBE 2023.pptx
 
Data herding
Data herdingData herding
Data herding
 
Data herding
Data herdingData herding
Data herding
 

More from CocoaHeads France

Mutation testing for a safer Future
Mutation testing for a safer FutureMutation testing for a safer Future
Mutation testing for a safer Future
CocoaHeads France
 
iOS App Group for Debugging
iOS App Group for DebuggingiOS App Group for Debugging
iOS App Group for Debugging
CocoaHeads France
 
Asynchronous swift
Asynchronous swiftAsynchronous swift
Asynchronous swift
CocoaHeads France
 
Visual accessibility in iOS11
Visual accessibility in iOS11Visual accessibility in iOS11
Visual accessibility in iOS11
CocoaHeads France
 
My script - One year of CocoaHeads
My script - One year of CocoaHeadsMy script - One year of CocoaHeads
My script - One year of CocoaHeads
CocoaHeads France
 
Ui testing dealing with push notifications
Ui testing dealing with push notificationsUi testing dealing with push notifications
Ui testing dealing with push notifications
CocoaHeads France
 
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
CocoaHeads France
 
L'intégration continue avec Bitrise
L'intégration continue avec BitriseL'intégration continue avec Bitrise
L'intégration continue avec Bitrise
CocoaHeads France
 
Super combinators
Super combinatorsSuper combinators
Super combinators
CocoaHeads France
 
Design like a developer
Design like a developerDesign like a developer
Design like a developer
CocoaHeads France
 
Handle the error
Handle the errorHandle the error
Handle the error
CocoaHeads France
 
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
CocoaHeads France
 
IoT Best practices
 IoT Best practices IoT Best practices
IoT Best practices
CocoaHeads France
 
SwiftyGPIO
SwiftyGPIOSwiftyGPIO
SwiftyGPIO
CocoaHeads France
 
Présentation de HomeKit
Présentation de HomeKitPrésentation de HomeKit
Présentation de HomeKit
CocoaHeads France
 
Programme MFI retour d'expérience
Programme MFI retour d'expérienceProgramme MFI retour d'expérience
Programme MFI retour d'expérience
CocoaHeads France
 
How to communicate with Smart things?
How to communicate with Smart things?How to communicate with Smart things?
How to communicate with Smart things?
CocoaHeads France
 
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
CocoaHeads France
 
Project Entourage
Project EntourageProject Entourage
Project Entourage
CocoaHeads France
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
CocoaHeads France
 

More from CocoaHeads France (20)

Mutation testing for a safer Future
Mutation testing for a safer FutureMutation testing for a safer Future
Mutation testing for a safer Future
 
iOS App Group for Debugging
iOS App Group for DebuggingiOS App Group for Debugging
iOS App Group for Debugging
 
Asynchronous swift
Asynchronous swiftAsynchronous swift
Asynchronous swift
 
Visual accessibility in iOS11
Visual accessibility in iOS11Visual accessibility in iOS11
Visual accessibility in iOS11
 
My script - One year of CocoaHeads
My script - One year of CocoaHeadsMy script - One year of CocoaHeads
My script - One year of CocoaHeads
 
Ui testing dealing with push notifications
Ui testing dealing with push notificationsUi testing dealing with push notifications
Ui testing dealing with push notifications
 
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
 
L'intégration continue avec Bitrise
L'intégration continue avec BitriseL'intégration continue avec Bitrise
L'intégration continue avec Bitrise
 
Super combinators
Super combinatorsSuper combinators
Super combinators
 
Design like a developer
Design like a developerDesign like a developer
Design like a developer
 
Handle the error
Handle the errorHandle the error
Handle the error
 
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
 
IoT Best practices
 IoT Best practices IoT Best practices
IoT Best practices
 
SwiftyGPIO
SwiftyGPIOSwiftyGPIO
SwiftyGPIO
 
Présentation de HomeKit
Présentation de HomeKitPrésentation de HomeKit
Présentation de HomeKit
 
Programme MFI retour d'expérience
Programme MFI retour d'expérienceProgramme MFI retour d'expérience
Programme MFI retour d'expérience
 
How to communicate with Smart things?
How to communicate with Smart things?How to communicate with Smart things?
How to communicate with Smart things?
 
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
 
Project Entourage
Project EntourageProject Entourage
Project Entourage
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 

Accessors Vs Direct access to properties & Design Pattern

  • 3. Au programme • Accessors Vs Direct access to properties • Design Pattern : Categories • Design Pattern : Associative Storage • La chaine Météo! mardi 28 mai 13
  • 4. iVar : Accessors/Direct access • Performance ? • Risks / Limits ? mardi 28 mai 13
  • 5. property Using setter (ms) Using Direct Access (ms) strong + nonatomic 9 6 weak + nonatomic 30 30 unsafe_unretained + nonatomic 0,8 0,2 strong + atomic 9 6 iPhone 3GS/iOS5 + 10,000 affectactions. (average based on several tests.) iVar : Accessors/Direct access Performance? mardi 28 mai 13
  • 6. • Direct affectation don’t use the property attributes (atomic) • KVO/KVC needs accessors, • Don’t use accessor methods in init methods and dealloc (You may have override your accessors) iVar : Accessors/Direct access Risk / Limits? mardi 28 mai 13
  • 7. Design Pattern: Categories • Add new methods to existing classes #import "IBSHelper.h" @interface IBSHelper (FileName) + (NSString*)filenameForGeolocData; + (NSString*)filenameForBrandCodeData; + (NSString*)filenameForTradData; + (NSString *)currentLanguage; + (NSString *)currentLanguageForDownload; + (NSURL*)urlForGeolocData; + (NSURL*)urlForBrandData; + (NSURL*)urlForTradData; @end mardi 28 mai 13
  • 8. Design Pattern: Categories • Organize/split complexity mardi 28 mai 13
  • 9. Design Pattern: Categories • Makes easy to support multiple OS versions @interface UITableView (BkUICore) - (void) bkRegisterNibName:(NSString *)nibName forCellReuseIdentifier: (NSString *)identifier; - (id) bkDequeueReusableCellWithIdentifier:(NSString *)identifier; @end @interface UIViewController (BkUICore) - (void) bkDismissModalViewControllerAnimated:(BOOL)animated; - (void) bkPresentViewController:(UIViewController *)controller animated:(BOOL)animated; @end mardi 28 mai 13
  • 10. Design Pattern: Categories • Categories can be used to declare either instance methods or class methods but are not usually suitable for declaring additional properties. One other design pattern can help us ! Associated storage @interface UITableView (BkUICore) - (void) bkRegisterNibName:(NSString *)nibName forCellReuseIdentifier: (NSString *)identifier; - (id) bkDequeueReusableCellWithIdentifier:(NSString *)identifier; @end mardi 28 mai 13
  • 11. Design Pattern: Associative references http://developer.apple.com/library/mac/#documentation/ Cocoa/Conceptual/ObjCRuntimeGuide/Introduction/ Introduction.html#//apple_ref/doc/uid/TP40008048 Objective-C programs interact with the runtime system at three distinct levels: through Objective-C source code; through methods defined in the NSObject class of the Foundation framework; and through direct calls to runtime functions. mardi 28 mai 13
  • 12. Design Pattern: Associative references //nsobjet.h @interface NSObject + (Class)superclass; + (Class)class; - (BOOL)respondsToSelector:(SEL)aSelector; + (BOOL)conformsToProtocol:(Protocol *)protocol; //runtime.h OBJC_EXPORT Class class_getSuperclass(Class cls) OBJC_EXPORT Class object_getClass(id obj) OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel) OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol) Some of the NSObject methods simply query the runtime system for information. These methods allow objects to perform introspection. mardi 28 mai 13
  • 13. • A way to add simulate new properties to an existing class ! Design Pattern: Associative references static const char nibsAssocKey; @implementation UITableView (BkUICore) - (void) bkRegisterNibName:(NSString *)nibName forCellReuseIdentifier:(NSString *)identifier { if ([self respondsToSelector:@selector(registerNib:forCellReuseIdentifier:)]) { [self registerNib:[UINib nibWithNibName:nibName bundle:[NSBundle mainBundle]] forCellReuseIdentifier:identifier]; //NS_AVAILABLE_IOS(5_0) } else { NSMutableDictionary *nibs = objc_getAssociatedObject(self, &nibsAssocKey); if (nil == nibs) { nibs = [NSMutableDictionary dictionary]; objc_setAssociatedObject(self, &nibsAssocKey, nibs, OBJC_ASSOCIATION_RETAIN); } [nibs setValue:nibName forKey:identifier]; } } @end mardi 28 mai 13
  • 14. La chaine meteo Issue : How to add a new property on UINavigationBar • Subclass UINavigationBar, dumbass ! • Use associated storage ! mardi 28 mai 13
  • 16. Other examples • UIView + BkBadge • UIView + BkLoader .... mardi 28 mai 13