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

Promotion activities for Mac OS X Development

nakajijapan
August 30, 2015
1.4k

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 Slide

  2. About Me

    View Slide

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

    View Slide

  4. minne

    View Slide

  5. GitHub

    View Slide

  6. @nakajijjapan

    View Slide

  7. iOS engineer

    View Slide

  8. iOS engineer

    View Slide

  9. fanatic

    View Slide

  10. Talk about

    View Slide

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

    View Slide

  12. Goal
    You get interested in
    Cocoa Programming

    View Slide

  13. @nakajijapan
    as OS X Developer

    View Slide

  14. 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 Slide

  15. View Slide

  16. View Slide

  17. View Slide

  18. Background

    View Slide

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

    View Slide

  20. View Slide

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

    View Slide

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

    View Slide

  23. View Slide

  24. Generate a Movie
    Manually Shot
    Preferences
    Preview
    Preview

    View Slide

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

    View Slide

  26. View Slide

  27. Asaren 8:00 ~ 9:00

    View Slide

  28. Want you to enter our family

    View Slide

  29. Introduction

    View Slide

  30. NextSTEP

    View Slide

  31. 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 Slide

  32. 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 Slide

  33. Cocoa

    View Slide

  34. 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 Slide

  35. 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 Slide

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

    View Slide

  37. Features

    View Slide

  38. 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 Slide

  39. 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 Slide

  40. 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 Slide

  41. Cocoa Bindings

    View Slide

  42. 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 Slide

  43. 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 Slide

  44. Cocoa Bindings

    View Slide

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

    View Slide

  46. Cocoa Bindings

    View Slide

  47. Cocoa Bindings

    View Slide

  48. Cocoa Bindings

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  55. Drag and Drop

    View Slide

  56. 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 Slide

  57. 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 Slide

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

    View Slide

  59. Drag and Drop
    Teiten

    View Slide

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

    View Slide

  61. Document Architecture

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  66. 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 Slide

  67. 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 Slide

  68. NSDocument

    View Slide

  69. 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 Slide

  70. 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 Slide

  71. NSDocumentController

    View Slide

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

    View Slide

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

    View Slide

  74. NSWindowController

    View Slide

  75. 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 Slide

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

    View Slide

  77. NSWindowController
    Document
    Document
    Document
    DocumentController
    documents
    WindowController
    WindowController
    WindowController

    View Slide

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

    View Slide

  79. NSViewController

    View Slide

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

    View Slide

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

    View Slide

  82. NSViewController
    • Big Update!

    View Slide

  83. 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 Slide

  84. NSViewController
    Window
    Window
    Window
    Window

    View Slide

  85. NSViewController
    Window

    View Slide

  86. 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 Slide

  87. Distributing

    View Slide

  88. Distributing
    • AppStore
    • Developer Release

    View Slide

  89. 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 Slide

  90. 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 Slide

  91. 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 Slide

  92. 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 Slide

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

    View Slide

  94. Installer

    View Slide

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

    View Slide

  96. Installer

    View Slide

  97. Installer
    Generate DMG file

    View Slide

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

    View Slide

  99. 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 Slide

  100. View Slide

  101. View Slide

  102. Conclusion

    View Slide

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

    View Slide

  104. 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 Slide

  105. Let’ s TRY!!1

    View Slide

  106. News!

    View Slide

  107. ELECTRON

    View Slide

  108. Announcement

    View Slide

  109. View Slide

  110. View Slide

  111. shibuya.swift

    View Slide

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

    View Slide

  113. Thanks.

    View Slide