Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Promotion activities for Mac OS X Development

nakajijapan
August 30, 2015
1.5k

Promotion activities for Mac OS X Development

Pepabo Tech Conference #3
~ YAPC::Asia PEPABO 2015 ~

nakajijapan

August 30, 2015
Tweet

Transcript

  1. Promotion activities
    for
    Mac OS X Development
    PEPABO Tech Conference #3
    @nakajijapan

    View full-size slide

  2. @nakajijapan
    Software Engineer
    GMO PEPABO inc.
    iOS / Web / OS X

    View full-size slide

  3. @nakajijjapan

    View full-size slide

  4. iOS engineer

    View full-size slide

  5. iOS engineer

    View full-size slide

  6. Talk about
    • Welcome to Cocoa Programming
    • Features
    • commonly used features
    • originally used features
    • distributing
    • installer

    View full-size slide

  7. Goal
    You get interested in
    Cocoa Programming

    View full-size slide

  8. @nakajijapan
    as OS X Developer

    View full-size slide

  9. As OS X Developer
    • One year…
    • I released OS X Application, which is only Teiten.
    • I have read a book, Cocoa Programming for OS X.

    View full-size slide

  10. Background
    • WWDC 2014
    • Swift
    • Product Driven Life
    • Look back over the past

    View full-size slide

  11. Teiten
    Teiten is an app that fixed-point
    observation a lot earnestly yourself
    by using a PC camera.

    View full-size slide

  12. Teiten
    Teiten is an app that fixed-point
    observation a lot earnestly yourself
    by using a PC camera.
    http://teiten.nakajijapan.net/

    View full-size slide

  13. Generate a Movie
    Manually Shot
    Preferences
    Preview
    Preview

    View full-size slide

  14. Technology
    • Camera Control
    • AVFoundation
    • Generating Movie
    • CoreVideo, CoreMedia
    • Drag and Drop
    • App Kit
    • NSTableView

    View full-size slide

  15. Asaren 8:00 ~ 9:00

    View full-size slide

  16. Want you to enter our family

    View full-size slide

  17. Introduction

    View full-size slide

  18. NextSTEP
    • Object-oriented, multitasking operating system based on UNIX
    • NeXT Computer 1980 - 1990s
    • The source and base of Mac OS X and iOS and WatchOS

    View full-size slide

  19. NextSTEP
    • Object-oriented, multitasking operating system based on UNIX
    • NeXT Computer 1980 - 1990s
    • The source and base of Mac OS X and iOS and WatchOS
    • a Unix-based operating system
    • a powerful window server
    • an elegant set of libraries and tools
    • NeXTSTEP also innovated a large number of other GUI
    • -> OPENSTEP
    Three features:

    View full-size slide

  20. Cocoa
    • is Apple's native object-oriented application programming interface
    (API) for the OS X operating system.
    • consists of
    • Foundation
    • basic classes
    • Appkit
    • UI components
    • Core Data
    • other
    • Cocoa Touch

    View full-size slide

  21. Cocoa.h
    /*
    Cocoa.h
    Cocoa Framework
    Copyright (c) 2000-2015, Apple Inc.
    All rights reserved.
    This file should be included by all Cocoa application source files for easy
    building. Using this file is preferred over importing individual files because
    it will use a precompiled version.
    Tools with no UI and no AppKit dependencies may prefer to include just
    .
    */
    #import
    #import
    #import

    View full-size slide

  22. Cocoa
    Window
    Server
    4.4 BSD UNIX
    Cocoa
    Your
    App
    Mach Microkernel
    FWFOU
    SFOEFSJOH

    View full-size slide

  23. Features
    • Notifications
    • UnitTest
    • Drawing Text With Attributes
    • User Defaults
    • Web Service
    • KVC KVO and Bindings
    • NSTimer
    • Localization and Bundles
    • Auto Layout
    • Storyboard
    • Concurrency
    • CoreAnimation

    View full-size slide

  24. Features
    • Notifications
    • UnitTest
    • Drawing Text With Attributes
    • User Defaults
    • Web Service
    • KVC KVO and Bindings
    • NSTimer
    • Localization and Bundles
    • Auto Layout
    • Storyboard
    • Concurrency
    • CoreAnimation
    I don’t talk
    features related
    to UIKit

    View full-size slide

  25. Features
    • Notifications
    • UnitTest
    • Drawing Text With Attributes
    • User Defaults
    • Web Service
    • KVC KVO and Bindings
    • NSTimer
    • Localization and Bundles
    • Auto Layout
    • Storyboard
    • Concurrency
    • CoreAnimation

    View full-size slide

  26. Cocoa Bindings

    View full-size slide

  27. Cocoa Bindings
    • provides a means of keeping model and view values synchronized
    without you having to write a lot of “glue code.”
    • decrease the amount of code
    Mac Developer Library

    View full-size slide

  28. Cocoa Bindings
    • provides a means of keeping model and view values synchronized
    without you having to write a lot of “glue code.”
    • decrease the amount of code
    • KVC
    • KVO
    Mac Developer Library

    View full-size slide

  29. Cocoa Bindings

    View full-size slide

  30. Cocoa Bindings
    Controller
    temperature
    updateTemperature()
    numberLabel.text
    = “\(self.temperature)”
    8

    View full-size slide

  31. Cocoa Bindings

    View full-size slide

  32. Cocoa Bindings

    View full-size slide

  33. Cocoa Bindings

    View full-size slide

  34. Cocoa Bindings
    NSObjectController
    content
    3FHJTUFSBTBO
    PCTFSWFS
    MyObject
    temperature
    6QEBUF

    View full-size slide

  35. Cocoa Bindings
    NSObjectController
    content
    /PUJGZ
    MyObject
    temperature
    /PUJGZ

    View full-size slide

  36. Cocoa Bindings
    NSObjectController
    content
    /PUJGZ
    MyObject
    temperature
    /PUJGZ
    Simple!

    View full-size slide

  37. Features
    • Undo
    • Keyboard Event
    • Mouse Gestures
    • Drag and Drop
    • Alert
    • Mouse Event
    • NSView
    • NSViewController
    • NSArrayController
    • NSWindowController
    • NSDocument
    • NSDocumentController
    • NSTask

    View full-size slide

  38. Features
    • Undo
    • Keyboard Event
    • Mouse Gestures
    • Drag and Drop
    • Alert
    • Mouse Event
    • NSView
    • NSViewController
    • NSArrayController
    • NSWindowController
    • NSDocument
    • NSDocumentController
    • NSTask

    View full-size slide

  39. Features
    • Undo
    • Keyboard Event
    • Mouse Gestures
    • Drag and Drop
    • Alert
    • Mouse Event
    • NSView
    • NSViewController
    • NSArrayController
    • NSWindowController
    • NSDocument
    • NSDocumentController
    • NSTask

    View full-size slide

  40. Drag and Drop

    View full-size slide

  41. Drag and Drop
    • A flashy copy and paste
    • Both the drag source and the drag destination must agree on the operation
    • Cross Application Drag and Drop

    View full-size slide

  42. Drag and Drop
    struct NSDragOperation : RawOptionSetType {
    init(_ rawValue: UInt)
    init(rawValue: UInt)
    static var None: NSDragOperation { get }
    static var Copy: NSDragOperation { get }
    static var Link: NSDragOperation { get }
    static var Generic: NSDragOperation { get }
    static var Private: NSDragOperation { get }
    static var Move: NSDragOperation { get }
    static var Delete: NSDragOperation { get }
    static var Every: NSDragOperation { get }
    @availability(OSX, introduced=10.0, deprecated=10.10)
    static var All_Obsolete: NSDragOperation { get } // Use NSDragOperationEvery
    @availability(OSX, introduced=10.0, deprecated=10.10)
    static var All: NSDragOperation { get } // Use NSDragOperationEvery
    }

    View full-size slide

  43. Drag and Drop
    • register dragged type
    • drag source
    • drag destination
    • mouse gesture
    • pasteboard
    DiceView.swift

    View full-size slide

  44. Drag and Drop
    Teiten

    View full-size slide

  45. Features
    • Undo
    • Keyboard Event
    • Mouse Gestures
    • Drag and Drop
    • Alert
    • Mouse Event
    • NSView
    • NSViewController
    • NSArrayController
    • NSWindowController
    • NSDocument
    • NSDocumentController
    • NSTask

    View full-size slide

  46. Document Architecture

    View full-size slide

  47. Document Architecture
    Mac Developer Library
    a container for a body of information
    Document

    View full-size slide

  48. Document Architecture
    Mac Developer Library
    Document
    *NBHF
    5FYU
    Document

    View full-size slide

  49. Document Architecture
    Mac Developer Library
    Document
    1IPUP4IPQ
    .VTJD
    Document

    View full-size slide

  50. Document Architecture
    Mac Developer Library
    a container for a body of information
    Document

    View full-size slide

  51. Document Architecture
    • Duties
    • saving the model data to a file
    • loading the model data from a file
    • giving the views the data to display
    • taking user input from the views and updating the model
    Mac Developer Library

    View full-size slide

  52. Document Architecture
    • Constituting
    • NSDocument
    • create, presents, and store document data
    • NSDocumentController
    • Manages all of the document objects in the app
    • NSWindowController
    • display and manage a window
    Mac Developer Library

    View full-size slide

  53. Document Architecture
    • Duties
    • saving the model data to a file
    • loading the model data from a file
    • giving the views the data to display
    • taking user input from the views and updating the model

    View full-size slide

  54. Document Architecture
    • Duties
    • saving the model data to a file
    • loading the model data from a file
    • giving the views the data to display
    • taking user input from the views and updating the model
    Model

    View full-size slide

  55. NSDocumentController

    View full-size slide

  56. NSDocumentController
    • manages all of the document objects in the app
    • creates only one in the app
    • has autosavingDelay property
    Mac Developer Library

    View full-size slide

  57. NSDocumentController
    Document
    Document
    Document
    [AnyObject]
    DocumentController
    documents
    NBOBHFT
    BOBQQMJDBUJPO`TEPDVNFOUT

    View full-size slide

  58. NSWindowController

    View full-size slide

  59. NSWindowController
    • manages a window, usually a window stored in a nib file.
    • manage a window by itself or as a role player in the Application Kit’s
    document-based architecture, which also includes NSDocument and
    NSDocumentController objects.
    Mac Developer Library

    View full-size slide

  60. NSDocumentController
    Document
    Document
    Document
    [AnyObject]
    DocumentController
    documents
    NBOBHFT
    BOBQQMJDBUJPO`TEPDVNFOUT

    View full-size slide

  61. NSWindowController
    Document
    Document
    Document
    DocumentController
    documents
    WindowController
    WindowController
    WindowController

    View full-size slide

  62. NSWindowController
    Document
    Document
    Document
    DocumentController
    documents
    WindowController
    WindowController
    WindowController
    1 per window 1 per document
    1 per app

    View full-size slide

  63. NSViewController

    View full-size slide

  64. NSViewController
    • A view controller manages a view, typically loaded from a nib file.
    • NSViewController
    • NSPageController
    • NSCollectionViewItem
    • NSSplitViewController
    • NSTabViewController

    View full-size slide

  65. NSViewController
    049:PTFNJUF3FMFBTF/PUFT$PDPB"QQMJDBUJPO'SBNFXPSL

    View full-size slide

  66. NSViewController
    • Big Update!

    View full-size slide

  67. NSViewController
    • Added OS X 10.5
    • Prior to OS X 10.10
    • View Controllers were not part of the responder chain.
    • View life cycle methods such as viewDidLoad(), viewWillAppear()
    • Cocoa did not provide any container view controllers
    • NSWindow’s contentViewController was not available
    • OS X 10.10 Yosemite Release Notes Cocoa Application Framework
    • Almost the same feature UIViewController for iOS

    View full-size slide

  68. NSViewController
    Window
    Window
    Window
    Window

    View full-size slide

  69. NSViewController
    Window

    View full-size slide

  70. NSViewController
    • Added OS X 10.5
    • Prior to OS X 10.10
    • View Controllers were not part of the responder chain.
    • View life cycle methods such as viewDidLoad(), viewWillAppear()
    • Cocoa did not provide any container view controllers
    • NSWindow’s contentViewController was not available
    • OS X 10.10 Yosemite Release Notes Cocoa Application Framework
    • Almost the same feature UIViewController for iOS
    • Storyboards
    • Container

    View full-size slide

  71. Distributing

    View full-size slide

  72. Distributing
    • AppStore
    • Developer Release

    View full-size slide

  73. Distributing
    • Mac App Store
    • almost managed by Apple
    • can use App Services
    • iCloud Storage, In-App Purchase, Game Center, Push Notifications
    • Outside the Mac App Store
    • almost managed by Developer
    • no need to wait the review for Apple

    View full-size slide

  74. Distributing
    .BD"QQ4UPSF
    0VUTJEF.BD"QQ4UPSF
    XJUI%FWFMPQFS*%

    Ap Distribution Hosted by Apple
    Managed by developer
    (with Developer ID)
    Software Updates Hosted by Apple Managed by developer
    Worldwide Payment Processing Managed by Apple Managed by developer
    Volume Purchasing
    and Education Pricing
    Managed by Apple Managed by developer
    App Services
    (iCloud Storage, In-App Purchase, Game Center, Push
    Notifications)
    Available Not Available
    App Sandboxing Required Recommended

    View full-size slide

  75. Distributing
    .BD"QQ4UPSF
    0VUTJEF.BD"QQ4UPSF
    XJUI%FWFMPQFS*%

    Ap Distribution Hosted by Apple
    Managed by developer
    (with Developer ID)
    Software Updates Hosted by Apple Managed by developer
    Worldwide Payment Processing Managed by Apple Managed by developer
    Volume Purchasing
    and Education Pricing
    Managed by Apple Managed by developer
    App Services
    (iCloud Storage, In-App Purchase, Game Center, Push
    Notifications)
    Available Not Available
    App Sandboxing Required Recommended

    View full-size slide

  76. Distributing
    .BD"QQ4UPSF
    0VUTJEF.BD"QQ4UPSF
    XJUI%FWFMPQFS*%

    Ap Distribution Hosted by Apple
    Managed by developer
    (with Developer ID)
    Software Updates Hosted by Apple Managed by developer
    Worldwide Payment Processing Managed by Apple Managed by developer
    Volume Purchasing
    and Education Pricing
    Managed by Apple Managed by developer
    App Services
    (iCloud Storage, In-App Purchase, Game Center, Push
    Notifications)
    Available Not Available
    App Sandboxing Required Recommended

    View full-size slide

  77. App Sandboxing
    • is an access control technology
    0UIFS
    6TFS%BUB
    0UIFS
    4ZTUFN3FTPVSDFT
    :PVSBQQ
    sandbox
    noaccess

    View full-size slide

  78. Installer
    • Mac App Store
    • unnecessary
    • itself installer
    • Outside the Mac App Store
    • DMG File

    View full-size slide

  79. Installer
    Generate DMG file

    View full-size slide

  80. Installer
    • DMG File
    • archive
    • decide a behavior in running disk image
    • convert to read only image
    ditto, hdid, and hdiutil
    Command
    AppleScript
    behavior

    View full-size slide

  81. Installer
    man Command
    ITTO(1) BSD General Commands Manual DITTO(1)
    NAME
    ditto -- copy directory hierarchies, create and extract archives
    SYNOPSIS
    ditto [-v] [-V] [-X] [] src ... dst_directory
    ditto [-v] [-V] [] src_file dst_file
    ditto -c [-z | -j | -k] [-v] [-V] [-X] [] src dst_archive
    ditto -x [-z | -j | -k] [-v] [-V] [] src_archive ... dst_directory
    ditto -h | --help
    DESCRIPTION
    In its first form, ditto copies one or more source files or directories to a destination directory. If the destination directory does not exist it will be created before the first source is copied. If the destination directory already
    exists then the source directories are merged with the previous contents of the destination.
    In its second form, ditto copies a file to the supplied dst_file pathname.
    The next two forms reflect ditto's ability to create and extract archives. These archives can be either CPIO format (preferred for unix content) or PKZip (for Windows compatibility). src_archive (and dst_archive) can be the single char-
    acter '-', causing ditto to read (write) archive data from stdin (or to stdout, respectively).
    ditto follows symbolic links provided as arguments but does not follow any links as it traverses the source or destination hierarchies. ditto overwrites existing files, symbolic links, and devices in the destination when these are copied
    from a source. The resulting files, links, and devices will have the same mode, access time, modification time, owner, and group as the source items from which they are copied. Pipes, sockets, and files with names beginning with .nfs or
    .afpDeleted will be ignored. ditto does not modify the mode, owner, group, extended attributes, or ACLs of existing directories in the destination. Files and symbolic links cannot overwrite directories or vice-versa.
    ditto can be used to "thin" Universal Mach-O binaries during a copy. ditto can also copy files selectively based on the contents of a BOM ("Bill of Materials") file. ditto preserves file hard links (but not directory hard links) present
    in the source directories and preserves setuid and setgid modes when run as the superuser.
    ditto will preserve resource forks and HFS meta-data information when copying unless instructed otherwise using --norsrc . Similarly, ditto will preserve extended attributes and Access Control Lists (ACLs) unless --noextattr or --noacl
    is passed. DITTONORSRC can be set in the environment as an alias to --norsrc --noextattr --noacl on the command line.
    OPTIONS
    -h Print full usage.
    -v Print a line of output to stderr for each source directory copied.
    -V Print a line of output to stderr for every file, symbolic link, and device copied.
    -X When copying one or more source directories, do not descend into directories that have a different device ID.
    -c Create an archive at the destination path. The default format is CPIO, unless -k is given. CPIO archives should be stored in files with names ending in .cpio. Compressed CPIO archives should be stored in files with names
    ending in .cpgz.
    -z Create compressed CPIO archives, using gzip(1) compression.
    -j Create compressed CPIO archives, using bzip2(1) compression.
    -x Extract the archives given as source arguments. The format is assumed to be CPIO, unless -k is given. Compressed CPIO is automatically handled.
    -k Create or extract from a PKZip archive instead of the default CPIO. PKZip archives should be stored in filenames ending in .zip.
    --keepParent When creating an archive, embed the parent directory name src in dst_archive.
    --arch arch Thin Universal binaries to the specified architecture. If multiple --arch options are specified then the resulting destination file will contain each of the specified architectures (if they are present in the source file).
    arch should be specified as "i386", "x86_64", etc.
    --bom bom Copy only files, links, devices, and directories that are present in the specified BOM.
    --rsrc Preserve resource forks and HFS meta-data. ditto will store this data in Carbon-compatible ._ AppleDouble files on filesystems that do not natively support resource forks. As of Mac OS X 10.4, --rsrc is default behavior.
    --norsrc Do not preserve resource forks and HFS meta-data. If both --norsrc and --rsrc are passed, whichever is passed last will take precedence. Both options override DITTONORSRC. Unless explicitly specified, --norsrc also implies
    --noextattr and --noacl to match the behavior of Mac OS X 10.4.
    --extattr Preserve extended attributes (requires --rsrc). As of Mac OS X 10.5, --extattr is the default.

    View full-size slide

  82. Conclusion
    • Welcome to Cocoa Programming
    • Features
    • commonly used features
    • originally used features
    • distributing
    • installer

    View full-size slide

  83. Conclusion
    • Welcome to Cocoa Programming
    • Features
    • commonly used features
    • originally used features
    • distributing
    • installer
    • I'm glad if you was interested even a little in Cocoa

    View full-size slide

  84. Let’ s TRY!!1

    View full-size slide

  85. Announcement

    View full-size slide

  86. shibuya.swift

    View full-size slide

  87. We are hiring!!!
    http://pepabo.com/recruit/career/#jobs

    View full-size slide