mobilecamp boston - ios frameworks
DESCRIPTION
My talk at MobileCamp Boston, Feb 19 2011. The deck covers materials for constructing a simple Twitter reader using Three20 and RESTKit frameworks.TRANSCRIPT
iOS Frameworks
Samuel Chow, MobyFab@Cybersam
End-to-End Platform
• More apps are connected to remote RESTful endpoints for richer content and user experience
• Better visuals + HTTP connection + JSON parser
iOS Frameworks
• REST– ASIHTTPRequest –
http://allseeing-i.com/ASIHTTPRequest/ – JSON Framework (aka SBJSON) –
http://stig.github.com/json-framework/ – YAJL – http://github.com/gabriel/yajl-objc – RESTKit – http://getsharekit.com/– ShareKit – http://getsharekit.com/
• Visual– Three20 – http://three20.info– Core-Plot – http://code.google.com/p/core-plot/
Three20 Visual
• Out of the box, you get these for freeCustom Views and Buttons Tab and Grid Table Items
LabelsSpecial View Controllers
Three20 Non-visual Utilities
• Network Caching• Remote image retrieval• Data persistence• HTTP Request/Response• JSON parsing (via JBSON or YAJL)• View navigation• CSS-like styling mode
Three20 Object Flow
Three20 Object Flow
- Data representation- Prepare to send request- Parse response
- Transform data objects to table items- navigation URLs
- Visual configuration- Visual layout
Demo
http://api.twitter.com/1/statuses/public_timeline.json
Low-level vs High-level
• Three20 and common REST Frameworks– Too much time spent on crafting request, parsing
responses, and creating representation of remote data
• Enter RESTKit– High-level abstraction of REST operations– It enables you to focus on modeling RESTful objects to
your in-memory object
• Conversely, if you want lower level, more complete HTTP swiss-army knife then consider ASIHTTPRequest
Three20 + RESTKit Integration
• RESTKit provides the RKRequestTTModel as a convenient class for integration with Three20
• No need to supply the parsing logic in requestDidFinishLoad:
• Simply map the data object properties to the JSON elements
• Supply the URL (host and path)• RESTKit will do the heavy lifting for you
Thank You
DOWNLOAD CODE + PRESENTATION SLIDES
FROMHTTP://CYBERSAM.COM/
Reference and credit: Blake Watters, Two Toasters, and Three20