SlideShare una empresa de Scribd logo
1 de 31
MOBILE IN THE CLOUD
WITH DIAMONDS
2013
Monday, June 3, 13
Monday, June 3, 13
Content
Mobile & Cloud
Dilemma
Essential frameworks
Advanced frameworks
Wondertools
Backends
Imagination
Monday, June 3, 13
mobile and the internetsmMonday, June 3, 13
VS
FRAMEWORKS
★ faster
★ know how
★ solves the problem
★ tested
★ independent
★ supported
Developer’s dilemma
Monday, June 3, 13
FRAMEWORKS
RESTawful
services
That could be a pain
Monday, June 3, 13
Core Data
Data and Cloud
Monday, June 3, 13
Core Data
Data and Cloud
NSOperation
Monday, June 3, 13
Core Data
Data and Cloud
NSOperation
NSURLConnection
Monday, June 3, 13
Core Data
Data and Cloud
NSOperationNSURLConnection
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];
Monday, June 3, 13
Core Data
Data and Cloud
NSOperationNSURLConnection
AFNetworking
Monday, June 3, 13
Core Data
Data and Cloud
NSOperationNSURLConnection
AFNetworking
KIT
REST
Monday, June 3, 13
NSOperationNSURLConnection Core Data
Data and Cloud
AFNetworking KIT
REST
Monday, June 3, 13
NSURLConnection
AFNetworking
NSOperation Core Data
KIT
REST
Data
Mapping
Data and Cloud - RestKit
Monday, June 3, 13
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];
@interface RKTweet : NSObject
@property (nonatomic, copy) NSNumber *userID;
@property (nonatomic, copy) NSString *username;
@property (nonatomic, copy) NSString *text;
@end
Monday, June 3, 13
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) {
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:
[RKTweet class]];
[mapping addAttributeMappingsFromDictionary:@{
@"user.name": @"username",
@"user.id": @"userID",
@"text": @"text"
}];
Monday, June 3, 13
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];
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]];
Monday, June 3, 13
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];
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {
NSLog(@"The public timeline Tweets: %@", [result array]);
} failure:nil];
[operation start];
Monday, June 3, 13
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];
Monday, June 3, 13
Next Step
NSURLConnection NSOperation Core Data
NSIncrementalStore
Monday, June 3, 13
Next Step
NSURLConnection NSOperation Core Data
NSIncrementalStore
AFNetworking
Monday, June 3, 13
Next Step
NSURLConnection NSOperation Core Data
NSIncrementalStoreAFNetworking
Monday, June 3, 13
NSURLConnection
AFNetworking
NSOperation
NSIncrementalStore
Core Data
AFIncrementalStore
Next Step - Data Sync
Monday, June 3, 13
a snap into AFIncrementalStore
YOUR CODE
CoreData
framework
YOUR CODE
CoreData
framework
+
AF
Incremental
Store
AFNetworking
RESTful server
unusualusual
Monday, June 3, 13
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"];
}
Monday, June 3, 13
AFIncrementalStore
?
Business Logic
?
?
Monday, June 3, 13
⦿Push Notifications
⦿InAppPurchase
⦿ Analytics
⦿ Passbook
⦿ Newsstand
Sync.
#"helios"server
with just one command...*
Monday, June 3, 13
Helios-ready iOS frameworks
AFIncrementalStore
Core Data Persistence with
AFNetworking, Done Right
AFNetworking
A Delightful iOS & OS X
Networking Framework
Antenna
Extensible Remote Logging
SkyLab
Multivariate & A/B Testing
Orbiter
Push Notification
Registration
Cargo Bay
The Essential StoreKit
Companion
Ground Control
Remote Configuration
Monday, June 3, 13
Cocoa Pods
$ [sudo] gem install cocoapods
$ pod setup
http://cocoapods.org
myproject$ edit Podfile
platform :ios, '5.0'
pod 'AFIncrementalStore', '~> 0.3.1'
pod 'AFNetworking', '~> 1.0.1'
myproject$ pod install
using to add RestKit to xcode project
RestKit
AFNetworking
AFIncrementalStore
AFAmazonS3Client
...
https://github.com/
CocoaPods/Specs
Monday, June 3, 13
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
Monday, June 3, 13
Oleg.Shanyuk@gmail.com
@gelosi - http://obrij.com
AFNetworking, AFIncrementalStore, AF***
https://github.com/helios-framework/helios
RESTKit - https://github.com/RestKit/RestKit
Follow: @mattt, @soffes, @gruber, @edog1203
CocoaPods - http://cocoapods.org
Monday, June 3, 13

Más contenido relacionado

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Mobile in the cloud with diamonds

  • 1. MOBILE IN THE CLOUD WITH DIAMONDS 2013 Monday, June 3, 13
  • 3. Content Mobile & Cloud Dilemma Essential frameworks Advanced frameworks Wondertools Backends Imagination Monday, June 3, 13
  • 4. mobile and the internetsmMonday, June 3, 13
  • 5. VS FRAMEWORKS ★ faster ★ know how ★ solves the problem ★ tested ★ independent ★ supported Developer’s dilemma Monday, June 3, 13
  • 7. Core Data Data and Cloud Monday, June 3, 13
  • 8. Core Data Data and Cloud NSOperation Monday, June 3, 13
  • 9. Core Data Data and Cloud NSOperation NSURLConnection Monday, June 3, 13
  • 10. Core Data Data and Cloud NSOperationNSURLConnection 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]; Monday, June 3, 13
  • 11. Core Data Data and Cloud NSOperationNSURLConnection AFNetworking Monday, June 3, 13
  • 12. Core Data Data and Cloud NSOperationNSURLConnection AFNetworking KIT REST Monday, June 3, 13
  • 13. NSOperationNSURLConnection Core Data Data and Cloud AFNetworking KIT REST Monday, June 3, 13
  • 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]]; [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]; @interface RKTweet : NSObject @property (nonatomic, copy) NSNumber *userID; @property (nonatomic, copy) NSString *username; @property (nonatomic, copy) NSString *text; @end Monday, June 3, 13
  • 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 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) { RKObjectMapping *mapping = [RKObjectMapping mappingForClass: [RKTweet class]]; [mapping addAttributeMappingsFromDictionary:@{ @"user.name": @"username", @"user.id": @"userID", @"text": @"text" }]; Monday, June 3, 13
  • 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, RKMappingResult *result) { NSLog(@"The public timeline Tweets: %@", [result array]); } failure:nil]; [operation start]; 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]]; Monday, June 3, 13
  • 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]; [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) { NSLog(@"The public timeline Tweets: %@", [result array]); } failure:nil]; [operation start]; Monday, June 3, 13
  • 19. 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]; Monday, June 3, 13
  • 20. Next Step NSURLConnection NSOperation Core Data NSIncrementalStore Monday, June 3, 13
  • 21. Next Step NSURLConnection NSOperation Core Data NSIncrementalStore AFNetworking Monday, June 3, 13
  • 22. Next Step NSURLConnection NSOperation Core Data NSIncrementalStoreAFNetworking Monday, June 3, 13
  • 24. a snap into AFIncrementalStore YOUR CODE CoreData framework YOUR CODE CoreData framework + AF Incremental Store AFNetworking RESTful server unusualusual Monday, June 3, 13
  • 25. 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"]; } Monday, June 3, 13
  • 27. ⦿Push Notifications ⦿InAppPurchase ⦿ Analytics ⦿ Passbook ⦿ Newsstand Sync. #"helios"server with just one command...* Monday, June 3, 13
  • 28. Helios-ready iOS frameworks AFIncrementalStore Core Data Persistence with AFNetworking, Done Right AFNetworking A Delightful iOS & OS X Networking Framework Antenna Extensible Remote Logging SkyLab Multivariate & A/B Testing Orbiter Push Notification Registration Cargo Bay The Essential StoreKit Companion Ground Control Remote Configuration Monday, June 3, 13
  • 29. Cocoa Pods $ [sudo] gem install cocoapods $ pod setup http://cocoapods.org myproject$ edit Podfile platform :ios, '5.0' pod 'AFIncrementalStore', '~> 0.3.1' pod 'AFNetworking', '~> 1.0.1' myproject$ pod install using to add RestKit to xcode project RestKit AFNetworking AFIncrementalStore AFAmazonS3Client ... https://github.com/ CocoaPods/Specs Monday, June 3, 13
  • 30. 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 Monday, June 3, 13
  • 31. Oleg.Shanyuk@gmail.com @gelosi - http://obrij.com AFNetworking, AFIncrementalStore, AF*** https://github.com/helios-framework/helios RESTKit - https://github.com/RestKit/RestKit Follow: @mattt, @soffes, @gruber, @edog1203 CocoaPods - http://cocoapods.org Monday, June 3, 13