SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
iOS:	
  Frameworks,	
  Delega3on	
  and	
  MapKit	
  


                Jussi	
  Pohjolainen	
  
    Tampere	
  University	
  of	
  Applied	
  Sciences	
  
About	
  Frameworks	
  
•  Framework	
  is	
  a	
  
   collec3on	
  of	
  classes	
  
   that	
  are	
  added	
  to	
  target	
  
•  Target	
  =	
  the	
  compiled	
  
   iOS	
  app	
  
•  Cocoa	
  Touch	
  has	
  
   several	
  frameworks	
  
•  You	
  can	
  add	
  and	
  
   remove	
  frameworks	
  in	
  
   your	
  project	
  
NSString	
  




NSString	
  needs	
  the	
  Founda3on	
  framework!	
  
Add	
  a	
  Framework	
  




Choose	
  Target	
  
Select	
  Build	
  Phases	
  
Click	
  +	
  (Link	
  Binary	
  with	
  Libraries)	
  
About	
  Delegate	
  
// Create location manager
LocationManager* lc = [[LocationManager
alloc] init];

// Who is receiving location updates? It’s
// someObject. What is someObject? It’s
// whatever object that implements a
// certain protocol!
[lc setDelegate: someObject];
Documenta3on	
  




          Whatever	
  object,	
  
            but	
  is	
  has	
  to	
  
             implement	
  
         CLoca3oinManager
         Delegate	
  Protocol!	
  
About	
  Delegate	
  
// Create location manager
lc = [[LocationManager alloc] init];
// Set delegate this “this”-object
[lc setDelegate: self];
Implemen3ng	
  a	
  Delegate	
  
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface MyLocationViewController :
UIViewController<CLLocationManagerDelegate>
{
    CLLocationManager *locationManager;
}
Delegate	
  Methods	
  
Implementa3on	
  
- (void)locationManager:(CLLocationManager *)manager
     didUpdateLocations:(NSArray *)locations
{
    // Implementation here
}
Delega3on	
  
•  Delega3on:	
  OO	
  way	
  of	
  making	
  callback	
  
•  Send	
  messages	
  to	
  some	
  object.	
  Some	
  object	
  must	
  have	
  
   methods	
  that	
  are	
  defined	
  in	
  the	
  protocol	
  
•  The	
  same	
  than	
  in	
  Java	
  
    –  buUon.addAc3onlistener(Ac3onListener	
  x)	
  
    –  Where	
  x	
  is	
  an	
  interface	
  
•  By	
  default,	
  protocol	
  methods	
  are	
  mandatory.	
  But	
  
   protocol	
  may	
  hold	
  op-onal	
  methods!	
  
•  Typically	
  in	
  delegate	
  protocols,	
  the	
  methods	
  are	
  
   op-onal	
  
Delega3on	
  
•  If	
  delega3on	
  protocol	
  method	
  is	
  mandatory,	
  
   it’s	
  called	
  without	
  checking	
  
•  If	
  delega3on	
  protocol	
  method	
  is	
  op3onal,	
  
   then	
  checking	
  is	
  done:	
  if	
  target	
  object	
  contains	
  
   this	
  method,	
  call	
  it.	
  
    –  This	
  happens	
  in	
  run3me,	
  you	
  don’t	
  have	
  to	
  worry	
  
       about	
  this.	
  
CLLoca3onManagerDelegate.h	
  

            All	
  methods	
  are	
  op3onal!	
  
Demo:	
  Using	
  Debugger	
  
MAPKIT	
  
MapKit	
  Framework	
  
•  Interface	
  for	
  embedding	
  maps	
  into	
  view	
  
•  Supports	
  also	
  
    –  Annota3ng	
  map	
  
    –  Adding	
  overlay	
  
    –  Reverse	
  geocoding	
  
•  As	
  of	
  iOS	
  6	
  Apple	
  uses	
  it’s	
  own	
  maps	
  instead	
  of	
  
   Google	
  maps	
  
•  Reference	
  
    –  hUp://developer.apple.com/library/ios/
       #documenta3on/MapKit/Reference/
       MapKit_Framework_Reference/_index.html	
  
How?	
  
•  Add	
  MapKit	
  framework	
  to	
  your	
  project	
  
•  Import	
  MapKit	
  –	
  class	
  
   –  #import <MapKit/MapKit.h>
•  Use	
  MKMapView	
  object	
  
   –  IBOutlet MKMapView *worldView;
•  Show	
  user	
  loca3on?	
  
   –  Set	
  showsUserLocation	
  property	
  to	
  YES
•  Use	
  MKMapViewDelegate	
  protocol
MKMapViewDelegate	
  


             This	
  is	
  called	
  when	
  user	
  loca3on	
  
              changes.	
  In	
  here	
  you	
  can	
  get	
  
              the	
  coordinates	
  and	
  zoom	
  in	
  
                                MapView	
  
Annota3ons	
  
•  Display	
  something	
  on	
  a	
  map:	
  annota3on	
  
•  Annota3on	
  is	
  any	
  object	
  that	
  conforms	
  to	
  
   MKAnnotation	
  protocol	
  
    –  These	
  objects	
  can	
  be	
  added	
  to	
  MKMapView	
  
•  MKAnnota3on	
  Reference	
  
    –  An	
  object	
  that	
  adopts	
  this	
  protocol	
  must	
  
       implement	
  the	
  coordinate	
  property.	
  The	
  other	
  
       methods	
  of	
  this	
  protocol	
  are	
  op3onal.	
  
MapPoint	
  
Add	
  MapPoint	
  to	
  Map	
  

Mais conteúdo relacionado

Mais procurados

Operator overloading
Operator overloadingOperator overloading
Operator overloadingKumar
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 
Operator overloading
Operator overloadingOperator overloading
Operator overloadingfarhan amjad
 
Operator overloading
Operator overloadingOperator overloading
Operator overloadingKamal Acharya
 
Operator overloadng
Operator overloadngOperator overloadng
Operator overloadngpreethalal
 
Inline function
Inline functionInline function
Inline functionTech_MX
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversionsAmogh Kalyanshetti
 
Operator overloading and type conversion in cpp
Operator overloading and type conversion in cppOperator overloading and type conversion in cpp
Operator overloading and type conversion in cpprajshreemuthiah
 
Procedures functions structures in VB.Net
Procedures  functions  structures in VB.NetProcedures  functions  structures in VB.Net
Procedures functions structures in VB.Nettjunicornfx
 
2CPP11 - Method Overloading
2CPP11 - Method Overloading2CPP11 - Method Overloading
2CPP11 - Method OverloadingMichael Heron
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and OverridingMichael Heron
 
Lec 26.27-operator overloading
Lec 26.27-operator overloadingLec 26.27-operator overloading
Lec 26.27-operator overloadingPrincess Sam
 
Operator_Overloaing_Type_Conversion_OOPC(C++)
Operator_Overloaing_Type_Conversion_OOPC(C++)Operator_Overloaing_Type_Conversion_OOPC(C++)
Operator_Overloaing_Type_Conversion_OOPC(C++)Yaksh Jethva
 

Mais procurados (20)

Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
14 operator overloading
14 operator overloading14 operator overloading
14 operator overloading
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Operator overloadng
Operator overloadngOperator overloadng
Operator overloadng
 
Inline function
Inline functionInline function
Inline function
 
Understanding Subroutines and Functions in VB6
Understanding Subroutines and Functions in VB6Understanding Subroutines and Functions in VB6
Understanding Subroutines and Functions in VB6
 
Function overloading
Function overloadingFunction overloading
Function overloading
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Operator overloading
Operator overloading Operator overloading
Operator overloading
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversions
 
Operator overloading and type conversion in cpp
Operator overloading and type conversion in cppOperator overloading and type conversion in cpp
Operator overloading and type conversion in cpp
 
Procedures functions structures in VB.Net
Procedures  functions  structures in VB.NetProcedures  functions  structures in VB.Net
Procedures functions structures in VB.Net
 
2CPP11 - Method Overloading
2CPP11 - Method Overloading2CPP11 - Method Overloading
2CPP11 - Method Overloading
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding
 
Lec 26.27-operator overloading
Lec 26.27-operator overloadingLec 26.27-operator overloading
Lec 26.27-operator overloading
 
Operator_Overloaing_Type_Conversion_OOPC(C++)
Operator_Overloaing_Type_Conversion_OOPC(C++)Operator_Overloaing_Type_Conversion_OOPC(C++)
Operator_Overloaing_Type_Conversion_OOPC(C++)
 

Semelhante a iOS: Frameworks and Delegation

Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Uri Cohen
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS BackendLaurent Cerveau
 
Integration Monday - BizTalk Migrator Deep Dive
Integration Monday - BizTalk Migrator Deep DiveIntegration Monday - BizTalk Migrator Deep Dive
Integration Monday - BizTalk Migrator Deep DiveBizTalk360
 
Learning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksLearning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksCalvin Cheng
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePiotr Pelczar
 
iOS Core location
iOS Core locationiOS Core location
iOS Core locationRicha Jain
 
workshop_8_c__.pdf
workshop_8_c__.pdfworkshop_8_c__.pdf
workshop_8_c__.pdfAtulAvhad2
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrxIlia Idakiev
 
Java design patterns
Java design patternsJava design patterns
Java design patternsShawn Brito
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesSteve Caron
 
Angular custom directives
Angular custom directivesAngular custom directives
Angular custom directivesAlexe Bogdan
 
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニックUnity Technologies Japan K.K.
 
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptxSuman Garai
 
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...Marcello Tomasini
 
OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff
OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff
OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff mfrancis
 
SOFIA - Smart M3 hands-on Training. NOKIA
SOFIA - Smart M3 hands-on Training. NOKIASOFIA - Smart M3 hands-on Training. NOKIA
SOFIA - Smart M3 hands-on Training. NOKIASofia Eu
 
GDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in UnityGDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in UnityIvan Chiou
 
Design patterns in Magento
Design patterns in MagentoDesign patterns in Magento
Design patterns in MagentoDivante
 
Streaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogStreaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogJoe Stein
 

Semelhante a iOS: Frameworks and Delegation (20)

Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
 
Integration Monday - BizTalk Migrator Deep Dive
Integration Monday - BizTalk Migrator Deep DiveIntegration Monday - BizTalk Migrator Deep Dive
Integration Monday - BizTalk Migrator Deep Dive
 
Learning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeksLearning iOS and hunting NSZombies in 3 weeks
Learning iOS and hunting NSZombies in 3 weeks
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecture
 
iOS Core location
iOS Core locationiOS Core location
iOS Core location
 
Micronaut Launchpad
Micronaut LaunchpadMicronaut Launchpad
Micronaut Launchpad
 
workshop_8_c__.pdf
workshop_8_c__.pdfworkshop_8_c__.pdf
workshop_8_c__.pdf
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrx
 
Java design patterns
Java design patternsJava design patterns
Java design patterns
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to Microservices
 
Angular custom directives
Angular custom directivesAngular custom directives
Angular custom directives
 
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
 
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
 
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
 
OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff
OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff
OSGi Remote Services - Alexander Broekhuis, Bram de Kruijff
 
SOFIA - Smart M3 hands-on Training. NOKIA
SOFIA - Smart M3 hands-on Training. NOKIASOFIA - Smart M3 hands-on Training. NOKIA
SOFIA - Smart M3 hands-on Training. NOKIA
 
GDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in UnityGDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in Unity
 
Design patterns in Magento
Design patterns in MagentoDesign patterns in Magento
Design patterns in Magento
 
Streaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogStreaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit Log
 

Mais de Jussi Pohjolainen

libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferencesJussi Pohjolainen
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationJussi Pohjolainen
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDXJussi Pohjolainen
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript DevelopmentJussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame AnimationJussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame AnimationJussi Pohjolainen
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDXJussi Pohjolainen
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDXJussi Pohjolainen
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesJussi Pohjolainen
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platformJussi Pohjolainen
 

Mais de Jussi Pohjolainen (20)

Moved to Speakerdeck
Moved to SpeakerdeckMoved to Speakerdeck
Moved to Speakerdeck
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Box2D and libGDX
Box2D and libGDXBox2D and libGDX
Box2D and libGDX
 
libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and Preferences
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDX
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
libGDX: Scene2D
libGDX: Scene2DlibGDX: Scene2D
libGDX: Scene2D
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
libGDX: User Input
libGDX: User InputlibGDX: User Input
libGDX: User Input
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
 
Intro to Asha UI
Intro to Asha UIIntro to Asha UI
Intro to Asha UI
 

Último

UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
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
 
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
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfAnna Loughnan Colquhoun
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
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
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
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
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
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
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
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
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Último (20)

UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
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
 
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
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdf
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
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
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
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
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
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...
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
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
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

iOS: Frameworks and Delegation

  • 1. iOS:  Frameworks,  Delega3on  and  MapKit   Jussi  Pohjolainen   Tampere  University  of  Applied  Sciences  
  • 2. About  Frameworks   •  Framework  is  a   collec3on  of  classes   that  are  added  to  target   •  Target  =  the  compiled   iOS  app   •  Cocoa  Touch  has   several  frameworks   •  You  can  add  and   remove  frameworks  in   your  project  
  • 3. NSString   NSString  needs  the  Founda3on  framework!  
  • 4. Add  a  Framework   Choose  Target   Select  Build  Phases   Click  +  (Link  Binary  with  Libraries)  
  • 5. About  Delegate   // Create location manager LocationManager* lc = [[LocationManager alloc] init]; // Who is receiving location updates? It’s // someObject. What is someObject? It’s // whatever object that implements a // certain protocol! [lc setDelegate: someObject];
  • 6. Documenta3on   Whatever  object,   but  is  has  to   implement   CLoca3oinManager Delegate  Protocol!  
  • 7. About  Delegate   // Create location manager lc = [[LocationManager alloc] init]; // Set delegate this “this”-object [lc setDelegate: self];
  • 8. Implemen3ng  a  Delegate   #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @interface MyLocationViewController : UIViewController<CLLocationManagerDelegate> { CLLocationManager *locationManager; }
  • 10. Implementa3on   - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { // Implementation here }
  • 11. Delega3on   •  Delega3on:  OO  way  of  making  callback   •  Send  messages  to  some  object.  Some  object  must  have   methods  that  are  defined  in  the  protocol   •  The  same  than  in  Java   –  buUon.addAc3onlistener(Ac3onListener  x)   –  Where  x  is  an  interface   •  By  default,  protocol  methods  are  mandatory.  But   protocol  may  hold  op-onal  methods!   •  Typically  in  delegate  protocols,  the  methods  are   op-onal  
  • 12. Delega3on   •  If  delega3on  protocol  method  is  mandatory,   it’s  called  without  checking   •  If  delega3on  protocol  method  is  op3onal,   then  checking  is  done:  if  target  object  contains   this  method,  call  it.   –  This  happens  in  run3me,  you  don’t  have  to  worry   about  this.  
  • 13. CLLoca3onManagerDelegate.h   All  methods  are  op3onal!  
  • 16. MapKit  Framework   •  Interface  for  embedding  maps  into  view   •  Supports  also   –  Annota3ng  map   –  Adding  overlay   –  Reverse  geocoding   •  As  of  iOS  6  Apple  uses  it’s  own  maps  instead  of   Google  maps   •  Reference   –  hUp://developer.apple.com/library/ios/ #documenta3on/MapKit/Reference/ MapKit_Framework_Reference/_index.html  
  • 17. How?   •  Add  MapKit  framework  to  your  project   •  Import  MapKit  –  class   –  #import <MapKit/MapKit.h> •  Use  MKMapView  object   –  IBOutlet MKMapView *worldView; •  Show  user  loca3on?   –  Set  showsUserLocation  property  to  YES •  Use  MKMapViewDelegate  protocol
  • 18. MKMapViewDelegate   This  is  called  when  user  loca3on   changes.  In  here  you  can  get   the  coordinates  and  zoom  in   MapView  
  • 19. Annota3ons   •  Display  something  on  a  map:  annota3on   •  Annota3on  is  any  object  that  conforms  to   MKAnnotation  protocol   –  These  objects  can  be  added  to  MKMapView   •  MKAnnota3on  Reference   –  An  object  that  adopts  this  protocol  must   implement  the  coordinate  property.  The  other   methods  of  this  protocol  are  op3onal.