例子是一些为了说明 iOS、Android 以及 OS X 的部分特性而开发的小项目。你可以方便的在你的设备上运行这些代码或者去阅读这些代码。如果您乐意,我们非常希望您可以向我们的例子代码库贡献代码。
例子
iOS
Beers
Lists locations on a map and table, and display their Wikipedia page in a web view.
tab bar table view map view web view
GestureTable
Builds a table view controlled by custom gestures for edition.
table view table view cell gestures
Locations
Takes the current location and saves it into Core Data.
table view core location core data
Paint
Draws paths following move gestures, clears the view upon shake.
custom view drawing bezier path gestures audio player
RedditSearch
Searches Reddit and displays results in a custom table view.
table view table view cell grand central dispatch networking json
SpaceRocks
A simple SpriteKit game, demonstrating the use of scenes, nodes and physics bodies.
sprite kit
TicTacToe
A version of the popular Tic-tac-toe game written using custom views and touch events.
touches
Trollify
How to retrieve an image from the camera roll and layer another image on top of it with a gesture.
image image picker camera roll action sheet gestures
Android
Conference
An app with a navigaton drawer, custom list views and map view via Google Play Services.
linear layout list view map view navigation drawer
Weather
An app that uses Google's networking framework Volley to fetch and parse a JSON feed.
networking json
WebViewDemo
An app that exposes an object to an HTML/Javascript backend via a web view.
web view javascript
OS X
CircleView
Shows how to customize text layout and drawing within a timer-based custom view.
custom view events affine transform text layout timer
FlickrBrowser
Searches Flickr's Atom feed and displays results in an image browser view.
image kit pub sub grand central dispatch notifications
PagePacker
A fully-featured booklet creation app demonstrating a lot of Cocoa concepts.
pdf kit custom view dragging scripting undo manager notifications
PathDemo
Demonstrates various bezier path drawings in a custom view that can also be printed.
bezier path custom view drawing print
RssReader
Lists the content of a remote RSS file in a table view.
table view xml grand central dispatch
Temperature Converter
A form-based app that converts and formats different units.
form bindings value transformer number formatter user defaults