SlideShare una empresa de Scribd logo
1 de 23
AFNetworking

       Houston iPhone Developers Meetup
                      October 25th, 2011
2
Who?
• Full time contractiOSdeveloper out ofTheWoodlands
     • Contact me athttp://ipanemalabs.com
• Founderof Houston iPhone Developers Meetup
• Organizer of Houston PHP Users Group
• Personal iPhone apps onstoresince 2008
• Personal site athttp://pessoal.org




AFNetworking
3
Tonight’s session
• Overview of what AFNetworking provides
     • Background on the project
     • Alternatives to it
• Bunch of code examples
• Feel free to ask questions




AFNetworking
4
Background
• Open-source library shared by Gowalla
    • Available at https://github.com/gowalla/AFNetworking
• Created in the development of Gowalla for iPhone
    • Inspired by an Apple sample project (MVC Networking)
• Uses Objective-C blocks for everything (requires iOS 4+)
• MIT license




AFNetworking
5
More background
• Main authors very active behind the project
    • Mattt Thompson - http://mattt.me
    • Scott Raymond - http://scottraymond.net




AFNetworking
6
Alternatives
• ASIHTTPRequest
    • Convenience wrapper with lots of useful features
    • Author decided to stop maintaining it
• NSURLConnection
    • Lots of tedious / boilerplate code to manage HTTP requests
• Other options
    • RestKit - http://restkit.org
    • SVHTTPRequest - http://github.com/samvermette/SVHTTPRequest



AFNetworking
7
AFNetworking features
• Uses NSOperation for scheduling and concurrency
• Blocks for request completion / failure callbacks
• Convenience features:
     • Requests for JSON, XML, Image data, etc
     • File upload with progress callback
     • API client request




AFNetworking
8
Installation
• Clone AFNetworking github project
• Copy “AFNetworking” sub-folder to your own Xcode project
• Clone JSONKit github project
    • https://github.com/johnezang/JSONKit
• Copy JSONKit.h and JSONKit.m to your own Xcode project




AFNetworking
9
Great documentation
• Provides appledoc compatible documentation
    • Appledoc available at https://github.com/tomaz/appledoc
• git clone https://github.com/tomaz/appledoc.git
    • sudo sh install-appledoc.sh
    • Installs on /usr/local/bin
• git clone https://github.com/gowalla/AFNetworking.git
    • cd AFNetworking
    • appledoc -p AFNetworking -c "Gowalla" --company-id com.gowalla
    AFNetworking/*.h


AFNetworking
10
Documentation




AFNetworking
11
Blocks
• Closures for Objective-C
    • Similar in nature to JavaScript closures, but slightly different
    • Great for callback-centric code
    • Available since iOS 4
    • Used a lot in Grand Central Dispatch (GCD)
• Great introduction documentation available from Apple
    • http://developer.apple.com/library/ios/#documentation/cocoa/Conceptu
    al/Blocks/Articles/00_Introduction.html



AFNetworking
12
Blocks




AFNetworking
13
Core classes
• Library core is AFURLConnectionOperation
    • NSOperation subclass to make asynchronous requests
• Subclasses
    • AFJSONRequestOperation – JSON requests
    • AFXMLRequestOperation – XML requests
    • AFPropertyListRequestOperation – Plist requests
    • AFImageRequestOperation – Image requests




AFNetworking
14
JSON request
• Dependency on JSONKit
• Very high performance JSON library
• Benchmark results available at https://github.com/johnezang/JSONKit
    • Claimed to be faster than parsing/serializing binary plists.
    • Results contested by TouchJSON author




AFNetworking
15
JSON request




AFNetworking
16
XML request
• Similar to JSON request, but no automatic parsing of payload
• Block callback allows you to kick off the XML parsing




AFNetworking
17
XML request




AFNetworking
18
Image request
• Load remote images on UIImageView asynchronously
     • Alternative to EGOImageView and similar libraries
• Great on table view cells, async requests get canceled as cells are re-used
• Simple interface to load images
     • -[UIImageView setImageWithURL:placeholderImage:]
     • More control available through a different method




AFNetworking
19
Image request




AFNetworking
20
API request
• AFHTTPClient at the core
    • Detects appropriate operation for each request
    • AFGowallaAPIClient subclass of that
• Easy to extend core class with the business logic for your own web service
implementation




AFNetworking
21
AFGowallaAPIClient




AFNetworking
22
More information
• AFNetworking post on Gowalla’s Engineering blog
    • http://engineering.gowalla.com/2011/10/24/afnetworking/
• Github pages
    • Great information on issue list, network graph
• Mattt’s profile page - https://github.com/mattt/
    • TTTAttributedLabel - https://github.com/mattt/TTTAttributedLabel
    • FormatterKit - https://github.com/mattt/FormatterKit




AFNetworking
Contact:

Más contenido relacionado

La actualidad más candente

Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Serdar Basegmez
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksSasha dos Santos
 
Laravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessorsLaravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessorsMoon Technolabs Pvt. Ltd.
 
App forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with IonicApp forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with Ionicrobgalvinjr
 
SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkyPablo Godel
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 serversMark Myers
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaGeorge Wilson
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
DanNotes XPages Mobile Controls
DanNotes XPages Mobile ControlsDanNotes XPages Mobile Controls
DanNotes XPages Mobile ControlsPaul Withers
 
Wikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapWikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapTed Chien
 
Apps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapApps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapChristian Grobmeier
 
Plugin architecture (Extensible Application Architecture)
Plugin architecture (Extensible Application Architecture)Plugin architecture (Extensible Application Architecture)
Plugin architecture (Extensible Application Architecture)Chinmoy Mohanty
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsAlexander Meijers
 
Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript Leonardo Farias
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentPaul Withers
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopwareSander Mangel
 
Mobile App Development Using Appcelerator and DNN WebAPIs
Mobile App Development Using Appcelerator and DNN WebAPIsMobile App Development Using Appcelerator and DNN WebAPIs
Mobile App Development Using Appcelerator and DNN WebAPIsDNN
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkTroy Miles
 
Cross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache CordovaCross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache CordovaIvano Malavolta
 

La actualidad más candente (20)

Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
 
An overview of mobile html + java script frameworks
An overview of mobile html + java script frameworksAn overview of mobile html + java script frameworks
An overview of mobile html + java script frameworks
 
Laravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessorsLaravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessors
 
App forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with IonicApp forum2015 London - Building RhoMobile Applications with Ionic
App forum2015 London - Building RhoMobile Applications with Ionic
 
SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSky
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
DanNotes XPages Mobile Controls
DanNotes XPages Mobile ControlsDanNotes XPages Mobile Controls
DanNotes XPages Mobile Controls
 
Wikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGapWikipedia Mobile App with PhoneGap
Wikipedia Mobile App with PhoneGap
 
Xamarin v.Now
Xamarin v.NowXamarin v.Now
Xamarin v.Now
 
Apps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapApps with Apache Cordova and Phonegap
Apps with Apache Cordova and Phonegap
 
Plugin architecture (Extensible Application Architecture)
Plugin architecture (Extensible Application Architecture)Plugin architecture (Extensible Application Architecture)
Plugin architecture (Extensible Application Architecture)
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript Titanium: Native Mobile Apps with Javascript
Titanium: Native Mobile Apps with Javascript
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino Development
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
 
Mobile App Development Using Appcelerator and DNN WebAPIs
Mobile App Development Using Appcelerator and DNN WebAPIsMobile App Development Using Appcelerator and DNN WebAPIs
Mobile App Development Using Appcelerator and DNN WebAPIs
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
Cross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache CordovaCross-platform mobile apps with Apache Cordova
Cross-platform mobile apps with Apache Cordova
 

Destacado

Advance Sqlite3
Advance Sqlite3Advance Sqlite3
Advance Sqlite3Raghu nath
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorialprathap kumar
 
Advance sqlite3
Advance sqlite3Advance sqlite3
Advance sqlite3Raghu nath
 
Money market-1196263725939724-3[1]
Money market-1196263725939724-3[1]Money market-1196263725939724-3[1]
Money market-1196263725939724-3[1]Romit Jain
 
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....Racharla Rohit Varma
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)Raghu nath
 
System outputs - Computer System
System outputs - Computer SystemSystem outputs - Computer System
System outputs - Computer SystemAhmad Idrees
 
Building an Angular 2 App
Building an Angular 2 AppBuilding an Angular 2 App
Building an Angular 2 AppFelix Gessert
 
Oracle SQL Basics by Ankur Raina
Oracle SQL Basics by Ankur RainaOracle SQL Basics by Ankur Raina
Oracle SQL Basics by Ankur RainaAnkur Raina
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Basics of Object Oriented Programming
Basics of Object Oriented ProgrammingBasics of Object Oriented Programming
Basics of Object Oriented ProgrammingAbhilash Nair
 

Destacado (20)

Expansión La Guerra En Las Regiones
Expansión   La Guerra En Las RegionesExpansión   La Guerra En Las Regiones
Expansión La Guerra En Las Regiones
 
Advance Sqlite3
Advance Sqlite3Advance Sqlite3
Advance Sqlite3
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
Advance sqlite3
Advance sqlite3Advance sqlite3
Advance sqlite3
 
Money market-1196263725939724-3[1]
Money market-1196263725939724-3[1]Money market-1196263725939724-3[1]
Money market-1196263725939724-3[1]
 
E
EE
E
 
DBMS UNIT1
DBMS UNIT1DBMS UNIT1
DBMS UNIT1
 
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
System outputs - Computer System
System outputs - Computer SystemSystem outputs - Computer System
System outputs - Computer System
 
Building an Angular 2 App
Building an Angular 2 AppBuilding an Angular 2 App
Building an Angular 2 App
 
Oracle SQL Basics by Ankur Raina
Oracle SQL Basics by Ankur RainaOracle SQL Basics by Ankur Raina
Oracle SQL Basics by Ankur Raina
 
Programming in Java
Programming in JavaProgramming in Java
Programming in Java
 
Os Owens
Os OwensOs Owens
Os Owens
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Sqlite tutorial
Sqlite tutorialSqlite tutorial
Sqlite tutorial
 
Basics of Object Oriented Programming
Basics of Object Oriented ProgrammingBasics of Object Oriented Programming
Basics of Object Oriented Programming
 

Similar a AFNetworking

Zero to the Cloud with @NetflixOSS
Zero to the Cloud with @NetflixOSSZero to the Cloud with @NetflixOSS
Zero to the Cloud with @NetflixOSSMike McGarr
 
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.comIntroduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.comChristopher Cubos
 
360|Flex Recap - San Jose 2010
360|Flex Recap - San Jose 2010360|Flex Recap - San Jose 2010
360|Flex Recap - San Jose 2010David Ortinau
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntfUlrich Krause
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchHoward Greenberg
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidChris Hardy
 
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13Dominopoint - Italian Lotus User Group
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Nuxeo
 
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)Jonathan Engelsma
 
The Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgeThe Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgePhil Pursglove
 
Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...
Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...
Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...mfrancis
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyKyle Drake
 
The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010Phil Pursglove
 
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010IrishDev.com
 
The State of WebSockets in Django
The State of WebSockets in DjangoThe State of WebSockets in Django
The State of WebSockets in DjangoRami Sayar
 

Similar a AFNetworking (20)

Zero to the Cloud with @NetflixOSS
Zero to the Cloud with @NetflixOSSZero to the Cloud with @NetflixOSS
Zero to the Cloud with @NetflixOSS
 
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.comIntroduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
 
360|Flex Recap - San Jose 2010
360|Flex Recap - San Jose 2010360|Flex Recap - San Jose 2010
360|Flex Recap - San Jose 2010
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Dd13.2013.milano.open ntf
Dd13.2013.milano.open ntfDd13.2013.milano.open ntf
Dd13.2013.milano.open ntf
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
 
Planidoo & Zotonic
Planidoo & ZotonicPlanidoo & Zotonic
Planidoo & Zotonic
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
Introduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for AndroidIntroduction to MonoTouch and Monodroid/Mono for Android
Introduction to MonoTouch and Monodroid/Mono for Android
 
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Wikipedia Cloud Search Webinar
Wikipedia Cloud Search WebinarWikipedia Cloud Search Webinar
Wikipedia Cloud Search Webinar
 
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
 
The Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgeThe Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen Cambridge
 
Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...
Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...
Experiences from Building the Fastest OSGi Container on the Planet - Jaroslav...
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
 
The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010
 
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
The State of WebSockets in Django
The State of WebSockets in DjangoThe State of WebSockets in Django
The State of WebSockets in Django
 

Más de joaopmaia

Core Data presentation
Core Data presentationCore Data presentation
Core Data presentationjoaopmaia
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniquesjoaopmaia
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniquesjoaopmaia
 
Meetup uikit programming
Meetup uikit programmingMeetup uikit programming
Meetup uikit programmingjoaopmaia
 
Web App Testing With Selenium
Web App Testing With SeleniumWeb App Testing With Selenium
Web App Testing With Seleniumjoaopmaia
 
Eventum Presentation
Eventum PresentationEventum Presentation
Eventum Presentationjoaopmaia
 
Form Validation NG
Form Validation NGForm Validation NG
Form Validation NGjoaopmaia
 

Más de joaopmaia (7)

Core Data presentation
Core Data presentationCore Data presentation
Core Data presentation
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
Meetup uikit programming
Meetup uikit programmingMeetup uikit programming
Meetup uikit programming
 
Web App Testing With Selenium
Web App Testing With SeleniumWeb App Testing With Selenium
Web App Testing With Selenium
 
Eventum Presentation
Eventum PresentationEventum Presentation
Eventum Presentation
 
Form Validation NG
Form Validation NGForm Validation NG
Form Validation NG
 

Último

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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 Scriptwesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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...Drew Madelung
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

AFNetworking

  • 1. AFNetworking Houston iPhone Developers Meetup October 25th, 2011
  • 2. 2 Who? • Full time contractiOSdeveloper out ofTheWoodlands • Contact me athttp://ipanemalabs.com • Founderof Houston iPhone Developers Meetup • Organizer of Houston PHP Users Group • Personal iPhone apps onstoresince 2008 • Personal site athttp://pessoal.org AFNetworking
  • 3. 3 Tonight’s session • Overview of what AFNetworking provides • Background on the project • Alternatives to it • Bunch of code examples • Feel free to ask questions AFNetworking
  • 4. 4 Background • Open-source library shared by Gowalla • Available at https://github.com/gowalla/AFNetworking • Created in the development of Gowalla for iPhone • Inspired by an Apple sample project (MVC Networking) • Uses Objective-C blocks for everything (requires iOS 4+) • MIT license AFNetworking
  • 5. 5 More background • Main authors very active behind the project • Mattt Thompson - http://mattt.me • Scott Raymond - http://scottraymond.net AFNetworking
  • 6. 6 Alternatives • ASIHTTPRequest • Convenience wrapper with lots of useful features • Author decided to stop maintaining it • NSURLConnection • Lots of tedious / boilerplate code to manage HTTP requests • Other options • RestKit - http://restkit.org • SVHTTPRequest - http://github.com/samvermette/SVHTTPRequest AFNetworking
  • 7. 7 AFNetworking features • Uses NSOperation for scheduling and concurrency • Blocks for request completion / failure callbacks • Convenience features: • Requests for JSON, XML, Image data, etc • File upload with progress callback • API client request AFNetworking
  • 8. 8 Installation • Clone AFNetworking github project • Copy “AFNetworking” sub-folder to your own Xcode project • Clone JSONKit github project • https://github.com/johnezang/JSONKit • Copy JSONKit.h and JSONKit.m to your own Xcode project AFNetworking
  • 9. 9 Great documentation • Provides appledoc compatible documentation • Appledoc available at https://github.com/tomaz/appledoc • git clone https://github.com/tomaz/appledoc.git • sudo sh install-appledoc.sh • Installs on /usr/local/bin • git clone https://github.com/gowalla/AFNetworking.git • cd AFNetworking • appledoc -p AFNetworking -c "Gowalla" --company-id com.gowalla AFNetworking/*.h AFNetworking
  • 11. 11 Blocks • Closures for Objective-C • Similar in nature to JavaScript closures, but slightly different • Great for callback-centric code • Available since iOS 4 • Used a lot in Grand Central Dispatch (GCD) • Great introduction documentation available from Apple • http://developer.apple.com/library/ios/#documentation/cocoa/Conceptu al/Blocks/Articles/00_Introduction.html AFNetworking
  • 13. 13 Core classes • Library core is AFURLConnectionOperation • NSOperation subclass to make asynchronous requests • Subclasses • AFJSONRequestOperation – JSON requests • AFXMLRequestOperation – XML requests • AFPropertyListRequestOperation – Plist requests • AFImageRequestOperation – Image requests AFNetworking
  • 14. 14 JSON request • Dependency on JSONKit • Very high performance JSON library • Benchmark results available at https://github.com/johnezang/JSONKit • Claimed to be faster than parsing/serializing binary plists. • Results contested by TouchJSON author AFNetworking
  • 16. 16 XML request • Similar to JSON request, but no automatic parsing of payload • Block callback allows you to kick off the XML parsing AFNetworking
  • 18. 18 Image request • Load remote images on UIImageView asynchronously • Alternative to EGOImageView and similar libraries • Great on table view cells, async requests get canceled as cells are re-used • Simple interface to load images • -[UIImageView setImageWithURL:placeholderImage:] • More control available through a different method AFNetworking
  • 20. 20 API request • AFHTTPClient at the core • Detects appropriate operation for each request • AFGowallaAPIClient subclass of that • Easy to extend core class with the business logic for your own web service implementation AFNetworking
  • 22. 22 More information • AFNetworking post on Gowalla’s Engineering blog • http://engineering.gowalla.com/2011/10/24/afnetworking/ • Github pages • Great information on issue list, network graph • Mattt’s profile page - https://github.com/mattt/ • TTTAttributedLabel - https://github.com/mattt/TTTAttributedLabel • FormatterKit - https://github.com/mattt/FormatterKit AFNetworking