SlideShare a Scribd company logo
1 of 26
IOS Development
Lec 2
Anatomy of an
         Application
Compiled code
   Your code
   Frameworks

Nib files
   UI elements and other objects
   Details about object relationships

Resources (images, sounds, strings, etc)

Info.plist file (application configuration)
App Lifecycle
UIKit Framework
Starts your application
Every application has a single instance of UIApplication
   Singleton design pattern
@interface UIApplication + (UIApplication *)sharedApplication
@end
   Orchestrates the lifecycle of an application
   Dispatches events
   Manages status bar, application icon badge
   Rarely subclassed
      Uses delegation instead
Delegation
Control passed to delegate objects to perform
application- specific behavior

Avoids need to subclass complex objects

Many UIKit classes use delegates
   UIApplication
   UITableView
   UITextField
UIApplicationDelegate
Xcode project templates have one set up by
default

Object you provide that participates in application
lifecycle

Can implement various methods which
UIApplication will call
UIApplicationDelegate
   Examples:

-(void)applicationDidFinishLaunching:(UIApplication
*)application;

- (void)applicationWillTerminate:(UIApplication *)application;

- (void)applicationWillResignActive:(UIApplication *)application;

-(BOOL)application:(UIApplication *)application
handleOpenURL:(NSURL *)url;

- (void)applicationDidReceiveMemoryWarning:(UIApplication
*)application;
Info.plist file
Property List (often XML), describing your application
   Icon appearance
   Status bar style (default, black, hidden)
   Orientation
   Uses Wifi networking
   System Requirements

Can edit most properties in Xcode
Project > Edit Active Target “Foo” menu item
On the properties tab
MVC
Model, View, Controller

             controller




     model                view
Model
Manages the app data and state

Not concerned with UI or presentation

Often persists somewhere

Same model should be reusable, unchanged in
different interfaces
View
Present the Model to the user in an appropriate
interface

Allows user to manipulate data

Does not store any data
   (except to cache state)

Easily reusable & configurable to display different
data
Controller
Intermediary between Model & View

Updates the view when the model changes

Updates the model when the user manipulates
the view

Typically where the app logic lives.
Demo
Interface Builder and
         Nibs
Nib Files - Design time
Helps you design the „V‟ in MVC:
   layout user interface elements
   add controller objects
   Connect the controller and UI
Nib Loading
At runtime, objects are unarchived
    Values/settings in Interface Builder are restored
    Ensures all outlets and actions are connected
    Order of unarchiving is not defined

If loading the nib automatically creates objects and order is
undefined, how do I customize?
    For example, to displaying initial state

    -awakeFromNib
Control point to implement any additional logic after nib
loading
Default empty implementation on NSObject

You often implement it in your controller class
   e.g. to restore previously saved application state

Guaranteed everything has been unarchived
from nib, and all connections are made before -
awakeFromNib is called
Controls – Events
View objects that allows users to initiate some type of
action

Respond to variety of events
   Touch events
      touchDown
      touchDragged (entered, exited, drag inside, drag
      outside)
      touchUp (inside, outside)
   Value changed
   Editing events
      editing began
      editing changed
      editing ended
Demo
Target/Action - event
Action Methods
3 different flavors of action method selector types




        nMethod:(id)sender withEvent:(UIEvent *)event;

UIEvent contains details about the event that took place
Action Method Variations
     Simple no-argument selector




     Single argument selector - control is „sender‟
//
Action Method Variations
 Two-arguments in selector (sender & event)
Multiple target-actions
Controls can trigger multiple actions on different
targets in response to the same event

Different than Cocoa on the desktop where only
one target- action is supported

Different events can be setup in IB
Manual Target-Action
Same information IB would use
API and UIControlEvents found in UIControl.h
UIControlEvents is a bitmask

More Related Content

What's hot

Dependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSDependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSRemo Jansen
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureOleksii Prohonnyi
 
Cycle.js a reactive framework
Cycle.js  a reactive frameworkCycle.js  a reactive framework
Cycle.js a reactive frameworkluca mezzalira
 
iPhone Development Tools
iPhone Development ToolsiPhone Development Tools
iPhone Development ToolsOmar Cafini
 
Xcode 7 UI Testing - Xcake Dublin, October 2015
Xcode 7 UI Testing - Xcake Dublin, October 2015Xcode 7 UI Testing - Xcake Dublin, October 2015
Xcode 7 UI Testing - Xcake Dublin, October 2015roland99
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceOleksii Prohonnyi
 
Automated Xcode 7 UI Testing
Automated Xcode 7 UI TestingAutomated Xcode 7 UI Testing
Automated Xcode 7 UI TestingJouni Miettunen
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceOleksii Prohonnyi
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKKarthik Subramanian
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral frameworkKarthik Subramanian
 
Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)Sanju Sony Kurian
 
JavaScript framework overview
JavaScript framework overviewJavaScript framework overview
JavaScript framework overviewJetRuby Agency
 

What's hot (12)

Dependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSDependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJS
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: Architecture
 
Cycle.js a reactive framework
Cycle.js  a reactive frameworkCycle.js  a reactive framework
Cycle.js a reactive framework
 
iPhone Development Tools
iPhone Development ToolsiPhone Development Tools
iPhone Development Tools
 
Xcode 7 UI Testing - Xcake Dublin, October 2015
Xcode 7 UI Testing - Xcake Dublin, October 2015Xcode 7 UI Testing - Xcake Dublin, October 2015
Xcode 7 UI Testing - Xcake Dublin, October 2015
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
 
Automated Xcode 7 UI Testing
Automated Xcode 7 UI TestingAutomated Xcode 7 UI Testing
Automated Xcode 7 UI Testing
 
Dive into Angular, part 3: Performance
Dive into Angular, part 3: PerformanceDive into Angular, part 3: Performance
Dive into Angular, part 3: Performance
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORK
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral framework
 
Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)Basic Intro to android(Will be updating later)
Basic Intro to android(Will be updating later)
 
JavaScript framework overview
JavaScript framework overviewJavaScript framework overview
JavaScript framework overview
 

Similar to Ios development 2

Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyUna Daly
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1Hussain Behestee
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCAnton Krasnoshchok
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Svetlin Nakov
 
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS ArchitecturesHung Hoang
 
Design Patterns in Cocoa Touch
Design Patterns in Cocoa TouchDesign Patterns in Cocoa Touch
Design Patterns in Cocoa TouchEliah Nikans
 
Session 7 - Overview of the iOS7 app development architecture
Session 7 - Overview of the iOS7 app development architectureSession 7 - Overview of the iOS7 app development architecture
Session 7 - Overview of the iOS7 app development architectureVu Tran Lam
 
iOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkiOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkMiguel de Icaza
 
Real-time Text Audio to Video PPT Converter Tablet App
Real-time Text Audio to Video PPT Converter Tablet AppReal-time Text Audio to Video PPT Converter Tablet App
Real-time Text Audio to Video PPT Converter Tablet AppMike Taylor
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQAvijit Shaw
 
Integrating external products into eclipse
Integrating external products into eclipseIntegrating external products into eclipse
Integrating external products into eclipseGirish Balre
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart JfokusLars Vogel
 
Caliburn.micro
Caliburn.microCaliburn.micro
Caliburn.microbwullems
 
Distributing information on iOS
Distributing information on iOSDistributing information on iOS
Distributing information on iOSMake School
 
HCI 3e - Ch 8: Implementation support
HCI 3e - Ch 8:  Implementation supportHCI 3e - Ch 8:  Implementation support
HCI 3e - Ch 8: Implementation supportAlan Dix
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applicationsIvano Malavolta
 

Similar to Ios development 2 (20)

Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una Daly
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
02 objective-c session 2
02  objective-c session 202  objective-c session 2
02 objective-c session 2
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
 
ios basics
ios basicsios basics
ios basics
 
Design Patterns in Cocoa Touch
Design Patterns in Cocoa TouchDesign Patterns in Cocoa Touch
Design Patterns in Cocoa Touch
 
Session 7 - Overview of the iOS7 app development architecture
Session 7 - Overview of the iOS7 app development architectureSession 7 - Overview of the iOS7 app development architecture
Session 7 - Overview of the iOS7 app development architecture
 
iOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections TalkiOS for C# Developers - DevConnections Talk
iOS for C# Developers - DevConnections Talk
 
Angular2 and You
Angular2 and YouAngular2 and You
Angular2 and You
 
Real-time Text Audio to Video PPT Converter Tablet App
Real-time Text Audio to Video PPT Converter Tablet AppReal-time Text Audio to Video PPT Converter Tablet App
Real-time Text Audio to Video PPT Converter Tablet App
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ
 
Integrating external products into eclipse
Integrating external products into eclipseIntegrating external products into eclipse
Integrating external products into eclipse
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Caliburn.micro
Caliburn.microCaliburn.micro
Caliburn.micro
 
Distributing information on iOS
Distributing information on iOSDistributing information on iOS
Distributing information on iOS
 
HCI 3e - Ch 8: Implementation support
HCI 3e - Ch 8:  Implementation supportHCI 3e - Ch 8:  Implementation support
HCI 3e - Ch 8: Implementation support
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applications
 

Recently uploaded

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 

Ios development 2

  • 2. Anatomy of an Application Compiled code Your code Frameworks Nib files UI elements and other objects Details about object relationships Resources (images, sounds, strings, etc) Info.plist file (application configuration)
  • 4. UIKit Framework Starts your application Every application has a single instance of UIApplication Singleton design pattern @interface UIApplication + (UIApplication *)sharedApplication @end Orchestrates the lifecycle of an application Dispatches events Manages status bar, application icon badge Rarely subclassed Uses delegation instead
  • 5. Delegation Control passed to delegate objects to perform application- specific behavior Avoids need to subclass complex objects Many UIKit classes use delegates UIApplication UITableView UITextField
  • 6. UIApplicationDelegate Xcode project templates have one set up by default Object you provide that participates in application lifecycle Can implement various methods which UIApplication will call
  • 7. UIApplicationDelegate Examples: -(void)applicationDidFinishLaunching:(UIApplication *)application; - (void)applicationWillTerminate:(UIApplication *)application; - (void)applicationWillResignActive:(UIApplication *)application; -(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url; - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application;
  • 8. Info.plist file Property List (often XML), describing your application Icon appearance Status bar style (default, black, hidden) Orientation Uses Wifi networking System Requirements Can edit most properties in Xcode Project > Edit Active Target “Foo” menu item On the properties tab
  • 9. MVC
  • 10. Model, View, Controller controller model view
  • 11. Model Manages the app data and state Not concerned with UI or presentation Often persists somewhere Same model should be reusable, unchanged in different interfaces
  • 12. View Present the Model to the user in an appropriate interface Allows user to manipulate data Does not store any data (except to cache state) Easily reusable & configurable to display different data
  • 13. Controller Intermediary between Model & View Updates the view when the model changes Updates the model when the user manipulates the view Typically where the app logic lives.
  • 14.
  • 15. Demo
  • 17. Nib Files - Design time Helps you design the „V‟ in MVC: layout user interface elements add controller objects Connect the controller and UI
  • 18. Nib Loading At runtime, objects are unarchived Values/settings in Interface Builder are restored Ensures all outlets and actions are connected Order of unarchiving is not defined If loading the nib automatically creates objects and order is undefined, how do I customize? For example, to displaying initial state -awakeFromNib Control point to implement any additional logic after nib loading
  • 19. Default empty implementation on NSObject You often implement it in your controller class e.g. to restore previously saved application state Guaranteed everything has been unarchived from nib, and all connections are made before - awakeFromNib is called
  • 20. Controls – Events View objects that allows users to initiate some type of action Respond to variety of events Touch events touchDown touchDragged (entered, exited, drag inside, drag outside) touchUp (inside, outside) Value changed Editing events editing began editing changed editing ended
  • 22. Action Methods 3 different flavors of action method selector types nMethod:(id)sender withEvent:(UIEvent *)event; UIEvent contains details about the event that took place
  • 23. Action Method Variations Simple no-argument selector Single argument selector - control is „sender‟ //
  • 24. Action Method Variations Two-arguments in selector (sender & event)
  • 25. Multiple target-actions Controls can trigger multiple actions on different targets in response to the same event Different than Cocoa on the desktop where only one target- action is supported Different events can be setup in IB
  • 26. Manual Target-Action Same information IB would use API and UIControlEvents found in UIControl.h UIControlEvents is a bitmask

Editor's Notes

  1. UIControlEventTouchUpInside-(void)decrease