SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
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

Más contenido relacionado

Destacado

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
 

Destacado (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 a 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 a 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
 

Último

Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 

Último (20)

Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 

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