SlideShare a Scribd company logo
1 of 96
Download to read offline
The Tour & Mystery of AppDevKit
Anistar Sung
Senior Engineering Manager, Yahoo
Yahoo Open Source
MOPCON 2016
Why I did Open Source?
I supposed I was doing…
But real reasons were…
CHALLENGE
Duration of Development
Quality of Product
They’re my colleagues
I want red color background.
Challenge on Color
Design easy sync tool for designer
Designer said:
Sure!
Challenge on Color
Design easy sync tool for designer
Developer said:
self.backgroundColor = [UIColor redColor];
I want #7b19a9 color background.
Challenge on Color
Design easy sync tool for designer
Designer said:
Hmmm… What the color is?
Challenge on Color
Design easy sync tool for designer
Developer said:
I want Yahoo purple background.
Challenge on Color
Design easy sync tool for designer
Designer said:
Using Category to improve UIColor
+ (UIColor *)ADKColorWithHexString:(NSString *)hexString;

+ (UIColor *)ADKColorWithHexNumber:(NSUInteger)hexNumber;
Challenge on Color
Design easy sync tool for designer
Management your theme color
+ (UIColor *)themeBackground;
+ (UIColor *)themeForeground;
+ (UIColor *)themeDisabled;
+ (UIColor *)themeFocus;
+ (UIColor *)themeHighlight;
+ (UIColor *)themeTitle;
+ (UIColor *)themeSubtitle;
Challenge on Color
Design easy sync tool for designer
+ (UIColor *)themeBackground

{

return [UIColor ADKColorWithHexString:@"1f2f3b"];

}
+ (UIColor *)themePanel

{

return [UIColor ADKColorWithHexString:@"333e49"];

}
Change once apply anywhere
Theme color management
+ (UIColor *)themeBackground

{

return [UIColor ADKColorWithHexString:@"dedede"];

}
+ (UIColor *)themePanel

{

return [UIColor ADKColorWithHexString:@"f4f4f4"];

}
Change once apply anywhere
Theme color management
AppDevKit
Objectives of AppDevKit
Saving developing time
Supporting daily required
Maintaining easier
High performance / reliable solution
Composition of AppDevKit
Common UI
Animation
Image
List
AppDevKit
Anson Ng
ABU Senior App Engineer, Yahoo
Quick Tour of
AppDevKit
Hex Color
Date Formatter
Number Formatter
Gradient View
Over 100+ features
Animation
App Util
Nib Size Calculator
CalculatorHelper
AutoLayout Constraint Tool
Image Filters
ModalMaskView
Dynamic width/height Cell
Pull to Refresh
Infinite scrolling
AppDevKit
Hex Color
Date Formatter
Number Formatter
Gradient View
Over 100+ features
Animation
App Util
Nib Size Calculator
CalculatorHelper
AutoLayout Constraint Tool
Image Filters
ModalMaskView
Dynamic width/height Cell
Pull to Refresh
Infinite scrolling
Using AutoLayout Easier
Solve UI elements alignment problem
Using AutoLayout Easier
Solve UI elements alignment problem
Using AutoLayout Easier
Solve UI elements alignment problem
Using AutoLayout Easier
Solve UI elements alignment problem
@import “UIView+ADKAutoLayoutSupport.h”


[self.presetImageView ADKHideTopConstraint];
[self.presetImageView ADKUnhideTopConstraint];
Using AutoLayout Easier
Solve UI elements alignment problem
@import “UIView+AutoLayoutSupport.h”
- (void)ADKSetConstraintConstant:(CGFloat)constant
forAttribute:(NSLayoutAttribute)attribute;
Using AutoLayout Easier
Solve UI elements alignment problem
Demo
Using UIView+ADKAutoLayoutSupport
Image Filters
Image Color replacement
UIImage+ADKColorReplacement.h

+ (UIImage *)ADKImage:(UIImage *)image tintColor:(UIColor *)color;
+ (UIImage *)ADKImage:(UIImage *)image replaceColor:(UIColor *)color;

+ (UIImage *)ADKImageNamed:(NSString *)name tintColor:(UIColor *)color;
+ (UIImage *)ADKImageNamed:(NSString *)name replaceColor:(UIColor *)color;
Fast materials replacement
Implement category for UIImage
Change ICON’s theme color

@import “UIImage+ADKColorReplacement.h”


self.presetImageView.image = [UIImage ADKImageNamed:@“icon-folder.png" 

replaceColor:[UIColor themeLightWhite]];


UIImage *settingButtonImage = [UIImage ADKImageNamed:@"icon-setting.png" 

replaceColor:[UIColor themeForeground]];


[settingButton setImage:settingButtonImage forState:UIControlStateNormal];
Fast materials replacement
Implement category for UIImage
ADKModalMaskView
UIViewController
- (void)presentViewController:(UIViewController *)viewControllerToPresent

animated:(BOOL)flag completion:(void (^)(void))completion
Providing Fancy Modal View
Customizing your modal effect
@import “ADKModalMaskView.h”


[(ADKModalMaskView *)self.modalView showInView:self.view
withAnimation:YES
completion:^(BOOL finished) {
// Do something you want
}];
Providing Fancy Modal View
Customizing your modal effect
Demo
Using ADKModalMaskView &
UIImage+ADKImageFilter
Dynamic Height/Width cell
UICollectionView can set up cell size SMARTER!
@import ADKCellDynamicSizeCalculator.h
- (CGSize)collectionView:(UICollectionView *)collectionView 

layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
CGSize cellSize = [[NibSizeCalculator sharedInstance]
sizeForNibNamed:@“Cell”];
return [[ADKCellDynamicSizeCalculator sharedInstance] 

sizeForDynamicHeightCellInstance:sampleCell
preferredSize:cellSize];
}
Change once apply anywhere
Interface change
Demo
Using ADKCellDynamicSizeCalculator
Change once apply anywhere
Interface change
Change once apply anywhere
Interface change
BEFORE AFTER
UICollectionView can set up cell size SMARTER!
- (CGSize)collectionView:(UICollectionView *)collectionView 

layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat height = 100.0f;
// 2nd requirement: height = 120.0f;
// 3rd requirement: height = 150.0f;
// I can try this all day…
return CGSize(320.0f,height)
}
Change once apply anywhere
Interface change
UICollectionView can set up cell size SMARTER!
@import ADKNibSizeCalculator.h
- (CGSize)collectionView:(UICollectionView *)collectionView 

layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [[ADKNibSizeCalculator sharedInstance]
sizeForNibNamed:@"Cell"];
}
Change once apply anywhere
Interface change
Pull to Refresh &
Infinite scrolling
Customized pull to refresh feature
[self.collectionView
ADKAddPullToRefreshWithHandleView:refreshView
actionHandler:^{
// Calling API to get data and present on list
[self.collectionView reloadData];
}];
Implement Easy Refresh Mechanism
Support UICollectionView & UITableView
Demo
Using UIScrollView+ADKPullToRefreshView
The Mystery You Would Like to Know
Design Shareable Library with 9 Rules
Bounding User Interface could be EVIL
Build Libraries without UI
Made It Smaller and Independent
Small modules will be better than a huge feature
Cache Heavy Calculated Result
CPU resource is precious
Cache Heavy Calculated Result
+ (UIImage *)ADKImageNamed:(NSString *)name replaceColor:(UIColor *)color
{
NSString *cacheKeyString =
[UIImage cacheKeyStringWithImageNamed:name
colorReplaceMode:ADKColorReplaceModeReplace
color:color];
UIImage *resultImage = [s_imageCache objectForKey:cacheKeyString];
if (resultImage) return resultImage;
…
}
Avoid Using BAD Solution
Runtime associated object is expensive
Avoid Using BAD Solution
- (void)ADKHideView:(BOOL)isHidden withConstraints:(ADKLayoutAttribute)attributes
{
ADKAutoLayoutValueObject *valueObject = self.cachedConstraintValueObject;
if (isHidden) {
if (attributes & ADKLayoutAttributeLeading) {
NSLayoutConstraint *constraint =
[self ADKConstraintForAttribute:NSLayoutAttributeLeading];
valueObject.cachedLeadingConstraintConstant = constraint.constant;
…
}
Separate Libraries into small pieces
Separating libraries in purpose
Separate Libraries into small pieces
Common UI
Animation
Image
List
Separate Libraries into small pieces
s.subspec 'AppDevCommonKit' do |appDevCommonKit|
appDevCommonKit.source_files = …
appDevCommonKit.public_header_files = …
end
s.subspec 'AppDevUIKit' do |appDevUIKit|
appDevUIKit.source_files = …
appDevUIKit.public_header_files = …
appDevUIKit.dependency 'AppDevKit/AppDevCommonKit'
end
Document is Important
Comments are Documents as well
Document is Important
appledoc
https://github.com/tomaz/appledoc
Platform Detection
Try to detect OS, Device and SDK
Platform Detection
if (ADKIsBelowIOS10()) { ... }
if (ADKIsLongerScreen()) { ... }
if ([UIImage instancesRespondToSelector:@selector(…)]) {…}
Testing is Required
Testing is good strategy to save time and life
Testing is Required
Friendly UI Would be Better
Using vision data provider
Friendly UI Would be Better
IB_DESIGNABLE
@interface ADKGradientView : UIView
@property (nonatomic, strong) IBInspectable UIColor *beginColor;
@property (nonatomic, strong) IBInspectable UIColor *endColor;
Open Source Progress
Current progress update
AppDevKit Core Team
Anistar Anson Jeff QC
Anistar Sung

Yahoo Senior Engineering Manager

cfsung@yahoo-inc.com
AppDevKit Yahoo Core Team

Yahoo Engineering Engineers

app-dev-kit@yahoo-inc.com
Google Index of AppDevKit
Github REPO
CocoaPods Support
API Documents
Tutorials
One More Thing…
CameraKit
ADKCamera *camera = [[ADKCamera alloc] 

initCamcoderWithDelegate:self 

quality:AVCaptureSessionPresetHigh 

position:ADKCameraPositionRear];
camera.alignDeviceOrientation = YES;
[self.view.layer
insertSublayer:camera.captureVideoPreviewLayer atIndex:0];
Initialize Customize Camera
Quick & powerful camera developing
Live Demo
Using CameraKit to build customized camera
CameraKit would be released in Nov.
Composition of AppDevKit
Common UI
Animation
Image List
Camera
– iOS BDD
DAY 1 - 16:15 R2

QC Lin, Senior App Engineer, Yahoo

iOS self-sizing cell
DAY 2 - 10:15 R2

Jeff Lin, Senior App Engineer, Yahoo
More Sessions in MOPCON 2016
Q + A

More Related Content

What's hot

What is image in Swift?/はるふ
What is image in Swift?/はるふWhat is image in Swift?/はるふ
What is image in Swift?/はるふha1f Yamaguchi
 
Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Ajinkya Saswade
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIWinston Teo
 
Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation Shilu Shrestha
 
Google maps and GPS, camera, SD card, tips & tricks
Google maps and GPS, camera, SD card, tips & tricksGoogle maps and GPS, camera, SD card, tips & tricks
Google maps and GPS, camera, SD card, tips & tricksNikola Kapraljevic Nixa
 
ReactiveCocoa - TDC 2016
ReactiveCocoa - TDC 2016ReactiveCocoa - TDC 2016
ReactiveCocoa - TDC 2016vinciusreal
 
GDG Kuwait - Modern android development
GDG Kuwait - Modern android developmentGDG Kuwait - Modern android development
GDG Kuwait - Modern android developmentGDGKuwaitGoogleDevel
 
Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)Sameer Rathoud
 
React native introduction
React native introductionReact native introduction
React native introductionInnerFood
 
Lessons learned from porting Roloengine from iOS to Android
Lessons learned from porting Roloengine from iOS to AndroidLessons learned from porting Roloengine from iOS to Android
Lessons learned from porting Roloengine from iOS to AndroidManish Mathai
 
Jetpack Compose - Android’s modern toolkit for building native UI
Jetpack Compose - Android’s modern toolkit for building native UIJetpack Compose - Android’s modern toolkit for building native UI
Jetpack Compose - Android’s modern toolkit for building native UIGilang Ramadhan
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android Arvind Devaraj
 
Android animation
Android animationAndroid animation
Android animationKrazy Koder
 
Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018Hassan Abid
 
Write once, ship multiple times
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple timesŽeljko Plesac
 
2013-48. Game Progamming
2013-48. Game Progamming2013-48. Game Progamming
2013-48. Game ProgammingSyiroy Uddin
 

What's hot (18)

What is image in Swift?/はるふ
What is image in Swift?/はるふWhat is image in Swift?/はるふ
What is image in Swift?/はるふ
 
Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization API
 
Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation
 
Google maps and GPS, camera, SD card, tips & tricks
Google maps and GPS, camera, SD card, tips & tricksGoogle maps and GPS, camera, SD card, tips & tricks
Google maps and GPS, camera, SD card, tips & tricks
 
ReactiveCocoa - TDC 2016
ReactiveCocoa - TDC 2016ReactiveCocoa - TDC 2016
ReactiveCocoa - TDC 2016
 
GDG Kuwait - Modern android development
GDG Kuwait - Modern android developmentGDG Kuwait - Modern android development
GDG Kuwait - Modern android development
 
Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)Decorator design pattern (A Gift Wrapper)
Decorator design pattern (A Gift Wrapper)
 
React native introduction
React native introductionReact native introduction
React native introduction
 
Lessons learned from porting Roloengine from iOS to Android
Lessons learned from porting Roloengine from iOS to AndroidLessons learned from porting Roloengine from iOS to Android
Lessons learned from porting Roloengine from iOS to Android
 
Jetpack Compose - Android’s modern toolkit for building native UI
Jetpack Compose - Android’s modern toolkit for building native UIJetpack Compose - Android’s modern toolkit for building native UI
Jetpack Compose - Android’s modern toolkit for building native UI
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android
 
Android animation
Android animationAndroid animation
Android animation
 
Voluminous_Weibo
Voluminous_WeiboVoluminous_Weibo
Voluminous_Weibo
 
Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018Recap of Android Dev Summit 2018
Recap of Android Dev Summit 2018
 
Open Cv Tutorial Ii
Open Cv Tutorial IiOpen Cv Tutorial Ii
Open Cv Tutorial Ii
 
Write once, ship multiple times
Write once, ship multiple timesWrite once, ship multiple times
Write once, ship multiple times
 
2013-48. Game Progamming
2013-48. Game Progamming2013-48. Game Progamming
2013-48. Game Progamming
 

Similar to Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)

I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)Katsumi Kishikawa
 
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Chris Adamson
 
Ui perfomance
Ui perfomanceUi perfomance
Ui perfomanceCleveroad
 
Kotlin Mullets
Kotlin MulletsKotlin Mullets
Kotlin MulletsJames Ward
 
Style vs. Content and Clean Theming in iOS
Style vs. Content and Clean Theming in iOSStyle vs. Content and Clean Theming in iOS
Style vs. Content and Clean Theming in iOSKeith Norman
 
Building a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesBuilding a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesDavid Giard
 
Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)Sameer Rathoud
 
Th 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficient
Th 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficientTh 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficient
Th 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficientBin Shao
 
io 19 extended android flutter&mlkit
io 19 extended android flutter&mlkitio 19 extended android flutter&mlkit
io 19 extended android flutter&mlkit성윤 (Hunt) 조
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material DesignYasin Yildirim
 
Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Saulo Arruda
 
Creating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdfCreating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdfShaiAlmog1
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder BehindJohn Wilker
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Jorge Maroto
 
iPhone/iPad开发讲座 第五讲 定制视图和多点触摸
iPhone/iPad开发讲座 第五讲 定制视图和多点触摸iPhone/iPad开发讲座 第五讲 定制视图和多点触摸
iPhone/iPad开发讲座 第五讲 定制视图和多点触摸Hao Peiqiang
 
demo car display.pptx
demo car display.pptxdemo car display.pptx
demo car display.pptxssuser016f54
 

Similar to Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016) (20)

I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)
 
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
Core Image: The Most Fun API You're Not Using, CocoaConf Atlanta, December 2014
 
Ui perfomance
Ui perfomanceUi perfomance
Ui perfomance
 
iOS Training Session-3
iOS Training Session-3iOS Training Session-3
iOS Training Session-3
 
Kotlin Mullets
Kotlin MulletsKotlin Mullets
Kotlin Mullets
 
iOS 7 SDK特訓班
iOS 7 SDK特訓班iOS 7 SDK特訓班
iOS 7 SDK特訓班
 
Style vs. Content and Clean Theming in iOS
Style vs. Content and Clean Theming in iOSStyle vs. Content and Clean Theming in iOS
Style vs. Content and Clean Theming in iOS
 
Building a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesBuilding a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web Services
 
Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)Builder Design Pattern (Generic Construction -Different Representation)
Builder Design Pattern (Generic Construction -Different Representation)
 
Th 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficient
Th 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficientTh 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficient
Th 0230 turbo_chargeyourui-howtomakeyourandroidu_ifastandefficient
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
io 19 extended android flutter&mlkit
io 19 extended android flutter&mlkitio 19 extended android flutter&mlkit
io 19 extended android flutter&mlkit
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material Design
 
Core animation
Core animationCore animation
Core animation
 
Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4
 
Creating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdfCreating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdf
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)
 
iPhone/iPad开发讲座 第五讲 定制视图和多点触摸
iPhone/iPad开发讲座 第五讲 定制视图和多点触摸iPhone/iPad开发讲座 第五讲 定制视图和多点触摸
iPhone/iPad开发讲座 第五讲 定制视图和多点触摸
 
demo car display.pptx
demo car display.pptxdemo car display.pptx
demo car display.pptx
 

Yahoo Open Source - The Tour & Mystery of AppDevKit (MOPCON 2016)