Top Banner
AppDevKit for iOS Development Anistar Sung Yahoo Engineering Manager
44

AppDevKit for iOS Development

Apr 16, 2017

Download

Technology

Anistar Sung
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AppDevKit for iOS Development

AppDevKit for iOS Development

Anistar SungYahoo Engineering Manager

Page 2: AppDevKit for iOS Development

Introducing AppDevKit

Quick demonstrate for AppDevKit

Agenda

Page 3: AppDevKit for iOS Development

Smart Design + ArchitectureWanting everything easier

Page 4: AppDevKit for iOS Development

CHALLENGE

Page 5: AppDevKit for iOS Development

AppDevKithttps://github.com/yahoo/AppDevKit

Page 6: AppDevKit for iOS Development

Over 100+ features

Page 7: AppDevKit for iOS Development

ListView

Color

AutoLayout

Image Filters

Image Analysis

What AppDevKit didCover regular development requirement

Page 8: AppDevKit for iOS Development

Animator

Cache

Formatter

Modal

View

What AppDevKit didCover regular development requirement

Page 9: AppDevKit for iOS Development

Quick demonstrate for AppDevKitIntroduce few major features

Page 10: AppDevKit for iOS Development

Hard to sync with designer

After requirement changing need to rewrite code

Change once apply anywhere The pain for changing

Page 11: AppDevKit for iOS Development

Designer: I want red color background.

Developer: Sure! self.backgroundColor = [UIColor redColor];

Challenge on Color Design easy sync tool for designer

Page 12: AppDevKit for iOS Development

Designer: I want #7b19a9 background.

Developer: What!?

Challenge on Color Design easy sync tool for designer

!?

Page 13: AppDevKit for iOS Development

Designer: I want Yahoo background.

Developer: Mom, I want go home. :(

Challenge on Color Design easy sync tool for designer

#@*$!

Page 14: AppDevKit for iOS Development

Using Category to improve UIColor

+ (UIColor *)ADKColorWithHexString:(NSString *)hexstring;+ (UIColor *)ADKColorWithHexNumber:(NSUInteger)hexNumber;

Challenge on Color Design easy sync tool for designer

Page 15: AppDevKit for iOS Development

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

Page 16: AppDevKit for iOS Development

+ (UIColor *)themeBackground{ return [UIColor ADKColorWithHexString:@"1f2f3b"];}

+ (UIColor *)themePanel{ return [UIColor ADKColorWithHexString:@"333e49"];}

Change once apply anywhere Theme color management

Page 17: AppDevKit for iOS Development

+ (UIColor *)themeBackground{ return [UIColor ADKColorWithHexString:@"dedede"];}

+ (UIColor *)themePanel{ return [UIColor ADKColorWithHexString:@"f4f4f4"];}

Change once apply anywhere Theme color management

Page 18: AppDevKit for iOS Development

Change once apply anywhere Theme color management

Page 19: AppDevKit for iOS Development

DemoUsing UIColor+ADKHexPresentation

Page 20: AppDevKit for iOS Development

Using AutoLayout Easier Solve UI elements alignment problem

Page 21: AppDevKit for iOS Development

Using AutoLayout Easier Solve UI elements alignment problem

Page 22: AppDevKit for iOS Development

Using AutoLayout Easier Solve UI elements alignment problem

Page 23: AppDevKit for iOS Development

Using AutoLayout Easier Solve UI elements alignment problem

Page 24: AppDevKit for iOS Development

Control constraint

@import “UIView+ADKAutoLayoutSupport.h” [self.presetImageView hideTopConstraint]; [self.presetImageView unhideTopConstraint];

Using AutoLayout Easier Solve UI elements alignment problem

Page 25: AppDevKit for iOS Development

Control constraint

@import “UIView+AutoLayoutSupport.h”

- (void)setConstraintConstant:(CGFloat)constant forAttribute:(NSLayoutAttribute)attribute;

Using AutoLayout Easier Solve UI elements alignment problem

Page 26: AppDevKit for iOS Development

DemoUsing UIView+ADKAutoLayoutSupport

Page 27: AppDevKit for iOS Development

UIViewController

- (void)presentViewController:(UIViewController *)viewControllerToPresentanimated:(BOOL)flag completion:(void (^)(void))completion

Providing Fancy Modal View Customizing your modal effect

Page 28: AppDevKit for iOS Development

@import “ADKModalMaskView.h” [self.modalView showInView:self.view withAnimation:YES completion:^(BOOL finished) { // Do something you want }];

Providing Fancy Modal View Customizing your modal effect

Page 29: AppDevKit for iOS Development

DemoUsing ADKModalMaskView

Page 30: AppDevKit for iOS Development

ICON should apply theme color

Fast materials replacement ICON and assets color

Page 31: AppDevKit for iOS Development

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

Page 32: AppDevKit for iOS Development

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

Page 33: AppDevKit for iOS Development

Fast materials replacement ICON theme color management

Page 34: AppDevKit for iOS Development

DemoUsing UIImage+ADKImageFilter

Page 35: AppDevKit for iOS Development

Most content can be displayed by list view

UICollectionView is a powerful component

Easy to present content List view for presentation

Page 36: AppDevKit for iOS Development
Page 37: AppDevKit for iOS Development

Change once apply anywhere Interface change

Page 38: AppDevKit for iOS Development

UICollectionView can set up cell size

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { return CGsizeMake(320.0.f, 200.0f); }

Change once apply anywhere Interface change

Page 39: AppDevKit for iOS Development

UICollectionView can set up cell size

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { return [[[[[NSBundle mainBundle] loadNibNamed:@“Cell” owner:self options:nil] lastObject] bounds] size]; }

Change once apply anywhere Interface change

Page 40: AppDevKit for iOS Development

UICollectionView can set up cell size SMARTER!

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { return [[ADKNibSizeCalculator sharedInstance] sizeForNibNamed:@"Cell"]; }

Change once apply anywhere Interface change

Page 41: AppDevKit for iOS Development

UICollectionView can set up cell size SMARTER!

- (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

Page 42: AppDevKit for iOS Development

DemoUsing Dynamic Cells for List View

Page 43: AppDevKit for iOS Development

Anistar Sung Yahoo Engineering [email protected]

AppDevKit Yahoo Core TeamYahoo Engineering Engineers [email protected]

More information

Page 44: AppDevKit for iOS Development

Q + A