SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
iPhone Application Development III
            Janet Huang
             2011/12/07
Today’s topic

• iOS programming review
• Facebook API
• Location + Facebook App
overview of iPhone application
 Key objects in an iOS app
View Controller
View Controller
 •   Important property in UIViewController
     @property (retain) UIView *view;

                     a pointer to top-level UIView in the Controller’s View

 •   View Controller have a “lifecycle” from creation
     to destruction

- (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)aBundle;



                  initializer
View Controller

• After the UIViewController is initialized,
  viewDidLoad is called
    - (void)viewDidLoad;

• Just before the view appears on screen, you
  get notified
   - (void)viewWillAppear:(BOOL)animated;
View Controller
 • Creating a UIViewController’s UI in code
     (no .xib, no storyboard)
    • override - (void)loadView;
    • set self.view
*Do NOT implement loadView if you use a storyboard/.xib to create the
UIViewController.
*Do NOT set self.view anywhere else besides in loadView.
*Do NOT implement loadView without setting self.view (i.e. you must set
self.view in loadView).
Segues   a pointer to top-level UIView in the Controller’s View
Review
   - Objective-C
     - Class, Methods, Properties, Protocols, Delegation

   - MVC and UIViewController
     - MVC design
     - View Controller

   - Interface Builder or Storyboard

   - Delegation & Target-action

   - Application Lifecycle
MVC
                          should
                                   did
                       will                 target

                       controller
                                          outlet
                      count
Notification




                                          de
                         data




                                   da
 & KVO




                                             le
                                     ta

                                             ga
                                                        action




                                               te
                                         so
                                           urc
                                           es
              model                                  view
General process for building
iPhone application
         1.	
  Create	
  a	
  simple	
  MVC	
  iPhone	
  applica5on
         2.	
  Build	
  interfaces	
  using	
  Interface	
  builder
         3.	
  Declara5ons
             a.	
  Declaring	
  instance	
  variables
             b.	
  Declaring	
  methods
         4.	
  Make	
  connec5ons
             a.	
  SeDng	
  a	
  pointer
             b.	
  SeDng	
  targets	
  and	
  ac5ons
         5.	
  Implemen5ng	
  methods
             a.	
  Ini5al	
  method
             b.	
  Ac5on	
  methods
         6.	
  Build	
  and	
  run	
  on	
  the	
  simulator
         7.	
  Test	
  applica5on	
  on	
  the	
  device
Facebook API
FB iOS SDK
• Methods
 •   Authentication

 •   Dialog

 •   Request

• Protocols
 •   FBDialogDelegate

 •   FBRequestDelegate

 •   FBSessionDelegate
Bookmark   Search
Create a FB iOS App




https://developers.facebook.com/docs/guides/mobile/
Step1: Registering your iOS App with Facebook
                                                   https://developers.facebook.com/apps/




Step 2: Installing the iOS SDK
    git clone git://github.com/facebook/facebook-ios-sdk.git   use git clone
    https://github.com/facebook/facebook-ios-sdk       OR download it directly

Step 3: Implementing Single Sign-On (SSO)
    *access_token
Step 1:



Step 2:


Step 3:




Step 4:
Step 5:




Step 6:
modify the app property list file
Test it!! :D
Add Requesting Additional Permissions
Add Graph API
Add Social Channel

  Request




 News Feed
Implementation & Integration

Contenu connexe

Similaire à Iphone course 3

iOS Development Introduction (MuMe11)
iOS Development Introduction (MuMe11)iOS Development Introduction (MuMe11)
iOS Development Introduction (MuMe11)
Gonzalo Parra
 
UIViewControllerのコーナーケース
UIViewControllerのコーナーケースUIViewControllerのコーナーケース
UIViewControllerのコーナーケース
Katsumi Kishikawa
 

Similaire à Iphone course 3 (20)

From mvc to viper
From mvc to viperFrom mvc to viper
From mvc to viper
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
iOS Design Patterns
iOS Design PatternsiOS Design Patterns
iOS Design Patterns
 
Intro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloudIntro to Continuous Integration at SoundCloud
Intro to Continuous Integration at SoundCloud
 
iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]iPhone Programming in 30 minutes (?) [FTS]
iPhone Programming in 30 minutes (?) [FTS]
 
Spring 3 MVC CodeMash 2009
Spring 3 MVC   CodeMash 2009Spring 3 MVC   CodeMash 2009
Spring 3 MVC CodeMash 2009
 
iOS Development Introduction (MuMe11)
iOS Development Introduction (MuMe11)iOS Development Introduction (MuMe11)
iOS Development Introduction (MuMe11)
 
iOS Dev Intro
iOS Dev IntroiOS Dev Intro
iOS Dev Intro
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
iOS
iOSiOS
iOS
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
 
スケーラブル SwiftUI プロジェクトにおける実用的な TCA モジュラー化
スケーラブル SwiftUI プロジェクトにおける実用的な TCA モジュラー化スケーラブル SwiftUI プロジェクトにおける実用的な TCA モジュラー化
スケーラブル SwiftUI プロジェクトにおける実用的な TCA モジュラー化
 
I pad uicatalog_lesson02
I pad uicatalog_lesson02I pad uicatalog_lesson02
I pad uicatalog_lesson02
 
IOS APPs Revision
IOS APPs RevisionIOS APPs Revision
IOS APPs Revision
 
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone DevelopmentiPhone Camp Birmingham (Bham) - Intro To iPhone Development
iPhone Camp Birmingham (Bham) - Intro To iPhone Development
 
Unit Testing 101
Unit Testing 101Unit Testing 101
Unit Testing 101
 
UIViewControllerのコーナーケース
UIViewControllerのコーナーケースUIViewControllerのコーナーケース
UIViewControllerのコーナーケース
 
SUG Bangalore - Extending Sitecore Experience Commerce 9 Business Tools
SUG Bangalore - Extending Sitecore Experience Commerce 9 Business ToolsSUG Bangalore - Extending Sitecore Experience Commerce 9 Business Tools
SUG Bangalore - Extending Sitecore Experience Commerce 9 Business Tools
 
December 2014 University iOS Meetup Talk
December 2014 University iOS Meetup TalkDecember 2014 University iOS Meetup Talk
December 2014 University iOS Meetup Talk
 
iOS: View Controllers
iOS: View ControllersiOS: View Controllers
iOS: View Controllers
 

Plus de Janet Huang (10)

Transferring Sensing to a Mixed Virtual and Physical Experience
Transferring Sensing to a Mixed Virtual and Physical ExperienceTransferring Sensing to a Mixed Virtual and Physical Experience
Transferring Sensing to a Mixed Virtual and Physical Experience
 
Collecting a Image Label from Crowds Using Amazon Mechanical Turk
Collecting a Image Label from Crowds Using Amazon Mechanical TurkCollecting a Image Label from Crowds Using Amazon Mechanical Turk
Collecting a Image Label from Crowds Using Amazon Mechanical Turk
 
Art in the Crowd
Art in the CrowdArt in the Crowd
Art in the Crowd
 
How to Program SmartThings
How to Program SmartThingsHow to Program SmartThings
How to Program SmartThings
 
Designing physical and digital experience in social web
Designing physical and digital experience in social webDesigning physical and digital experience in social web
Designing physical and digital experience in social web
 
Of class2
Of class2Of class2
Of class2
 
Of class1
Of class1Of class1
Of class1
 
Iphone course 2
Iphone course 2Iphone course 2
Iphone course 2
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
Openframworks x Mobile
Openframworks x MobileOpenframworks x Mobile
Openframworks x Mobile
 

Dernier

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 

Dernier (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 

Iphone course 3

  • 1. iPhone Application Development III Janet Huang 2011/12/07
  • 2. Today’s topic • iOS programming review • Facebook API • Location + Facebook App
  • 3. overview of iPhone application
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.  Key objects in an iOS app
  • 9.
  • 11. View Controller • Important property in UIViewController @property (retain) UIView *view; a pointer to top-level UIView in the Controller’s View • View Controller have a “lifecycle” from creation to destruction - (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)aBundle; initializer
  • 12. View Controller • After the UIViewController is initialized, viewDidLoad is called - (void)viewDidLoad; • Just before the view appears on screen, you get notified - (void)viewWillAppear:(BOOL)animated;
  • 13. View Controller • Creating a UIViewController’s UI in code (no .xib, no storyboard) • override - (void)loadView; • set self.view *Do NOT implement loadView if you use a storyboard/.xib to create the UIViewController. *Do NOT set self.view anywhere else besides in loadView. *Do NOT implement loadView without setting self.view (i.e. you must set self.view in loadView).
  • 14. Segues a pointer to top-level UIView in the Controller’s View
  • 15. Review - Objective-C - Class, Methods, Properties, Protocols, Delegation - MVC and UIViewController - MVC design - View Controller - Interface Builder or Storyboard - Delegation & Target-action - Application Lifecycle
  • 16. MVC should did will target controller outlet count Notification de data da & KVO le ta ga action te so urc es model view
  • 17. General process for building iPhone application 1.  Create  a  simple  MVC  iPhone  applica5on 2.  Build  interfaces  using  Interface  builder 3.  Declara5ons a.  Declaring  instance  variables b.  Declaring  methods 4.  Make  connec5ons a.  SeDng  a  pointer b.  SeDng  targets  and  ac5ons 5.  Implemen5ng  methods a.  Ini5al  method b.  Ac5on  methods 6.  Build  and  run  on  the  simulator 7.  Test  applica5on  on  the  device
  • 19. FB iOS SDK • Methods • Authentication • Dialog • Request • Protocols • FBDialogDelegate • FBRequestDelegate • FBSessionDelegate
  • 20.
  • 21.
  • 22.
  • 23. Bookmark Search
  • 24. Create a FB iOS App https://developers.facebook.com/docs/guides/mobile/
  • 25. Step1: Registering your iOS App with Facebook https://developers.facebook.com/apps/ Step 2: Installing the iOS SDK git clone git://github.com/facebook/facebook-ios-sdk.git use git clone https://github.com/facebook/facebook-ios-sdk OR download it directly Step 3: Implementing Single Sign-On (SSO) *access_token
  • 26. Step 1: Step 2: Step 3: Step 4:
  • 28. modify the app property list file
  • 32. Add Social Channel Request News Feed