SlideShare a Scribd company logo
iOS Development
iOS Development
• About Me:
 • Pat Zearfoss
 • Mindgrub Technologies, LLC
 • BS Computer Science - UMBC 2008
 • Working with mobile and iOS for 3
   years.
iOS Development

• Web:
    pzearfoss@gmail.com
    http://zearfoss.wordpress.com
    @pzearfoss
    http://www.github.com/pzearfoss
Development Options
Development Options




HTML 5
Development Options




HTML 5   Cross Platform
Development Options




HTML 5   Cross Platform   Native
HTML 5
HTML 5
• Use the technologies you already know.
HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
  distributed on the app store.
HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
  distributed on the app store.
• Limited use of device hardware.
HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
  distributed on the app store.
• Limited use of device hardware.
• Cross Platform
HTML 5
• Use the technologies you already know.
• Can be loaded into an app webview and
  distributed on the app store.
• Limited use of device hardware.
• Cross Platform
 • Except for all the cross browser
    problems you already know and love.
Cross Platform
Frameworks
Cross Platform
       Frameworks
• Titanium, PhoneGap, Others
Cross Platform
        Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
Cross Platform
        Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
Cross Platform
        Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
Cross Platform
        Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
• Better use of device hardware.
Cross Platform
        Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
• Better use of device hardware.
• “Cross Platform”
Cross Platform
        Frameworks
• Titanium, PhoneGap, Others
• Use the technologies you already know.
• Titanium generates native code.
• PhoneGap uses web code in a webview.
• Better use of device hardware.
• “Cross Platform”
 • Your mileage may vary.
Native
Native
• Offers the most control over your product.
Native
• Offers the most control over your product.
• Access to all device frameworks.
Native
• Offers the most control over your product.
• Access to all device frameworks.
• Requires Objective-C
Native
• Offers the most control over your product.
• Access to all device frameworks.
• Requires Objective-C
• Only runs on iOS (obviously)
Native
• Offers the most control over your product.
• Access to all device frameworks.
• Requires Objective-C
• Only runs on iOS (obviously)
• Will generally run with the absolute best
  performance.
Xcode
• Download from App Store
                            $4.99 Download
Xcode
• Download from App Store
                            $4.99 Download
Xcode
• Download from App Store
                            $4.99 Download




                            4.1 is now free
Getting Started
Getting Started

• Things you should know
Getting Started

• Things you should know
 • Classical OO
Getting Started

• Things you should know
 • Classical OO
   • Classes
Getting Started

• Things you should know
 • Classical OO
   • Classes
   • Inheritance
Getting Started

• Things you should know
 • Classical OO
   • Classes
   • Inheritance
   • Polymorphism
Getting Started
Getting Started

• Recommended but not required
Getting Started

• Recommended but not required
 • Some knowledge of C
Getting Started

• Recommended but not required
 • Some knowledge of C
   • malloc() . . . free() ?
Getting Started

• Recommended but not required
 • Some knowledge of C
   • malloc() . . . free() ?
 • Some knowledge of design patterns:
Getting Started

• Recommended but not required
 • Some knowledge of C
   • malloc() . . . free() ?
 • Some knowledge of design patterns:
   • MVC, Singleton, Delegation
Objective-C in 10
    minutes
About Objective-C
About Objective-C
• Object Oriented superset over C
About Objective-C
• Object Oriented superset over C
                 Standard C
About Objective-C
• Object Oriented superset over C
                 Standard C


                 Objective-C
About Objective-C
• Object Oriented superset over C
                  Standard C


                  Objective-C



• Anything that works in C will work in
  Objective-C
Obj-C in 10 minutes
Obj-C in 10 minutes
• All the things you know from C
Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
 • int, float, double, char
Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
 • int, float, double, char
  int foo = 5;
Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
 • int, float, double, char
  int foo = 5;

 • Separate compilation
Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
 • int, float, double, char
  int foo = 5;

 • Separate compilation
  • .h for interface declaration
Obj-C in 10 minutes
• All the things you know from C
• Variables are typed:
 • int, float, double, char
  int foo = 5;

 • Separate compilation
  • .h for interface declaration
  • .m for implementation (instead of .c)
Obj-C in 10 minutes
Obj-C in 10 minutes
• Functions / Methods have return types and
  typed arguments
Obj-C in 10 minutes
• Functions / Methods have return types and
  typed arguments
  int sumOfItems(int i, int j)
  {
     return i + j;
  }
Obj-C in 10 minutes
• Functions / Methods have return types and
  typed arguments
  int sumOfItems(int i, int j)
  {
     return i + j;
  }


• Other types
Obj-C in 10 minutes
• Functions / Methods have return types and
  typed arguments
  int sumOfItems(int i, int j)
  {
     return i + j;
  }


• Other types
 • void, NULL
Obj-C in 10 minutes
• Functions / Methods have return types and
  typed arguments
  int sumOfItems(int i, int j)
  {
     return i + j;
  }


• Other types
 • void, NULL
 • pointers to types (int *, void *)
Obj-C in 10 minutes
Obj-C in 10 minutes
• Objective-C Additions:
Obj-C in 10 minutes
• Objective-C Additions:
 • BOOL - YES / NO
Obj-C in 10 minutes
• Objective-C Additions:
 • BOOL - YES / NO
  BOOL isSet = YES;
Obj-C in 10 minutes
• Objective-C Additions:
 • BOOL - YES / NO
  BOOL isSet = YES;



 • id - strictly a pointer to an object
Obj-C in 10 minutes
• Objective-C Additions:
 • BOOL - YES / NO
  BOOL isSet = YES;



 • id - strictly a pointer to an object
 • nil - a zero’d out pointer
Obj-C in 10 minutes
• Objective-C Additions:
 • BOOL - YES / NO
  BOOL isSet = YES;



 • id - strictly a pointer to an object
 • nil - a zero’d out pointer
  • nil != (necessarily) NULL or 0
Obj-C in 10 minutes
Obj-C in 10 minutes
•   Classes
Obj-C in 10 minutes
•   Classes
    •   Exist as a class pair
Obj-C in 10 minutes
•   Classes
    •   Exist as a class pair
        •   Instance variables and instance methods act
            on an instance object
Obj-C in 10 minutes
•   Classes
    •   Exist as a class pair
        •   Instance variables and instance methods act
            on an instance object
        •   Class (static) methods act on the class
            object
Obj-C in 10 minutes
•   Classes
    •   Exist as a class pair
        •   Instance variables and instance methods act
            on an instance object
        •   Class (static) methods act on the class
            object
        •   There is only ever one class object at any
            given time
Obj-C in 10 minutes
•   Classes
    •   Exist as a class pair
        •   Instance variables and instance methods act
            on an instance object
        •   Class (static) methods act on the class
            object
        •   There is only ever one class object at any
            given time
        •   Class variables really don’t exist
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }

  + (NSString *)className;
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes                                          Include a header
  #import <Foundation/Foundation.h>
                                                          file
  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }

  + (NSString *)className;
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>
                                               Declare interface
  @interface MyClass : NSObject                    extends
  {                                               NSObject
    id aChildObject;
    NSArray *someItems;
  }

  + (NSString *)className;
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;                               Class instance
    NSArray *someItems;                              variables
  }

  + (NSString *)className;
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }
                                                   A class (static)
  + (NSString *)className;
  - (void)logMe;                                      method

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }

  + (NSString *)className;
  - (void)logMe;
                                                   An instance
                                                    method
  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }
                                                   A declared
  + (NSString *)className;                          property
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }

  + (NSString *)className;
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;
                                                      Close the
  @end
                                                   interface block
Obj-C in 10 minutes
• Classes
  #import <Foundation/Foundation.h>

  @interface MyClass : NSObject
  {
    id aChildObject;
    NSArray *someItems;
  }

  + (NSString *)className;
  - (void)logMe;

  @property (nonatomic, retain) id aChildObject;

  @end
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
  @synthesize aChildObject;

  - (id)init
  {
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes                                      Include a header
  #import "MyClass.h"
                                                      file
  @implementation MyClass
  @synthesize aChildObject;

  - (id)init
  {
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"
                                                    Begin
  @implementation MyClass                      implementation
  @synthesize aChildObject;                         block
  - (id)init
  {
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
                                               Auto-generate
  @synthesize aChildObject;
                                                 property
  - (id)init
  {
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
  @synthesize aChildObject;

  - (id)init                                     Initializer
  {                                            (constructor)
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
  @synthesize aChildObject;

  - (id)init
  {
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
  @synthesize aChildObject;

  - (id)init
  {
                                               Call to super
     self = [super init];
     if (self)                                     class
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
  @synthesize aChildObject;

  - (id)init
  {
     self = [super init];                      “new” an array
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Classes
  #import "MyClass.h"

  @implementation MyClass
  @synthesize aChildObject;

  - (id)init
  {
     self = [super init];
     if (self)
     {
         someItems = [[NSArray alloc] init];
     }

      return self;
  }
Obj-C in 10 minutes
• Continued . . .
  - (void)dealloc
  {
     [aChildObject release];
     [someItems release];
     [super dealloc];
  }

  - (void)logMe
  {
     NSLog(@"MyClass");
  }

  + (NSString *)className
  {
    return NSStringFromClass([self class]);
  }

  @end
Obj-C in 10 minutes
• Continued . . .
  - (void)dealloc
  {                                           Destructor
     [aChildObject release];
     [someItems release];
     [super dealloc];
  }

  - (void)logMe
  {
     NSLog(@"MyClass");
  }

  + (NSString *)className
  {
    return NSStringFromClass([self class]);
  }

  @end
Obj-C in 10 minutes
• Continued . . .
  - (void)dealloc
  {
     [aChildObject release];
     [someItems release];
     [super dealloc];
  }

  - (void)logMe
                                              Instance method
  {                                            implementation
     NSLog(@"MyClass");
  }

  + (NSString *)className
  {
    return NSStringFromClass([self class]);
  }

  @end
Obj-C in 10 minutes
• Continued . . .
  - (void)dealloc
  {
     [aChildObject release];
     [someItems release];
     [super dealloc];
  }

  - (void)logMe
  {
     NSLog(@"MyClass");                        Class method
  }                                           implementation
  + (NSString *)className
  {
    return NSStringFromClass([self class]);
  }

  @end
Obj-C in 10 minutes
• Continued . . .
  - (void)dealloc
  {
     [aChildObject release];
     [someItems release];
     [super dealloc];
  }

  - (void)logMe
  {
     NSLog(@"MyClass");
  }

  + (NSString *)className
  {
    return NSStringFromClass([self class]);         End
  }                                           implementation
  @end                                             block
Obj-C in 10 minutes
• Continued . . .
  - (void)dealloc
  {
     [aChildObject release];
     [someItems release];
     [super dealloc];
  }

  - (void)logMe
  {
     NSLog(@"MyClass");
  }

  + (NSString *)className
  {
    return NSStringFromClass([self class]);
  }

  @end
Obj-C in 10 minutes
Obj-C in 10 minutes
• What’s with all the ‘@’ and ‘[ ]’?
Obj-C in 10 minutes
• What’s with all the ‘@’ and ‘[ ]’?
•@
 • Objective-C keywords
 • Initializer for string constants
Obj-C in 10 minutes
• What’s with all the ‘@’ and ‘[ ]’?
•@
 • Objective-C keywords
 • Initializer for string constants
• ‘[]’
 • “Send a message to an object”
 • Like calling a method, but more dynamic
Obj-C in 10 minutes
Obj-C in 10 minutes
• Method Calls (messages)
Obj-C in 10 minutes
• Method Calls (messages)
• Names are intermixed with arguments:
Obj-C in 10 minutes
• Method Calls (messages)
• Names are intermixed with arguments:
 • method definition
  - (void)setItems:(NSArray *)items childObject:(id)obj;
Obj-C in 10 minutes
• Method Calls (messages)
• Names are intermixed with arguments:
 • method definition
  - (void)setItems:(NSArray *)items childObject:(id)obj;



 • method call
  [self setItems:[NSArray array] childObject:object];
Obj-C in 10 minutes


- (void)setItems:(NSArray *)items childObject:(id)obj;
Obj-C in 10 minutes
 Return
  Type

- (void)setItems:(NSArray *)items childObject:(id)obj;
Obj-C in 10 minutes
 Return
  Type

- (void)setItems:(NSArray *)items childObject:(id)obj;




                       Method Name
Obj-C in 10 minutes
 Return
  Type                           Arguments and Types


- (void)setItems:(NSArray *)items childObject:(id)obj;




                       Method Name
Obj-C in 10 minutes


[self setItems:[NSArray array] childObject:object];
Obj-C in 10 minutes

Receiver

 [self setItems:[NSArray array] childObject:object];
Obj-C in 10 minutes

Receiver

 [self setItems:[NSArray array] childObject:object];




                     Method Name
Obj-C in 10 minutes

Receiver                            Arguments


 [self setItems:[NSArray array] childObject:object];




                     Method Name
Obj-C in 10 minutes
Obj-C in 10 minutes
• Protocols
Obj-C in 10 minutes
• Protocols
 • Analogous to interfaces
  @protocol MyProtocol <NSObject>

  - (void)protocolMethod;
  @property (nonatomic, retain) NSObject *anObject;

  @end
Obj-C in 10 minutes
• Protocols
 • Analogous to interfaces
  @protocol MyProtocol <NSObject>

  - (void)protocolMethod;
  @property (nonatomic, retain) NSObject *anObject;

  @end


 • Adopting a protocol
  @interface MyClass : NSObject <MyProtocol>
Obj-C in 10 minutes
• Categories - Something completely
  different
• Add functionality to an existing class
  @interface NSString (firstChar)
  - (unichar)firstChar;
  @end

  @implementation NSString (reverse)

  - (unichar)firstChar
  {
     return [self characterAtIndex:0];
  }

  @end
Xcode Tour
• Located in /Developer/Applications
Frederick web meetup slides
Code Editor
Navigator
Utilities
Debug Area
Run Controls
Status Window (???)
Window Configuration
Frederick web meetup slides
Run Controls    Status Window (???)   Window Configuration




Navigator          Code Editor                  Utilities




                    Debug Area
Hello World
Model-View-Controller
Model-View-Controller



Model
Model-View-Controller



Model             View
Model-View-Controller



Model   Controller   View
Model
        •   Defines the data to be displayed in
            a view.

            •   Model objects

            •   Database


Model
            •   Web
Controller
               •   Negotiates communication
                   between the model and the view.

                   •   Controls presentation logic

                   •   Updates the model


Controller
                   •   Reflects those updates on the
                       view
View


       •   Contains controls and UI Widgets

           •   Informs the controller of
               updates.
View
Hello World
Model       Controller                  View
          (Hello_WorldViewController)   (.xib)


                                        Label

                view
Hello World
Model       Controller                  View
          (Hello_WorldViewController)   (.xib)


                                        Label

                view
Hello World
Model       Controller                  View
          (Hello_WorldViewController)   (.xib)


                                        Label

                view
Hello You
Hello You
• Basic string handling
• Button control
• TextField control
• Outlets and Actions
• Basic MVC
Hello You
 Model        Controller                  View
              (HelloYouViewController)    (.xib)



NSString:
 name              view
                   textField             textField

                   label                   label

               buttonTap:                 button
Locations
Locations
• CoreLocation
• UITableview
• Delegate Pattern
HTML Photo
HTML App
• Shows interaction between webview
  content and the native development kit.
• Modal View Controllers
• UIImagePickerController
The HTML

<html>
  <head>
    <meta name = "viewport" content = "width = device-width">
  </head>
  <body>
    <h1>Tap for photo</h1>
    <input type="button"
        value="Get Photo"
        onClick="window.location='http://getphoto'"/>
    <img width="320" height="200" id="image"/>
  </body>
</html>
The JavaScript


var image=document.getElementById('image');
image.src = '%@'



    • %@ will be replaced by the image url
Loading the webview

NSError *error;
NSString *filename = [[NSBundle mainBundle]
               pathForResource:@"webview" ofType:@"html"];

NSString *html = [NSString stringWithContentsOfFile:filename
                            encoding:NSUTF8StringEncoding
                              error:&error];
[webview loadHTMLString:html baseURL:nil];
Intercepting the URL
- (BOOL)webView:(UIWebView *)webView
  shouldStartLoadWithRequest:(NSURLRequest *)request
  navigationType:(UIWebViewNavigationType)navigationType
{

    if ([[[request URL] absoluteString] isEqualToString:@"http://getphoto/"])
    {
        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        picker.modalPresentationStyle = UIModalTransitionStyleCoverVertical;
        picker.delegate = self;
        [self presentModalViewController:picker animated:YES];
        return NO;

    }
    return YES;
}
iOS Development

• Web:
    pzearfoss@gmail.com
    http://zearfoss.wordpress.com
    @pzearfoss
    http://www.github.com/pzearfoss

More Related Content

What's hot (17)

PDF
Down the Rabbit Hole: An Adventure in JVM Wonderland
Charles Nutter
 
PDF
Louis Loizides iOS Programming Introduction
Lou Loizides
 
PDF
iOS Programming Intro
Lou Loizides
 
PDF
JRuby and Invokedynamic - Japan JUG 2015
Charles Nutter
 
PDF
Beyond JVM - YOW Melbourne 2013
Charles Nutter
 
PDF
JavaScript Patterns
Stoyan Stefanov
 
PDF
Invoke dynamic your api to hotspot
Boundary
 
PPTX
Introduction to Kotlin Language and its application to Android platform
EastBanc Tachnologies
 
PDF
Beyond JVM - YOW! Brisbane 2013
Charles Nutter
 
KEY
groovy & grails - lecture 1
Alexandre Masselot
 
PDF
Exploring Kotlin
Johan Haleby
 
PDF
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
PPTX
Ruby3x3: How are we going to measure 3x
Matthew Gaudet
 
PDF
ITB2019 Real World Scenarios for Modern CFML - Nolan Erck
Ortus Solutions, Corp
 
PPT
Chapter08
Robbie AkaChopa
 
PDF
Enterprise javascriptsession3
Troy Miles
 
KEY
Testing gone-right
Jesse Wolgamott
 
Down the Rabbit Hole: An Adventure in JVM Wonderland
Charles Nutter
 
Louis Loizides iOS Programming Introduction
Lou Loizides
 
iOS Programming Intro
Lou Loizides
 
JRuby and Invokedynamic - Japan JUG 2015
Charles Nutter
 
Beyond JVM - YOW Melbourne 2013
Charles Nutter
 
JavaScript Patterns
Stoyan Stefanov
 
Invoke dynamic your api to hotspot
Boundary
 
Introduction to Kotlin Language and its application to Android platform
EastBanc Tachnologies
 
Beyond JVM - YOW! Brisbane 2013
Charles Nutter
 
groovy & grails - lecture 1
Alexandre Masselot
 
Exploring Kotlin
Johan Haleby
 
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
Ruby3x3: How are we going to measure 3x
Matthew Gaudet
 
ITB2019 Real World Scenarios for Modern CFML - Nolan Erck
Ortus Solutions, Corp
 
Chapter08
Robbie AkaChopa
 
Enterprise javascriptsession3
Troy Miles
 
Testing gone-right
Jesse Wolgamott
 

Viewers also liked (6)

ZIP
Day 2
Pat Zearfoss
 
PPT
iOS 5
Shakil Ahmed
 
PDF
Easy dna paternity testing
Jack Smith
 
PDF
Unit 6 Fourth Grade 2012 2013
Isaac_Schools_5
 
PDF
What Apple's iOS 5 Means for Marketers
Ben Gaddis
 
PPTX
Apple iOS
Chetan Gowda
 
Easy dna paternity testing
Jack Smith
 
Unit 6 Fourth Grade 2012 2013
Isaac_Schools_5
 
What Apple's iOS 5 Means for Marketers
Ben Gaddis
 
Apple iOS
Chetan Gowda
 
Ad

Similar to Frederick web meetup slides (20)

PDF
Bootstrapping iPhone Development
ThoughtWorks
 
PPT
Objective-C for iOS Application Development
Dhaval Kaneria
 
PPT
Objective c intro (1)
David Echeverria
 
PDF
Objective-C
Abdlhadi Oul
 
KEY
iPhone Development Intro
Luis Azevedo
 
PDF
What Makes Objective C Dynamic?
Kyle Oba
 
KEY
Objective c
Stijn
 
PDF
FI MUNI 2012 - iOS Basics
Petr Dvorak
 
PDF
MFF UK - Introduction to iOS
Petr Dvorak
 
PPT
iOS Application Development
Compare Infobase Limited
 
PDF
Никита Корчагин - Programming Apple iOS with Objective-C
DataArt
 
PDF
Write native iPhone applications using Eclipse CDT
Atit Patumvan
 
PPTX
Introduction to Objective - C
Asim Rais Siddiqui
 
PPT
Ios development
Shakil Ahmed
 
PDF
Objc
Pragati Singh
 
PPTX
iOS Basic
Duy Do Phan
 
PPTX
iOS development introduction
paramisoft
 
PDF
02 objective-c session 2
Amr Elghadban (AmrAngry)
 
PDF
201005 accelerometer and core Location
Javier Gonzalez-Sanchez
 
PDF
Objective-C Is Not Java
Chris Adamson
 
Bootstrapping iPhone Development
ThoughtWorks
 
Objective-C for iOS Application Development
Dhaval Kaneria
 
Objective c intro (1)
David Echeverria
 
Objective-C
Abdlhadi Oul
 
iPhone Development Intro
Luis Azevedo
 
What Makes Objective C Dynamic?
Kyle Oba
 
Objective c
Stijn
 
FI MUNI 2012 - iOS Basics
Petr Dvorak
 
MFF UK - Introduction to iOS
Petr Dvorak
 
iOS Application Development
Compare Infobase Limited
 
Никита Корчагин - Programming Apple iOS with Objective-C
DataArt
 
Write native iPhone applications using Eclipse CDT
Atit Patumvan
 
Introduction to Objective - C
Asim Rais Siddiqui
 
Ios development
Shakil Ahmed
 
iOS Basic
Duy Do Phan
 
iOS development introduction
paramisoft
 
02 objective-c session 2
Amr Elghadban (AmrAngry)
 
201005 accelerometer and core Location
Javier Gonzalez-Sanchez
 
Objective-C Is Not Java
Chris Adamson
 
Ad

Recently uploaded (20)

PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 

Frederick web meetup slides

  • 2. iOS Development • About Me: • Pat Zearfoss • Mindgrub Technologies, LLC • BS Computer Science - UMBC 2008 • Working with mobile and iOS for 3 years.
  • 3. iOS Development • Web: [email protected] http://zearfoss.wordpress.com @pzearfoss http://www.github.com/pzearfoss
  • 6. Development Options HTML 5 Cross Platform
  • 7. Development Options HTML 5 Cross Platform Native
  • 9. HTML 5 • Use the technologies you already know.
  • 10. HTML 5 • Use the technologies you already know. • Can be loaded into an app webview and distributed on the app store.
  • 11. HTML 5 • Use the technologies you already know. • Can be loaded into an app webview and distributed on the app store. • Limited use of device hardware.
  • 12. HTML 5 • Use the technologies you already know. • Can be loaded into an app webview and distributed on the app store. • Limited use of device hardware. • Cross Platform
  • 13. HTML 5 • Use the technologies you already know. • Can be loaded into an app webview and distributed on the app store. • Limited use of device hardware. • Cross Platform • Except for all the cross browser problems you already know and love.
  • 15. Cross Platform Frameworks • Titanium, PhoneGap, Others
  • 16. Cross Platform Frameworks • Titanium, PhoneGap, Others • Use the technologies you already know.
  • 17. Cross Platform Frameworks • Titanium, PhoneGap, Others • Use the technologies you already know. • Titanium generates native code.
  • 18. Cross Platform Frameworks • Titanium, PhoneGap, Others • Use the technologies you already know. • Titanium generates native code. • PhoneGap uses web code in a webview.
  • 19. Cross Platform Frameworks • Titanium, PhoneGap, Others • Use the technologies you already know. • Titanium generates native code. • PhoneGap uses web code in a webview. • Better use of device hardware.
  • 20. Cross Platform Frameworks • Titanium, PhoneGap, Others • Use the technologies you already know. • Titanium generates native code. • PhoneGap uses web code in a webview. • Better use of device hardware. • “Cross Platform”
  • 21. Cross Platform Frameworks • Titanium, PhoneGap, Others • Use the technologies you already know. • Titanium generates native code. • PhoneGap uses web code in a webview. • Better use of device hardware. • “Cross Platform” • Your mileage may vary.
  • 23. Native • Offers the most control over your product.
  • 24. Native • Offers the most control over your product. • Access to all device frameworks.
  • 25. Native • Offers the most control over your product. • Access to all device frameworks. • Requires Objective-C
  • 26. Native • Offers the most control over your product. • Access to all device frameworks. • Requires Objective-C • Only runs on iOS (obviously)
  • 27. Native • Offers the most control over your product. • Access to all device frameworks. • Requires Objective-C • Only runs on iOS (obviously) • Will generally run with the absolute best performance.
  • 28. Xcode • Download from App Store $4.99 Download
  • 29. Xcode • Download from App Store $4.99 Download
  • 30. Xcode • Download from App Store $4.99 Download 4.1 is now free
  • 32. Getting Started • Things you should know
  • 33. Getting Started • Things you should know • Classical OO
  • 34. Getting Started • Things you should know • Classical OO • Classes
  • 35. Getting Started • Things you should know • Classical OO • Classes • Inheritance
  • 36. Getting Started • Things you should know • Classical OO • Classes • Inheritance • Polymorphism
  • 39. Getting Started • Recommended but not required • Some knowledge of C
  • 40. Getting Started • Recommended but not required • Some knowledge of C • malloc() . . . free() ?
  • 41. Getting Started • Recommended but not required • Some knowledge of C • malloc() . . . free() ? • Some knowledge of design patterns:
  • 42. Getting Started • Recommended but not required • Some knowledge of C • malloc() . . . free() ? • Some knowledge of design patterns: • MVC, Singleton, Delegation
  • 43. Objective-C in 10 minutes
  • 45. About Objective-C • Object Oriented superset over C
  • 46. About Objective-C • Object Oriented superset over C Standard C
  • 47. About Objective-C • Object Oriented superset over C Standard C Objective-C
  • 48. About Objective-C • Object Oriented superset over C Standard C Objective-C • Anything that works in C will work in Objective-C
  • 49. Obj-C in 10 minutes
  • 50. Obj-C in 10 minutes • All the things you know from C
  • 51. Obj-C in 10 minutes • All the things you know from C • Variables are typed:
  • 52. Obj-C in 10 minutes • All the things you know from C • Variables are typed: • int, float, double, char
  • 53. Obj-C in 10 minutes • All the things you know from C • Variables are typed: • int, float, double, char int foo = 5;
  • 54. Obj-C in 10 minutes • All the things you know from C • Variables are typed: • int, float, double, char int foo = 5; • Separate compilation
  • 55. Obj-C in 10 minutes • All the things you know from C • Variables are typed: • int, float, double, char int foo = 5; • Separate compilation • .h for interface declaration
  • 56. Obj-C in 10 minutes • All the things you know from C • Variables are typed: • int, float, double, char int foo = 5; • Separate compilation • .h for interface declaration • .m for implementation (instead of .c)
  • 57. Obj-C in 10 minutes
  • 58. Obj-C in 10 minutes • Functions / Methods have return types and typed arguments
  • 59. Obj-C in 10 minutes • Functions / Methods have return types and typed arguments int sumOfItems(int i, int j) { return i + j; }
  • 60. Obj-C in 10 minutes • Functions / Methods have return types and typed arguments int sumOfItems(int i, int j) { return i + j; } • Other types
  • 61. Obj-C in 10 minutes • Functions / Methods have return types and typed arguments int sumOfItems(int i, int j) { return i + j; } • Other types • void, NULL
  • 62. Obj-C in 10 minutes • Functions / Methods have return types and typed arguments int sumOfItems(int i, int j) { return i + j; } • Other types • void, NULL • pointers to types (int *, void *)
  • 63. Obj-C in 10 minutes
  • 64. Obj-C in 10 minutes • Objective-C Additions:
  • 65. Obj-C in 10 minutes • Objective-C Additions: • BOOL - YES / NO
  • 66. Obj-C in 10 minutes • Objective-C Additions: • BOOL - YES / NO BOOL isSet = YES;
  • 67. Obj-C in 10 minutes • Objective-C Additions: • BOOL - YES / NO BOOL isSet = YES; • id - strictly a pointer to an object
  • 68. Obj-C in 10 minutes • Objective-C Additions: • BOOL - YES / NO BOOL isSet = YES; • id - strictly a pointer to an object • nil - a zero’d out pointer
  • 69. Obj-C in 10 minutes • Objective-C Additions: • BOOL - YES / NO BOOL isSet = YES; • id - strictly a pointer to an object • nil - a zero’d out pointer • nil != (necessarily) NULL or 0
  • 70. Obj-C in 10 minutes
  • 71. Obj-C in 10 minutes • Classes
  • 72. Obj-C in 10 minutes • Classes • Exist as a class pair
  • 73. Obj-C in 10 minutes • Classes • Exist as a class pair • Instance variables and instance methods act on an instance object
  • 74. Obj-C in 10 minutes • Classes • Exist as a class pair • Instance variables and instance methods act on an instance object • Class (static) methods act on the class object
  • 75. Obj-C in 10 minutes • Classes • Exist as a class pair • Instance variables and instance methods act on an instance object • Class (static) methods act on the class object • There is only ever one class object at any given time
  • 76. Obj-C in 10 minutes • Classes • Exist as a class pair • Instance variables and instance methods act on an instance object • Class (static) methods act on the class object • There is only ever one class object at any given time • Class variables really don’t exist
  • 77. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } + (NSString *)className; - (void)logMe; @property (nonatomic, retain) id aChildObject; @end
  • 78. Obj-C in 10 minutes • Classes Include a header #import <Foundation/Foundation.h> file @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } + (NSString *)className; - (void)logMe; @property (nonatomic, retain) id aChildObject; @end
  • 79. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> Declare interface @interface MyClass : NSObject extends { NSObject id aChildObject; NSArray *someItems; } + (NSString *)className; - (void)logMe; @property (nonatomic, retain) id aChildObject; @end
  • 80. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; Class instance NSArray *someItems; variables } + (NSString *)className; - (void)logMe; @property (nonatomic, retain) id aChildObject; @end
  • 81. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } A class (static) + (NSString *)className; - (void)logMe; method @property (nonatomic, retain) id aChildObject; @end
  • 82. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } + (NSString *)className; - (void)logMe; An instance method @property (nonatomic, retain) id aChildObject; @end
  • 83. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } A declared + (NSString *)className; property - (void)logMe; @property (nonatomic, retain) id aChildObject; @end
  • 84. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } + (NSString *)className; - (void)logMe; @property (nonatomic, retain) id aChildObject; Close the @end interface block
  • 85. Obj-C in 10 minutes • Classes #import <Foundation/Foundation.h> @interface MyClass : NSObject { id aChildObject; NSArray *someItems; } + (NSString *)className; - (void)logMe; @property (nonatomic, retain) id aChildObject; @end
  • 86. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass @synthesize aChildObject; - (id)init { self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 87. Obj-C in 10 minutes • Classes Include a header #import "MyClass.h" file @implementation MyClass @synthesize aChildObject; - (id)init { self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 88. Obj-C in 10 minutes • Classes #import "MyClass.h" Begin @implementation MyClass implementation @synthesize aChildObject; block - (id)init { self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 89. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass Auto-generate @synthesize aChildObject; property - (id)init { self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 90. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass @synthesize aChildObject; - (id)init Initializer { (constructor) self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 91. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass @synthesize aChildObject; - (id)init { self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 92. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass @synthesize aChildObject; - (id)init { Call to super self = [super init]; if (self) class { someItems = [[NSArray alloc] init]; } return self; }
  • 93. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass @synthesize aChildObject; - (id)init { self = [super init]; “new” an array if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 94. Obj-C in 10 minutes • Classes #import "MyClass.h" @implementation MyClass @synthesize aChildObject; - (id)init { self = [super init]; if (self) { someItems = [[NSArray alloc] init]; } return self; }
  • 95. Obj-C in 10 minutes • Continued . . . - (void)dealloc { [aChildObject release]; [someItems release]; [super dealloc]; } - (void)logMe { NSLog(@"MyClass"); } + (NSString *)className { return NSStringFromClass([self class]); } @end
  • 96. Obj-C in 10 minutes • Continued . . . - (void)dealloc { Destructor [aChildObject release]; [someItems release]; [super dealloc]; } - (void)logMe { NSLog(@"MyClass"); } + (NSString *)className { return NSStringFromClass([self class]); } @end
  • 97. Obj-C in 10 minutes • Continued . . . - (void)dealloc { [aChildObject release]; [someItems release]; [super dealloc]; } - (void)logMe Instance method { implementation NSLog(@"MyClass"); } + (NSString *)className { return NSStringFromClass([self class]); } @end
  • 98. Obj-C in 10 minutes • Continued . . . - (void)dealloc { [aChildObject release]; [someItems release]; [super dealloc]; } - (void)logMe { NSLog(@"MyClass"); Class method } implementation + (NSString *)className { return NSStringFromClass([self class]); } @end
  • 99. Obj-C in 10 minutes • Continued . . . - (void)dealloc { [aChildObject release]; [someItems release]; [super dealloc]; } - (void)logMe { NSLog(@"MyClass"); } + (NSString *)className { return NSStringFromClass([self class]); End } implementation @end block
  • 100. Obj-C in 10 minutes • Continued . . . - (void)dealloc { [aChildObject release]; [someItems release]; [super dealloc]; } - (void)logMe { NSLog(@"MyClass"); } + (NSString *)className { return NSStringFromClass([self class]); } @end
  • 101. Obj-C in 10 minutes
  • 102. Obj-C in 10 minutes • What’s with all the ‘@’ and ‘[ ]’?
  • 103. Obj-C in 10 minutes • What’s with all the ‘@’ and ‘[ ]’? •@ • Objective-C keywords • Initializer for string constants
  • 104. Obj-C in 10 minutes • What’s with all the ‘@’ and ‘[ ]’? •@ • Objective-C keywords • Initializer for string constants • ‘[]’ • “Send a message to an object” • Like calling a method, but more dynamic
  • 105. Obj-C in 10 minutes
  • 106. Obj-C in 10 minutes • Method Calls (messages)
  • 107. Obj-C in 10 minutes • Method Calls (messages) • Names are intermixed with arguments:
  • 108. Obj-C in 10 minutes • Method Calls (messages) • Names are intermixed with arguments: • method definition - (void)setItems:(NSArray *)items childObject:(id)obj;
  • 109. Obj-C in 10 minutes • Method Calls (messages) • Names are intermixed with arguments: • method definition - (void)setItems:(NSArray *)items childObject:(id)obj; • method call [self setItems:[NSArray array] childObject:object];
  • 110. Obj-C in 10 minutes - (void)setItems:(NSArray *)items childObject:(id)obj;
  • 111. Obj-C in 10 minutes Return Type - (void)setItems:(NSArray *)items childObject:(id)obj;
  • 112. Obj-C in 10 minutes Return Type - (void)setItems:(NSArray *)items childObject:(id)obj; Method Name
  • 113. Obj-C in 10 minutes Return Type Arguments and Types - (void)setItems:(NSArray *)items childObject:(id)obj; Method Name
  • 114. Obj-C in 10 minutes [self setItems:[NSArray array] childObject:object];
  • 115. Obj-C in 10 minutes Receiver [self setItems:[NSArray array] childObject:object];
  • 116. Obj-C in 10 minutes Receiver [self setItems:[NSArray array] childObject:object]; Method Name
  • 117. Obj-C in 10 minutes Receiver Arguments [self setItems:[NSArray array] childObject:object]; Method Name
  • 118. Obj-C in 10 minutes
  • 119. Obj-C in 10 minutes • Protocols
  • 120. Obj-C in 10 minutes • Protocols • Analogous to interfaces @protocol MyProtocol <NSObject> - (void)protocolMethod; @property (nonatomic, retain) NSObject *anObject; @end
  • 121. Obj-C in 10 minutes • Protocols • Analogous to interfaces @protocol MyProtocol <NSObject> - (void)protocolMethod; @property (nonatomic, retain) NSObject *anObject; @end • Adopting a protocol @interface MyClass : NSObject <MyProtocol>
  • 122. Obj-C in 10 minutes • Categories - Something completely different • Add functionality to an existing class @interface NSString (firstChar) - (unichar)firstChar; @end @implementation NSString (reverse) - (unichar)firstChar { return [self characterAtIndex:0]; } @end
  • 123. Xcode Tour • Located in /Developer/Applications
  • 133. Run Controls Status Window (???) Window Configuration Navigator Code Editor Utilities Debug Area
  • 138. Model-View-Controller Model Controller View
  • 139. Model • Defines the data to be displayed in a view. • Model objects • Database Model • Web
  • 140. Controller • Negotiates communication between the model and the view. • Controls presentation logic • Updates the model Controller • Reflects those updates on the view
  • 141. View • Contains controls and UI Widgets • Informs the controller of updates. View
  • 142. Hello World Model Controller View (Hello_WorldViewController) (.xib) Label view
  • 143. Hello World Model Controller View (Hello_WorldViewController) (.xib) Label view
  • 144. Hello World Model Controller View (Hello_WorldViewController) (.xib) Label view
  • 146. Hello You • Basic string handling • Button control • TextField control • Outlets and Actions • Basic MVC
  • 147. Hello You Model Controller View (HelloYouViewController) (.xib) NSString: name view textField textField label label buttonTap: button
  • 151. HTML App • Shows interaction between webview content and the native development kit. • Modal View Controllers • UIImagePickerController
  • 152. The HTML <html> <head> <meta name = "viewport" content = "width = device-width"> </head> <body> <h1>Tap for photo</h1> <input type="button" value="Get Photo" onClick="window.location='http://getphoto'"/> <img width="320" height="200" id="image"/> </body> </html>
  • 153. The JavaScript var image=document.getElementById('image'); image.src = '%@' • %@ will be replaced by the image url
  • 154. Loading the webview NSError *error; NSString *filename = [[NSBundle mainBundle] pathForResource:@"webview" ofType:@"html"]; NSString *html = [NSString stringWithContentsOfFile:filename encoding:NSUTF8StringEncoding error:&error]; [webview loadHTMLString:html baseURL:nil];
  • 155. Intercepting the URL - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([[[request URL] absoluteString] isEqualToString:@"http://getphoto/"]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.modalPresentationStyle = UIModalTransitionStyleCoverVertical; picker.delegate = self; [self presentModalViewController:picker animated:YES]; return NO; } return YES; }
  • 156. iOS Development • Web: [email protected] http://zearfoss.wordpress.com @pzearfoss http://www.github.com/pzearfoss

Editor's Notes