• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Three20-final: Three20源代码已经被facebook在github删除了,现在我这个版本是three2 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Three20-final

开源软件地址:

https://gitee.com/shede333/three20-final

开源软件介绍:

Three20

2013_07_16我恢复了Three20最后一次有效的提交 by shede333

=======

Three20 is a collection of iPhone UI classes, like a photo viewer, and generalutilities, like an HTTP disk cache. Three20 is derived from theFacebook iPhone app, which is one of the most downloaded iPhone apps ever.

Community

If you would like to ask any questions regarding Three20, please check out any of the following:

Documentation

You can access Three20 API documentation in several ways:

  1. Online: http://facebook.github.com/three20/api
  2. Within Xcode:
    1. Open your Xcode Preferences (⌘,) and switch to Documentation tab.
    2. Click the + button
    3. Add the Three20 doc set feed: feed://facebook.github.com/three20/api/com.facebook.Three20.atom
  3. Generate the documentation from the project repository with the src/scripts/docs.py script

Adding Three20 to your project

Three20 is compiled as static libraries. It use Xcode's "dependent project" facilities.There are two methods of adding Three20 to your project.

The first is with the TTModule Python Script.

The Second option is to add it to your project manually. Here is how:
Estimated time: 5 minutes.

  1. Clone the three20 git repository: git clone git://github.com/facebook/three20.git. Make sureyou store the repository in a permanent place because Xcode will need to reference the filesevery time you compile your project.

  2. Locate the "Three20.xcodeproj" file under "three20/src/Three20/". Drag Three20.xcodeproj anddrop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog willappear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project"before clicking "Add".

  3. Open the Three20 Xcode Project that you just added to your app and expand the "Dependencies"group. Select all of the projects listed there and drag them to your app as well. You shouldnow have the following list of Three20 projects added to your app:

    • Three20Core
    • Three20Network
    • Three20Style
    • Three20UICommon
    • Three20UINavigator
    • Three20UI
    • Three20
  4. Now you need to link the Three20 static libraries to your project. Select your Project Target.Under the "Build Phases" tab you will see "Link Binary With Libaries" section. Click on the"+" button, select "libThree20.a" and each of the other files, and select "Add". This will linkeach part of the Three20 framework to you app.

  5. Now you need to add Three20 as a dependency of your project, so Xcode compiles it wheneveryou compile your project. Expand the "Targets" section of the sidebar and double-click yourapplication's target. Under the "General" tab you will see a "Direct Dependencies" section.Click the "+" button, select "Three20" and each of the other libs, and click "Add Target".You do not need to add the UnitTests target for each lib.

  6. Now you need to add the bundle of images and strings to your app. Locate "Three20.bundle" under"three20/src" and drag and drop it into your project. A dialog will appear -- make sure"Create Folder References" is selected, "Copy items" is unchecked, and "Reference Type" is"Relative to Project" before clicking "Add".

  7. Now you need to add the Core Animation framework to your project. Right click on the"Frameworks" group in your project (or equivalent) and select Add > Existing Frameworks.Then locate QuartzCore.framework and add it to the project.

  8. Finally, we need to tell your project where to find the Three20 headers. Open your"Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-clickit. Add these two "$(BUILT_PRODUCTS_DIR)/../three20" and "$(BUILT_PRODUCTS_DIR)/../../three20"

  9. While you are in Project Settings, go to "Other Linker Flags" under the "Linker" section, andadd "-ObjC" and "-all_load" to the list of flags.

  10. You're ready to go. Just #import "Three20/Three20.h" anywhere you want to use Three20 classesin your project.

An Overview of Three20

Photo Viewer

TTPhotoViewController emulates Apple's Photos app with all of its flick n' pinch delight.You can supply your own "photo sources", which works similiarly to the data sources used byUITableView. Unlike Apple's Photos app, it isn't limited to photos stored locally. Yourphotos can be loaded from the network, and long lists of photos can be loaded incrementally.

Message composer

TTMessageController emulates the message composer in Apple's Mail app. You can customize itto send any kind of message you want. Include your own set of message fields, or use thestandard "To:" and "Subject:". Recipient names can be autocompleted from a data source thatyou provide.

Web image views

TTImageView makes it as easy to display an image as it is in HTML. Just supply the URLof the image, and TTImageView loads it and displays it efficiently. TTImageView also workswith the HTTP cache described below to avoid hitting the network when possible.

Internet-aware table view controllers

TTTableViewController and TTTableViewDataSource help you to build tables which loadtheir content from the Internet. Rather than just assuming you have all the data ready to go,like UITableView does by default, TTTableViewController lets you communicate when your data isloading, and when there is an error or nothing to display. It also helps you to add a "More"button to load the next page of data, and optionally supports reloading the data by shaking thedevice.

Better text fields

TTTextEditor is a UITextView which can grow in height automatically as you type. I usethis for entering messages in Facebook Chat, and it behaves similarly to the editor in Apple'sSMS app.

TTPickerTextField is a type-ahead UITextField. As you type it searches a data source, andit adds bubbles into the flow of text when you choose a type-ahead option. I use this inTTMessageController for selecting the names of message recipients.

HTTP disk cache

TTURLRequest is a replacement for NSURLRequest which supports a disk cache (NSURLRequestcan only cache in RAM). It has some other nice features too. HTTP posts are as easy assupplying a dictionary of parameters. The TTURL loading system can also be suspended andresumed at any time, which is a great performance helper. Network threads often fight withthe UI thread, so you can suspend the network any time your app is momentarily graphicallyintensive.

URL-based Navigation

TTNavigator is for those grizzled old web developers like myself who want toorganize their app by "pages" which can be displayed by visiting a URL.

Your view controllers can simply register URL patterns that they handle, and when those URLsare visited the controllers will be created and displayed. You can also register genericactions that are called when a URL is visited.

TTNavigator also persists and restores the full path of navigation controllers and modalview controllers, so your users can quit the app and come back exactly where they left off.

Learn more at Three20.info


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
landptf: 自定义控件库发布时间:2022-03-24
下一篇:
PreIOC: android预处理注解的IOC框架发布时间:2022-03-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap