api jones and the wireframes of doom

95
@MicheleTitolo API Jones and the Wireframes of Doom

Upload: michele-titolo

Post on 10-May-2015

2.228 views

Category:

Technology


1 download

DESCRIPTION

When you look at a wireframe, what do you see? ViewControllers, navigation bars, and tableviews? As developers, we are great at figuring out what to put on the screen, what to animate, and how to put those pieces together. What we don't realize, in this early stage of app development, is that knowing your APIs here is crucial. How many times have we gone to implement a feature, only to find a half-baked API, or one that makes us hardcode half the information? The wireframe stage is the point to match screens with API calls, because this is where the app is most flexible. In this session we will walk through how to match wireframes to their corresponding APIs, as well as identify and solve the problems they create.

TRANSCRIPT

Page 1: API Jones and the Wireframes of Doom

@MicheleTitolo

API Jonesand the

Wireframes of Doom

Page 2: API Jones and the Wireframes of Doom
Page 3: API Jones and the Wireframes of Doom
Page 4: API Jones and the Wireframes of Doom
Page 5: API Jones and the Wireframes of Doom
Page 6: API Jones and the Wireframes of Doom
Page 7: API Jones and the Wireframes of Doom

APIs & Wireframes

Page 8: API Jones and the Wireframes of Doom

APIs

Page 9: API Jones and the Wireframes of Doom

Wireframes

Page 10: API Jones and the Wireframes of Doom

Not mockups

Page 11: API Jones and the Wireframes of Doom

Wireframes

Page 12: API Jones and the Wireframes of Doom
Page 13: API Jones and the Wireframes of Doom

What not to do

Page 14: API Jones and the Wireframes of Doom

Hey, look! A Wireframe!

Page 15: API Jones and the Wireframes of Doom
Page 16: API Jones and the Wireframes of Doom

Start developing!

Page 17: API Jones and the Wireframes of Doom

Models

Page 18: API Jones and the Wireframes of Doom

//// Photo.h//

@interface Photo : NSObject

@property (strong, nonatomic) User* user;@property (strong, nonatomic) Location* location;

@property (strong, nonatomic) NSNumber* photoID;@property (strong, nonatomic) NSDate* timestamp;@property (strong, nonatomic) NSSet* comments;@property (strong, nonatomic) NSURL* photoURL;

@end

Page 19: API Jones and the Wireframes of Doom

//// User.h//

@interface User : NSObject

@property (copy, nonatomic) NSString* username;@property (strong, nonatomic) NSNumber* userID;

@property (strong, nonatomic) NSURL* userPhotoURL;@property (strong, nonatomic) NSSet* photos;@property (strong, nonatomic) NSSet* comments;

@end

Page 20: API Jones and the Wireframes of Doom

//// Comment.h//

@interface Comment : NSObject

@property (strong, nonatomic) User* user;@property (strong, nonatomic) Photo* photo;@property (strong, nonatomic) NSDate* timestamp;

@property (copy, nonatomic) NSString* text;

@end

Page 21: API Jones and the Wireframes of Doom

PhotoCell

Page 22: API Jones and the Wireframes of Doom

//// PhotoCell.h//

@interface PhotoCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UIImageView* userImageView;@property (weak, nonatomic) IBOutlet UIImageView* photoImageView;

@property (weak, nonatomic) IBOutlet UILabel* userNameLabel;@property (weak, nonatomic) IBOutlet UILabel* dateLabel;@property (weak, nonatomic) IBOutlet UILabel* locationLabel;@property (weak, nonatomic) IBOutlet UILabel* usersLovedLabel;@property (weak, nonatomic) IBOutlet UILabel* userCommentLabel;

@property (strong, nonatomic) Photo* cellPhoto;

- (void)setupWithPhoto:(Photo*)photo;

@end

Page 23: API Jones and the Wireframes of Doom

//// PhotoCell.m//

@implementation PhotoCell

- (void)setupWithPhoto:(Photo *)photo{ self.cellPhoto = photo; [self.userImageView setImageWithURL:photo.user.userPhotoURL]; [self.photoImageView setImageWithURL:photo.photoURL]; self.userNameLabel.text = photo.user.username; // etc. }

@end

Page 24: API Jones and the Wireframes of Doom

//// PhotoViewController.m//

@implementation PhotoViewController

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ PhotoCell* cell = [tableView dequeueReusableCellWithIdentifier:s_cellID forIndexPath:indexPath]; Photo* photo = [self.photos objectAtIndex:indexPath.row]; [cell setupWithPhoto:photo]; return cell;}

@end

Page 25: API Jones and the Wireframes of Doom

...several hours to several days later...

Page 26: API Jones and the Wireframes of Doom

Build and Run

Page 27: API Jones and the Wireframes of Doom
Page 28: API Jones and the Wireframes of Doom

Time === Money

Page 29: API Jones and the Wireframes of Doom

The right way

Page 30: API Jones and the Wireframes of Doom

Hey, look! A Wireframe!

Page 31: API Jones and the Wireframes of Doom
Page 32: API Jones and the Wireframes of Doom

Annotations

Page 33: API Jones and the Wireframes of Doom

photo posted date

photo

users who love photo

user picture, name

photo comments

photo location

Page 34: API Jones and the Wireframes of Doom

photo posted date

photo

users who love photo

user picture, name

photo comments

photo location

tapping goes to user profile

tapping goes to user profile

tapping goes to location on map

tapping user goes to user profile

Page 35: API Jones and the Wireframes of Doom

Write it down.

Page 36: API Jones and the Wireframes of Doom

Photo

• location (lat/log and name)

• timestamp

• image URL

• user (name, photo, and id)

• comments (text, user name, and user id)

• users who love (name and id)

Page 37: API Jones and the Wireframes of Doom

JSON

Page 38: API Jones and the Wireframes of Doom

{! "meta": {! ! "self":"photos",! ! "page":1,! ! "offset":0,! ! "total_items":282! },! "photos": [ { "photo_url":"http://p3.amazons3.com/apijones/photos/124hh3b99d77dsnn.png", "created_at":"2013-09-01T18:16:54Z", "identifier":24435, "user": { "username":"karlthefog", "identifier":6332 }, "loves": [ 5622, 4402, 9773 ], "comments": [ { "text":"Sorry I'm not home right now", "user_id":24254, "identifier":122887, "timestamp":"2013-09-01T18:36:02Z" }, { "text":"I'm floating into spiderwebs", "user_id":6332, "identifier":122921, "timestamp":"2013-09-01T18:42:22Z" } ] } ]}

Page 39: API Jones and the Wireframes of Doom

Back to the list

Page 40: API Jones and the Wireframes of Doom

Photo

• location (lat/log and name)

• timestamp

• image URL

• user (name, photo, and id)

• comments (text, user name, and user id)

• users who love (name and id)(name and id)

Page 41: API Jones and the Wireframes of Doom

{! "meta": {! ! "self":"photos",! ! "page":1,! ! "offset":0,! ! "total_items":282! },! "photos": [ { "photo_url":"http://p3.amazons3.com/apijones/photos/124hh3b99d77dsnn.png", "created_at":"2013-09-01T18:16:54Z", "identifier":24435, "user": { "username":"karlthefog", "identifier":6332 }, "loves": [ 5622, 4402, 9773 ], "comments": [ { "text":"Sorry I'm not home right now", "user_id":24254, "identifier":122887, "timestamp":"2013-09-01T18:36:02Z" }, { "text":"I'm floating into spiderwebs", "user_id":6332, "identifier":122921, "timestamp":"2013-09-01T18:42:22Z" } ] } ]}

"loves": [ 5622, 4402, 9732 ],

Page 42: API Jones and the Wireframes of Doom

Congrats!You found a problem.

Page 43: API Jones and the Wireframes of Doom

Make a note,then move along

Page 44: API Jones and the Wireframes of Doom

Do this for every screen.

Page 45: API Jones and the Wireframes of Doom

Measure twice, cut once

Page 46: API Jones and the Wireframes of Doom
Page 47: API Jones and the Wireframes of Doom
Page 48: API Jones and the Wireframes of Doom

Measure twice, cut once

Page 49: API Jones and the Wireframes of Doom

Communicate!

Page 50: API Jones and the Wireframes of Doom

Work...uninterrupted

Page 51: API Jones and the Wireframes of Doom

Tips & Tricks

Page 52: API Jones and the Wireframes of Doom

Design

Page 53: API Jones and the Wireframes of Doom

Pull To Refresh

Page 54: API Jones and the Wireframes of Doom

To remove all data, or not to remove all data, that is the

question

Page 55: API Jones and the Wireframes of Doom

Storage

Page 56: API Jones and the Wireframes of Doom

Don’t overwrite data with nil

Page 57: API Jones and the Wireframes of Doom

//// NSMutableDictionary+NilAdditions.m//

@implementation NSMutableDictionary (NilAdditions)

- (void)setNotNilObject:(id)anObject forKey:(id<NSCopying>)key{ if (anObject) { [self setObject:anObject forKey:key]; }}

@end

Page 58: API Jones and the Wireframes of Doom

Infinite Scroll

Page 59: API Jones and the Wireframes of Doom

Pagination

Page 60: API Jones and the Wireframes of Doom

Remember your place

Page 61: API Jones and the Wireframes of Doom

Drill Down

Page 62: API Jones and the Wireframes of Doom

REST

Page 63: API Jones and the Wireframes of Doom

GET /resources

GET /resources/:id

GET /resources/:id/nested_resources

Page 64: API Jones and the Wireframes of Doom

GET /photos

GET /photos/55

GET /photos/55/comments

Page 65: API Jones and the Wireframes of Doom

REST has it’s problems, too

Page 66: API Jones and the Wireframes of Doom

APIs

Page 67: API Jones and the Wireframes of Doom

Find Patterns

Page 68: API Jones and the Wireframes of Doom

Meta information

Page 69: API Jones and the Wireframes of Doom

Structures

Page 70: API Jones and the Wireframes of Doom

Inconsistencies

Page 71: API Jones and the Wireframes of Doom

Missing or Bad Data

Page 72: API Jones and the Wireframes of Doom

Getting the Data

Page 73: API Jones and the Wireframes of Doom

Batching

Page 74: API Jones and the Wireframes of Doom

GET /photos/55

GET /photos/55/comments

Page 75: API Jones and the Wireframes of Doom

Make sure you are actually loading data

Page 76: API Jones and the Wireframes of Doom

“comment_count”

“total_items”

Page 77: API Jones and the Wireframes of Doom

Background Processing

Page 78: API Jones and the Wireframes of Doom

Blocking the main thread is bad

Page 79: API Jones and the Wireframes of Doom

Process & construct whereit won’t affect performance

Page 80: API Jones and the Wireframes of Doom

Caching

Page 81: API Jones and the Wireframes of Doom

Core Data

Page 82: API Jones and the Wireframes of Doom

NSCache

Page 83: API Jones and the Wireframes of Doom

Documentation

Page 84: API Jones and the Wireframes of Doom

Agile

Page 85: API Jones and the Wireframes of Doom

This can be done

Page 86: API Jones and the Wireframes of Doom

More communication,faster turnaround

Page 87: API Jones and the Wireframes of Doom

Define “iteration”

Page 88: API Jones and the Wireframes of Doom

In Summary

Page 89: API Jones and the Wireframes of Doom

Plan Ahead

Page 90: API Jones and the Wireframes of Doom

Work smart, not hard

Page 91: API Jones and the Wireframes of Doom
Page 92: API Jones and the Wireframes of Doom
Page 93: API Jones and the Wireframes of Doom

Why’d it have to be snakes?

Page 94: API Jones and the Wireframes of Doom
Page 95: API Jones and the Wireframes of Doom

Thank you!

@MicheleTitolo