MOBILE IN THE CLOUD
WITH DIAMONDS

2013

2013
mobile in the cloud with diamonds. improved.
Mobile & Cloud

Content

Bicycles we ride
Essential frameworks
Advanced frameworks
Wondertools
You don't test me
Backends
Imagination
mobile and the internets
m
Developer’s dilemma
★
★
★

faster
know how
solves the problem

VS

FRAMEWORKS

★
★
★

tested
independent
supported
FRAMEWORKS

That could be a pain

RESTawful
services
Data and Cloud

Core Data
Data and Cloud

NSOperation

Core Data
Data and Cloud
NSURLConnection

NSOperation

Core Data
Data and Cloud
AFNetworking

NSURL *url = [NSURL URLWithString:@"https://alpha-api.app.net/
stream/0/posts/stream/global"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request success:^(NSURLRequest
*request, NSHTTPURLResponse *response, id JSON) {!
NSLog(@"App.net Global Stream: %@", JSON);!
} failure:nil];!
[operation start];

NSURLConnection

NSOperation

Core Data
Data and Cloud

REST

KIT
AFNetworking

NSURLConnection

NSOperation

Core Data
Data and Cloud

REST

AFNetworking

NSURLConnection

KIT

NSOperation

Core Data
Data and Cloud - RestKit

Data
Mapping

REST

AFNetworking

NSURLConnection

KIT

NSOperation

Core Data
RestKit example
@interface RKTweet NSObject!
@interface RKTweet : : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
@end!
!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!

!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:
[mapping class]];!
[RKTweet addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.id":
@"userID",!
@"user.name": @"text"!
@"username",!
@"text":
@"userID",!
}];! @"user.id":
!
@"text":
@"text"!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
}];
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!

!

NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
statusCodes:nil];! URLWithString:@"http://api.twitter.com/1/statuses/
NSURL *url = [NSURL
public_timeline.json"];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/
NSURLRequest *request = [NSURLRequest
statuses/public_timeline.json"];! requestWithURL:url];!
RKObjectRequestOperation [NSURLRequest requestWithURL:url];!
NSURLRequest *request = *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
alloc] initWithRequest:request
*operation, RKMappingResult *result) {!
responseDescriptors:@[responseDescriptor]];
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
} failure:nil];!
[operation start];
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
Next Step
NSIncrementalStore

NSURLConnection

NSOperation

Core Data
Next Step
AFNetworking

NSIncrementalStore

NSURLConnection

NSOperation

Core Data
Next Step

AFNetworking

NSURLConnection

NSIncrementalStore

NSOperation

Core Data
Next Step - Data Sync
AFIncrementalStore

AFNetworking

NSURLConnection

NSIncrementalStore

NSOperation

Core Data
a snap into AFIncrementalStore
usual

unusual

YOUR CODE

YOUR CODE

RESTful server

CoreData
framework

CoreData
framework
+
AF
Incremental
Store

AFNetworking
working with AFIncrementalStore
is the same as with CoreData
@interface
TasksViewController()<NSFetchedResultsControllerDelegate>!
@property NSFetchedResultsController *fetchedResultsController;!
@end!
!
- (UITableViewCell *)tableView:(UITableView *)tableView!
cellForRowAtIndexPath:(NSIndexPath *)indexPath !
{!

...!
[self configureCell:cell forRowAtIndexPath:indexPath];!
return cell;!
}!
!
- (void)configureCell:(UITableViewCell *)cell !
forRowAtIndexPath:(NSIndexPath *)indexPath !
{!
NSManagedObject *managedObject = [self.fetchedResultsController
objectAtIndexPath:indexPath];!
cell.textLabel.text = [managedObject valueForKey:@"text"];!
?
?
?

Business Logic
AFIncrementalStore
⦿Push Notifications
⦿InAppPurchase

⦿ Analytics
⦿ Passbook
⦿ Newsstand

Sync.

with just one command...*

#	
  helios	
  server
Helios-ready iOS frameworks
Antenna

Cargo Bay

Extensible Remote Logging

The Essential StoreKit
Companion

Orbiter

AFIncrementalStore

Push Notification
Registration

Core Data Persistence with
AFNetworking, Done Right

SkyLab
Multivariate & A/B Testing

Ground Control
Remote Configuration

AFNetworking
A Delightful iOS & OS X
Networking Framework
Cocoa Pods
http://cocoapods.org
$ [sudo] gem install cocoapods
$ pod setup
myproject$ pod install
Podfile example:
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.0.3’
pod 'ICViewPager', '~> 1.5’

RestKit
AFNetworking
AFIncrementalStore
AFAmazonS3Client
...
https://github.com/
CocoaPods/Specs
Testing
★

many frameworks comes with tests, bros

KIF

FRANK

https://github.com/kif-framework/KIF
https://github.com/moredip/Frank
KIF
★
★
★

leveraging the accessibility attributes
conducted synchronously in the main thread
uses undocumented Apple APIs

- (void)testSuccessfulLogin!
{!
[tester enterText:@"user@example.com"
intoViewWithAccessibilityLabel:@"Login User Name"];!
[tester enterText:@"thisismypassword"
intoViewWithAccessibilityLabel:@"Login Password"];!
[tester tapViewWithAccessibilityLabel:@"Log In"];!
!
// Verify that the login succeeded!
[tester waitForTappableViewWithAccessibilityLabel:@"Welcome"];!
}
★
★
★
★

FRANK

from outer ruby space ‘cucumber’
'Selenium for native iOS apps'.
uses undocumented Apple APIs
totally different approach to testing in iOS

Feature: Various scenarios that exercise different parts of Frank!
!
Background:!
Given I launch the app !
!
Scenario: Counting number of rows in a table section!
Then I should see 3 rows in section 0!
!
Scenario: Scrolling to the bottom of the table !
When I touch "Larry Stooge"!
And I touch "User Roles"!
Then I should not see "Returns"!
When I scroll to the bottom of the table!
Then I should see "Returns"
READY TO USE CLOUDS
★Deployd.com
- free to use
- javascript based
★★Parse.com
-all essential platforms supported
-“out of the box” basic data entities
-free to test
★★★APIgee.com (books & webcasts)
- developer console to popular services
- intermediate data processing (eg.
-

convert xml to json, mapping, etc)
free to test
Oleg.Shanyuk@gmail.com
@gelosi - http://obrij.com

AFNetworking, AFIncrementalStore, AF***
https://github.com/helios-framework/helios
RESTKit - https://github.com/RestKit/RestKit
CocoaPods - http://cocoapods.org
Follow: @mattt, @soffes, @gruber, @edog1203

More Related Content

PPT
Web Services with Objective-C
PPT
Connecting to a REST API in iOS
PPTX
Using Webservice in iOS
PDF
Difference between xml and json
PDF
Client Server Communication on iOS
PDF
Intro to Core Data
PDF
iOS: Web Services and XML parsing
PPT
Web Services with Objective-C
Connecting to a REST API in iOS
Using Webservice in iOS
Difference between xml and json
Client Server Communication on iOS
Intro to Core Data
iOS: Web Services and XML parsing

What's hot (20)

PDF
Angular - Chapter 7 - HTTP Services
PPTX
Node js crash course session 3
PPTX
Node js crash course session 5
PDF
Angular - Chapter 9 - Authentication and Authorization
PPTX
Web Technologies - forms and actions
PDF
FITC presents: Mobile & offline data synchronization in Angular JS
PDF
Getting started with MongoDB and Scala - Open Source Bridge 2012
PDF
Paris Tech Meetup talk : Troubles start at version 1.0
PDF
Dynamic content generation
PPTX
Introduction about-ajax-framework
PDF
Elastic Search
PDF
Angular - Chapter 6 - Firebase Integration
PDF
Scala with mongodb
PDF
Electron, databases, and RxDB
PDF
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
PPTX
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
PDF
Change RelationalDB to GraphDB with OrientDB
PDF
AJAX - An introduction
PDF
[2015/2016] Local data storage for web-based mobile apps
Angular - Chapter 7 - HTTP Services
Node js crash course session 3
Node js crash course session 5
Angular - Chapter 9 - Authentication and Authorization
Web Technologies - forms and actions
FITC presents: Mobile & offline data synchronization in Angular JS
Getting started with MongoDB and Scala - Open Source Bridge 2012
Paris Tech Meetup talk : Troubles start at version 1.0
Dynamic content generation
Introduction about-ajax-framework
Elastic Search
Angular - Chapter 6 - Firebase Integration
Scala with mongodb
Electron, databases, and RxDB
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Change RelationalDB to GraphDB with OrientDB
AJAX - An introduction
[2015/2016] Local data storage for web-based mobile apps
Ad

Similar to mobile in the cloud with diamonds. improved. (20)

PDF
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
KEY
RESTfull with RestKit
KEY
Introduction to Restkit
PDF
Everybody Loves AFNetworking ... and So Can you!
PDF
Rails and iOS with RestKit
PDF
Techfest 2013 No RESTKit for the Weary
PDF
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
ZIP
iPhone and Rails integration
PDF
REST in theory
PDF
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
PDF
- Webexpo 2010
PDF
Developing iOS REST Applications
KEY
RubyMotion
PDF
Xamarin Workshop Noob to Master – Week 5
PPTX
Introduction to Web Services
PDF
Elements for an iOS Backend
PPTX
Design Beautiful REST + JSON APIs
PDF
The Developer Conference - CloudKit, entendendo a Cloud da Apple
PDF
Rethinking Syncing at AltConf 2019
PPTX
What's Parse
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
RESTfull with RestKit
Introduction to Restkit
Everybody Loves AFNetworking ... and So Can you!
Rails and iOS with RestKit
Techfest 2013 No RESTKit for the Weary
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
iPhone and Rails integration
REST in theory
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
- Webexpo 2010
Developing iOS REST Applications
RubyMotion
Xamarin Workshop Noob to Master – Week 5
Introduction to Web Services
Elements for an iOS Backend
Design Beautiful REST + JSON APIs
The Developer Conference - CloudKit, entendendo a Cloud da Apple
Rethinking Syncing at AltConf 2019
What's Parse
Ad

Recently uploaded (20)

PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PPTX
Microsoft User Copilot Training Slide Deck
PPTX
Training Program for knowledge in solar cell and solar industry
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
4 layer Arch & Reference Arch of IoT.pdf
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
Advancing precision in air quality forecasting through machine learning integ...
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Module 1 Introduction to Web Programming .pptx
Rapid Prototyping: A lecture on prototyping techniques for interface design
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
sustainability-14-14877-v2.pddhzftheheeeee
Comparative analysis of machine learning models for fake news detection in so...
Improvisation in detection of pomegranate leaf disease using transfer learni...
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Microsoft User Copilot Training Slide Deck
Training Program for knowledge in solar cell and solar industry
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Convolutional neural network based encoder-decoder for efficient real-time ob...
4 layer Arch & Reference Arch of IoT.pdf
Build Your First AI Agent with UiPath.pptx
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Basics of Cloud Computing - Cloud Ecosystem
Advancing precision in air quality forecasting through machine learning integ...
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf

mobile in the cloud with diamonds. improved.

  • 1. MOBILE IN THE CLOUD WITH DIAMONDS 2013 2013
  • 3. Mobile & Cloud Content Bicycles we ride Essential frameworks Advanced frameworks Wondertools You don't test me Backends Imagination
  • 4. mobile and the internets m
  • 5. Developer’s dilemma ★ ★ ★ faster know how solves the problem VS FRAMEWORKS ★ ★ ★ tested independent supported
  • 6. FRAMEWORKS That could be a pain RESTawful services
  • 10. Data and Cloud AFNetworking NSURL *url = [NSURL URLWithString:@"https://alpha-api.app.net/ stream/0/posts/stream/global"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {! NSLog(@"App.net Global Stream: %@", JSON);! } failure:nil];! [operation start]; NSURLConnection NSOperation Core Data
  • 13. Data and Cloud - RestKit Data Mapping REST AFNetworking NSURLConnection KIT NSOperation Core Data
  • 14. RestKit example @interface RKTweet NSObject! @interface RKTweet : : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! @end! ! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 15. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! ! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! RKObjectMapping *mapping = [RKObjectMapping mappingForClass: [mapping class]];! [RKTweet addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! [mapping addAttributeMappingsFromDictionary:@{! @"user.id": @"userID",! @"user.name": @"text"! @"username",! @"text": @"userID",! }];! @"user.id": ! @"text": @"text"! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor }]; responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! ! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! ! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 16. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! statusCodes:nil];! URLWithString:@"http://api.twitter.com/1/statuses/ NSURL *url = [NSURL public_timeline.json"];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/ NSURLRequest *request = [NSURLRequest statuses/public_timeline.json"];! requestWithURL:url];! RKObjectRequestOperation [NSURLRequest requestWithURL:url];! NSURLRequest *request = *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation alloc] initWithRequest:request *operation, RKMappingResult *result) {! responseDescriptors:@[responseDescriptor]]; NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 17. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! } failure:nil];! [operation start]; [operation start];
  • 18. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 22. Next Step - Data Sync AFIncrementalStore AFNetworking NSURLConnection NSIncrementalStore NSOperation Core Data
  • 23. a snap into AFIncrementalStore usual unusual YOUR CODE YOUR CODE RESTful server CoreData framework CoreData framework + AF Incremental Store AFNetworking
  • 24. working with AFIncrementalStore is the same as with CoreData @interface TasksViewController()<NSFetchedResultsControllerDelegate>! @property NSFetchedResultsController *fetchedResultsController;! @end! ! - (UITableViewCell *)tableView:(UITableView *)tableView! cellForRowAtIndexPath:(NSIndexPath *)indexPath ! {! ...! [self configureCell:cell forRowAtIndexPath:indexPath];! return cell;! }! ! - (void)configureCell:(UITableViewCell *)cell ! forRowAtIndexPath:(NSIndexPath *)indexPath ! {! NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];! cell.textLabel.text = [managedObject valueForKey:@"text"];!
  • 26. ⦿Push Notifications ⦿InAppPurchase ⦿ Analytics ⦿ Passbook ⦿ Newsstand Sync. with just one command...* #  helios  server
  • 27. Helios-ready iOS frameworks Antenna Cargo Bay Extensible Remote Logging The Essential StoreKit Companion Orbiter AFIncrementalStore Push Notification Registration Core Data Persistence with AFNetworking, Done Right SkyLab Multivariate & A/B Testing Ground Control Remote Configuration AFNetworking A Delightful iOS & OS X Networking Framework
  • 28. Cocoa Pods http://cocoapods.org $ [sudo] gem install cocoapods $ pod setup myproject$ pod install Podfile example: platform :ios, '7.0' pod 'AFNetworking', '~> 2.0.3’ pod 'ICViewPager', '~> 1.5’ RestKit AFNetworking AFIncrementalStore AFAmazonS3Client ... https://github.com/ CocoaPods/Specs
  • 29. Testing ★ many frameworks comes with tests, bros KIF FRANK https://github.com/kif-framework/KIF https://github.com/moredip/Frank
  • 30. KIF ★ ★ ★ leveraging the accessibility attributes conducted synchronously in the main thread uses undocumented Apple APIs - (void)testSuccessfulLogin! {! [tester enterText:@"[email protected]" intoViewWithAccessibilityLabel:@"Login User Name"];! [tester enterText:@"thisismypassword" intoViewWithAccessibilityLabel:@"Login Password"];! [tester tapViewWithAccessibilityLabel:@"Log In"];! ! // Verify that the login succeeded! [tester waitForTappableViewWithAccessibilityLabel:@"Welcome"];! }
  • 31. ★ ★ ★ ★ FRANK from outer ruby space ‘cucumber’ 'Selenium for native iOS apps'. uses undocumented Apple APIs totally different approach to testing in iOS Feature: Various scenarios that exercise different parts of Frank! ! Background:! Given I launch the app ! ! Scenario: Counting number of rows in a table section! Then I should see 3 rows in section 0! ! Scenario: Scrolling to the bottom of the table ! When I touch "Larry Stooge"! And I touch "User Roles"! Then I should not see "Returns"! When I scroll to the bottom of the table! Then I should see "Returns"
  • 32. READY TO USE CLOUDS ★Deployd.com - free to use - javascript based ★★Parse.com -all essential platforms supported -“out of the box” basic data entities -free to test ★★★APIgee.com (books & webcasts) - developer console to popular services - intermediate data processing (eg. - convert xml to json, mapping, etc) free to test
  • 33. [email protected] @gelosi - http://obrij.com AFNetworking, AFIncrementalStore, AF*** https://github.com/helios-framework/helios RESTKit - https://github.com/RestKit/RestKit CocoaPods - http://cocoapods.org Follow: @mattt, @soffes, @gruber, @edog1203