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

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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