SlideShare a Scribd company logo
1 of 21
Download to read offline
Three20

                                 (@cngump)
                         cngump@gmail.com
                     http://www.cngump.com
                    http://www.techparty.org
                                    2012.02

11   2   27
What’s Three20?

              • Three20   iPhone        320×480


              • Three20   Facebook Joe Hewitt
                      iOS     Lib




11   2   27
Three20 Feature
              • Router URL
              • CSS
              •                 UI

              • (pull to refresh,photoviewer)
              •
              •                    (json,xml)


11   2   27
Three20 Hierarchy
                            Three20
                            Launcher

                              UI
              UINavigator               Style
              UICommon                 Network
                             Core

11   2   27
Let’s Begin
              git source:
              git clone git://github.com/facebook/three20.git
              git checkout v1.1




11   2   27
Template Xcode
                Template
              >./InstallTemplates3.2.5.Command
                         Xcode            Three20


              > python three20/src/scripts/ttmodule.py -p path/to/
              myProject.xcodeproj Three20




11   2   27
URL-Based Navigation




11   2   27
TTNavigator* navigator = [TTNavigator navigator]; //    TTNavigator
     navigator.supportsShakeToReload = YES;   //
     navigator.persistenceMode = TTNavigatorPersistenceModeNone;
     ! //
     ! // TTNavigatorPersistenceModeNone
     ! // TTNavigatorPersistenceModeTop                     !
     ! // TTNavigatorPersistenceModeAll

     TTURLMap* map = navigator.URLMap;!

     [map from:@"*" toViewController:[TTWebController class]];
     ! //        Controller
     [map from:@"tt://root" toViewController:NSClassFromString(@"RootViewController")];
     ! //
     [map from:@"tt://nib/(loadFromNib:)" toSharedViewController:self];
     ! //    nib
     [map from:@"tt://nib/(loadFromNib:)/(withClass:)" toSharedViewController:self];
     ! //nib      class
     [map from:@"tt://viewController/(loadFromVC:)" toSharedViewController:self];
     ! //
     [map from:@"tt://modal/(loadFromNib:)" toModalViewController:self];
     ! //    nib            view!

     if (![navigator restoreViewControllers]) {
     ! [navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://root"]];
     ! //    URL
     }




11   2   27
Use URL

              - (void)createModel {
              self.dataSource = [TTSectionedDataSource dataSourceWithObjects:
                 @"    ",!
                         !  !   !   !
                 [TTTableTextItem itemWithText:@"   " URL:@"tt://nib/DemoTableViewController"],
                 [TTTableTextItem itemWithText:@"Twitter" URL:@"tt://nib/DemoTableViewController"],!
                 [TTTableTextItem itemWithText:@"QQ   " URL:@"tt://nib/DemoTableViewController"],
                 nil];
              }
              @end




11   2   27
Style




11   2   27
//MyStyleSheet.h
              @interface StyleSheet : TTDefaultStyleSheet {
              }
              @end

              //MyStyleSheet.m
              #import "StyleSheet.h"
              @implementation MyStyleSheet

              - (UIFont*)font {
                return [UIFont fontWithName:@"Georgia" size:11];
              }

              - (UIFont*)tableFont {
                return [UIFont fontWithName:@"Georgia" size:12];
              }


              - (UIFont*)tableHeaderPlainFont {
                return [UIFont fontWithName:@"Georgia-Bold" size:13];
              }
              @end


              //AppDelegate.m
              [TTStyleSheet setGlobalStyleSheet:[[[StyleSheet alloc] init] autorelease]];




11   2   27
Controllers
              TTViewController
              TTTableViewController
              TTWebController


              TTPhotoViewController
              TTThumbsViewController

              TTPostController
              TTMessageController

              TTLauncherViewController

11   2   27
UI


11   2   27
PhotoView
          @interface PhotoTest1Controller : TTPhotoViewController
          @end




          @implementation PhotoTest1Controller
          - (void)viewDidLoad {
            self.photoSource = [[[MockPhotoSource alloc]
              initWithType:MockPhotoSourceNormal
              title:@"Flickr Photos"
              photos:[NSArray arrayWithObjects:

              [[[MockPhoto alloc]
                initWithURL:@"http://farm4.static.flickr.com/
          3099/3164979221_6c0e583f7d.jpg?v=0"
                smallURL:@"http://farm4.static.flickr.com/
          3099/3164979221_6c0e583f7d_t.jpg"
                size:CGSizeMake(320, 480)] autorelease],

               [[[MockPhoto alloc]
                 initWithURL:@"http://farm4.static.flickr.com/
          3444/3223645618_13fe36887a_o.jpg"
                 smallURL:@"http://farm4.static.flickr.com/
          3444/3223645618_f5e2fa7fea_t.jpg"
                 size:CGSizeMake(320, 480)
                 caption:@"This is a caption."] autorelease],
          !    nil]
          !    !    !    !   !
             photos2:nil
             ] autorelease];
          }
          @end




11   2   27
TTThumbsView
          @interface PhotoTest1Controller : TTThumbsViewController
          @end




          @implementation PhotoTest1Controller
          - (void)viewDidLoad {
            self.photoSource = [[[MockPhotoSource alloc]
              initWithType:MockPhotoSourceNormal
              title:@"Flickr Photos"
              photos:[NSArray arrayWithObjects:

              [[[MockPhoto alloc]
                initWithURL:@"http://farm4.static.flickr.com/
          3099/3164979221_6c0e583f7d.jpg?v=0"
                smallURL:@"http://farm4.static.flickr.com/
          3099/3164979221_6c0e583f7d_t.jpg"
                size:CGSizeMake(320, 480)] autorelease],

               [[[MockPhoto alloc]
                 initWithURL:@"http://farm4.static.flickr.com/
          3444/3223645618_13fe36887a_o.jpg"
                 smallURL:@"http://farm4.static.flickr.com/
          3444/3223645618_f5e2fa7fea_t.jpg"
                 size:CGSizeMake(320, 480)
                 caption:@"This is a caption."] autorelease],
          !    nil]
          !    !    !    !   !
             photos2:nil
             ] autorelease];
          }
          @end




11   2   27
TTTableViewDragRefreshDelegate
              // in TTTableViewController‘s sub class
              - (id<UITableViewDelegate>)createDelegate {
              !   return [[[TTTableViewDragRefreshDelegate alloc]
                            initWithController:self] autorelease];
              }




11   2   27
Launcher
              Added in Three20 1.1 version


          //BasicLauncherViewController.h
          #import <Three20Launcher/Three20Launcher.h>
          @interface BasicLauncherViewController : TTLauncherViewController {
          }
          @end

          //BasicLauncherViewController.m
          #import "BasicLauncherViewController.h"

          @implementation BasicLauncherViewController
          - (void)viewDidLoad {
          !   [super viewDidLoad];!
          !   TTLauncherItem* item =
               [[TTLauncherItem alloc] initWithTitle: @"Item title"
                                               image: @"bundle://Icon.png"
                                                 URL: nil];
          !   [self.launcherView addItem:item animated:NO];
          !   TT_RELEASE_SAFELY(item);
          }
          @end




11   2   27
More UI in
              Three20’s samples



11   2   27
Demo Project

               MultiWeibo



11   2   27
11   2   27
Question?




11   2   27

More Related Content

Viewers also liked

SEO, SEM & SMM Schedule sample
SEO, SEM & SMM Schedule sampleSEO, SEM & SMM Schedule sample
SEO, SEM & SMM Schedule sampleLynn Holley III
 
Location baseda rengine
Location baseda rengineLocation baseda rengine
Location baseda rengineGump Law
 
我为何使用
我为何使用我为何使用
我为何使用Gump Law
 
BI 商业智能简述
BI 商业智能简述BI 商业智能简述
BI 商业智能简述Gump Law
 
Guangzhou Techparty Pre show 20110917
Guangzhou Techparty Pre show 20110917Guangzhou Techparty Pre show 20110917
Guangzhou Techparty Pre show 20110917Gump Law
 
iOS开发常用库推荐之一@techparty
iOS开发常用库推荐之一@techpartyiOS开发常用库推荐之一@techparty
iOS开发常用库推荐之一@techpartyGump Law
 
走马观花— Haskell Web 开发
走马观花— Haskell Web 开发走马观花— Haskell Web 开发
走马观花— Haskell Web 开发Gump Law
 
Marketing Automation Applications and Evaluation
Marketing Automation Applications and EvaluationMarketing Automation Applications and Evaluation
Marketing Automation Applications and EvaluationLynn Holley III
 

Viewers also liked (8)

SEO, SEM & SMM Schedule sample
SEO, SEM & SMM Schedule sampleSEO, SEM & SMM Schedule sample
SEO, SEM & SMM Schedule sample
 
Location baseda rengine
Location baseda rengineLocation baseda rengine
Location baseda rengine
 
我为何使用
我为何使用我为何使用
我为何使用
 
BI 商业智能简述
BI 商业智能简述BI 商业智能简述
BI 商业智能简述
 
Guangzhou Techparty Pre show 20110917
Guangzhou Techparty Pre show 20110917Guangzhou Techparty Pre show 20110917
Guangzhou Techparty Pre show 20110917
 
iOS开发常用库推荐之一@techparty
iOS开发常用库推荐之一@techpartyiOS开发常用库推荐之一@techparty
iOS开发常用库推荐之一@techparty
 
走马观花— Haskell Web 开发
走马观花— Haskell Web 开发走马观花— Haskell Web 开发
走马观花— Haskell Web 开发
 
Marketing Automation Applications and Evaluation
Marketing Automation Applications and EvaluationMarketing Automation Applications and Evaluation
Marketing Automation Applications and Evaluation
 

Similar to Three20

Three20 framework for iOS development
Three20 framework for iOS developmentThree20 framework for iOS development
Three20 framework for iOS developmentRichard Lee
 
Apple Templates Considered Harmful
Apple Templates Considered HarmfulApple Templates Considered Harmful
Apple Templates Considered HarmfulBrian Gesiak
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder BehindJohn Wilker
 
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014Fábio Pimentel
 
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаКурсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаГлеб Тарасов
 
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Mobivery
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
SIMBLでCocoaアプリをパワーアップ
SIMBLでCocoaアプリをパワーアップSIMBLでCocoaアプリをパワーアップ
SIMBLでCocoaアプリをパワーアップWataru Kimura
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.jsJosh Staples
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Filippo Matteo Riggio
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applicationslmrei
 
MySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQLMySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQLTed Leung
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builderMaurizio Vitale
 
Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Saulo Arruda
 
PhoneGap_Javakuche0612
PhoneGap_Javakuche0612PhoneGap_Javakuche0612
PhoneGap_Javakuche0612Yuhei Miyazato
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to GriffonJames Williams
 

Similar to Three20 (20)

Three20 framework for iOS development
Three20 framework for iOS developmentThree20 framework for iOS development
Three20 framework for iOS development
 
Apple Templates Considered Harmful
Apple Templates Considered HarmfulApple Templates Considered Harmful
Apple Templates Considered Harmful
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
 
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаКурсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
 
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III) Formacion en movilidad: Conceptos de desarrollo en iOS (III)
Formacion en movilidad: Conceptos de desarrollo en iOS (III)
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
SIMBLでCocoaアプリをパワーアップ
SIMBLでCocoaアプリをパワーアップSIMBLでCocoaアプリをパワーアップ
SIMBLでCocoaアプリをパワーアップ
 
I os 11
I os 11I os 11
I os 11
 
iOS
iOSiOS
iOS
 
CakePHP in iPhone App
CakePHP in iPhone AppCakePHP in iPhone App
CakePHP in iPhone App
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.js
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
MySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQLMySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQL
 
201104 iphone navigation-based apps
201104 iphone navigation-based apps201104 iphone navigation-based apps
201104 iphone navigation-based apps
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
 
Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4
 
PhoneGap_Javakuche0612
PhoneGap_Javakuche0612PhoneGap_Javakuche0612
PhoneGap_Javakuche0612
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to Griffon
 

Recently uploaded

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 SolutionsEnterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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 WorkerThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
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 MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Three20

  • 1. Three20 (@cngump) cngump@gmail.com http://www.cngump.com http://www.techparty.org 2012.02 11 2 27
  • 2. What’s Three20? • Three20 iPhone 320×480 • Three20 Facebook Joe Hewitt iOS Lib 11 2 27
  • 3. Three20 Feature • Router URL • CSS • UI • (pull to refresh,photoviewer) • • (json,xml) 11 2 27
  • 4. Three20 Hierarchy Three20 Launcher UI UINavigator Style UICommon Network Core 11 2 27
  • 5. Let’s Begin git source: git clone git://github.com/facebook/three20.git git checkout v1.1 11 2 27
  • 6. Template Xcode Template >./InstallTemplates3.2.5.Command Xcode Three20 > python three20/src/scripts/ttmodule.py -p path/to/ myProject.xcodeproj Three20 11 2 27
  • 8. TTNavigator* navigator = [TTNavigator navigator]; // TTNavigator navigator.supportsShakeToReload = YES; // navigator.persistenceMode = TTNavigatorPersistenceModeNone; ! // ! // TTNavigatorPersistenceModeNone ! // TTNavigatorPersistenceModeTop ! ! // TTNavigatorPersistenceModeAll TTURLMap* map = navigator.URLMap;! [map from:@"*" toViewController:[TTWebController class]]; ! // Controller [map from:@"tt://root" toViewController:NSClassFromString(@"RootViewController")]; ! // [map from:@"tt://nib/(loadFromNib:)" toSharedViewController:self]; ! // nib [map from:@"tt://nib/(loadFromNib:)/(withClass:)" toSharedViewController:self]; ! //nib class [map from:@"tt://viewController/(loadFromVC:)" toSharedViewController:self]; ! // [map from:@"tt://modal/(loadFromNib:)" toModalViewController:self]; ! // nib view! if (![navigator restoreViewControllers]) { ! [navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://root"]]; ! // URL } 11 2 27
  • 9. Use URL - (void)createModel { self.dataSource = [TTSectionedDataSource dataSourceWithObjects: @" ",! ! ! ! ! [TTTableTextItem itemWithText:@" " URL:@"tt://nib/DemoTableViewController"], [TTTableTextItem itemWithText:@"Twitter" URL:@"tt://nib/DemoTableViewController"],! [TTTableTextItem itemWithText:@"QQ " URL:@"tt://nib/DemoTableViewController"], nil]; } @end 11 2 27
  • 10. Style 11 2 27
  • 11. //MyStyleSheet.h @interface StyleSheet : TTDefaultStyleSheet { } @end //MyStyleSheet.m #import "StyleSheet.h" @implementation MyStyleSheet - (UIFont*)font { return [UIFont fontWithName:@"Georgia" size:11]; } - (UIFont*)tableFont { return [UIFont fontWithName:@"Georgia" size:12]; } - (UIFont*)tableHeaderPlainFont { return [UIFont fontWithName:@"Georgia-Bold" size:13]; } @end //AppDelegate.m [TTStyleSheet setGlobalStyleSheet:[[[StyleSheet alloc] init] autorelease]]; 11 2 27
  • 12. Controllers TTViewController TTTableViewController TTWebController TTPhotoViewController TTThumbsViewController TTPostController TTMessageController TTLauncherViewController 11 2 27
  • 13. UI 11 2 27
  • 14. PhotoView @interface PhotoTest1Controller : TTPhotoViewController @end @implementation PhotoTest1Controller - (void)viewDidLoad { self.photoSource = [[[MockPhotoSource alloc] initWithType:MockPhotoSourceNormal title:@"Flickr Photos" photos:[NSArray arrayWithObjects: [[[MockPhoto alloc] initWithURL:@"http://farm4.static.flickr.com/ 3099/3164979221_6c0e583f7d.jpg?v=0" smallURL:@"http://farm4.static.flickr.com/ 3099/3164979221_6c0e583f7d_t.jpg" size:CGSizeMake(320, 480)] autorelease], [[[MockPhoto alloc] initWithURL:@"http://farm4.static.flickr.com/ 3444/3223645618_13fe36887a_o.jpg" smallURL:@"http://farm4.static.flickr.com/ 3444/3223645618_f5e2fa7fea_t.jpg" size:CGSizeMake(320, 480) caption:@"This is a caption."] autorelease], ! nil] ! ! ! ! ! photos2:nil ] autorelease]; } @end 11 2 27
  • 15. TTThumbsView @interface PhotoTest1Controller : TTThumbsViewController @end @implementation PhotoTest1Controller - (void)viewDidLoad { self.photoSource = [[[MockPhotoSource alloc] initWithType:MockPhotoSourceNormal title:@"Flickr Photos" photos:[NSArray arrayWithObjects: [[[MockPhoto alloc] initWithURL:@"http://farm4.static.flickr.com/ 3099/3164979221_6c0e583f7d.jpg?v=0" smallURL:@"http://farm4.static.flickr.com/ 3099/3164979221_6c0e583f7d_t.jpg" size:CGSizeMake(320, 480)] autorelease], [[[MockPhoto alloc] initWithURL:@"http://farm4.static.flickr.com/ 3444/3223645618_13fe36887a_o.jpg" smallURL:@"http://farm4.static.flickr.com/ 3444/3223645618_f5e2fa7fea_t.jpg" size:CGSizeMake(320, 480) caption:@"This is a caption."] autorelease], ! nil] ! ! ! ! ! photos2:nil ] autorelease]; } @end 11 2 27
  • 16. TTTableViewDragRefreshDelegate // in TTTableViewController‘s sub class - (id<UITableViewDelegate>)createDelegate { ! return [[[TTTableViewDragRefreshDelegate alloc] initWithController:self] autorelease]; } 11 2 27
  • 17. Launcher Added in Three20 1.1 version //BasicLauncherViewController.h #import <Three20Launcher/Three20Launcher.h> @interface BasicLauncherViewController : TTLauncherViewController { } @end //BasicLauncherViewController.m #import "BasicLauncherViewController.h" @implementation BasicLauncherViewController - (void)viewDidLoad { ! [super viewDidLoad];! ! TTLauncherItem* item = [[TTLauncherItem alloc] initWithTitle: @"Item title" image: @"bundle://Icon.png" URL: nil]; ! [self.launcherView addItem:item animated:NO]; ! TT_RELEASE_SAFELY(item); } @end 11 2 27
  • 18. More UI in Three20’s samples 11 2 27
  • 19. Demo Project MultiWeibo 11 2 27
  • 20. 11 2 27
  • 21. Question? 11 2 27