Promotion activities for Mac OS X Development

A77456b262557e22986345f6d0555c58?s=47 nakajijapan
August 30, 2015
1.1k

Promotion activities for Mac OS X Development

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

A77456b262557e22986345f6d0555c58?s=128

nakajijapan

August 30, 2015
Tweet

Transcript

  1. Promotion activities for Mac OS X Development PEPABO Tech Conference

    #3 @nakajijapan
  2. About Me

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

    OS X
  4. minne

  5. GitHub

  6. @nakajijjapan

  7. iOS engineer

  8. iOS engineer

  9. fanatic

  10. Talk about

  11. Talk about • Welcome to Cocoa Programming • Features •

    commonly used features • originally used features • distributing • installer
  12. Goal You get interested in Cocoa Programming

  13. @nakajijapan as OS X Developer

  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.
  15. None
  16. None
  17. None
  18. Background

  19. Background • WWDC 2014 • Swift • Product Driven Life

    • Look back over the past
  20. None
  21. Teiten Teiten is an app that fixed-point observation a lot

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

    earnestly yourself by using a PC camera. http://teiten.nakajijapan.net/
  23. None
  24. Generate a Movie Manually Shot Preferences Preview Preview

  25. Technology • Camera Control • AVFoundation • Generating Movie •

    CoreVideo, CoreMedia • Drag and Drop • App Kit • NSTableView
  26. None
  27. Asaren 8:00 ~ 9:00

  28. Want you to enter our family

  29. Introduction

  30. NextSTEP

  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
  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:
  33. Cocoa

  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
  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 <Foundation/Foundation.h>. */ #import <Foundation/Foundation.h> #import <AppKit/AppKit.h> #import <CoreData/CoreData.h>
  36. Cocoa Window Server 4.4 BSD UNIX Cocoa Your App Mach

    Microkernel FWFOU SFOEFSJOH
  37. Features

  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
  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
  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
  41. Cocoa Bindings

  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
  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
  44. Cocoa Bindings

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

  46. Cocoa Bindings

  47. Cocoa Bindings

  48. Cocoa Bindings

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

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

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

  52. Features • Undo • Keyboard Event • Mouse Gestures •

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

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

    Drag and Drop • Alert • Mouse Event • NSView • NSViewController • NSArrayController • NSWindowController • NSDocument • NSDocumentController • NSTask
  55. Drag and Drop

  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
  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 }
  58. Drag and Drop • register dragged type • drag source

    • drag destination • mouse gesture • pasteboard DiceView.swift
  59. Drag and Drop Teiten

  60. Features • Undo • Keyboard Event • Mouse Gestures •

    Drag and Drop • Alert • Mouse Event • NSView • NSViewController • NSArrayController • NSWindowController • NSDocument • NSDocumentController • NSTask
  61. Document Architecture

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

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

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

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

    of information Document
  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
  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
  68. NSDocument

  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
  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
  71. NSDocumentController

  72. NSDocumentController • manages all of the document objects in the

    app • creates only one in the app • has autosavingDelay property Mac Developer Library
  73. NSDocumentController Document Document Document [AnyObject] DocumentController documents NBOBHFT BOBQQMJDBUJPO`TEPDVNFOUT

  74. NSWindowController

  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
  76. NSDocumentController Document Document Document [AnyObject] DocumentController documents NBOBHFT BOBQQMJDBUJPO`TEPDVNFOUT

  77. NSWindowController Document Document Document DocumentController documents WindowController WindowController WindowController

  78. NSWindowController Document Document Document DocumentController documents WindowController WindowController WindowController 1

    per window 1 per document 1 per app
  79. NSViewController

  80. NSViewController • A view controller manages a view, typically loaded

    from a nib file. • NSViewController • NSPageController • NSCollectionViewItem • NSSplitViewController • NSTabViewController
  81. NSViewController 049:PTFNJUF3FMFBTF/PUFT$PDPB"QQMJDBUJPO'SBNFXPSL

  82. NSViewController • Big Update!

  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
  84. NSViewController Window Window Window Window

  85. NSViewController Window

  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
  87. Distributing

  88. Distributing • AppStore • Developer Release

  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
  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
  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
  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
  93. App Sandboxing • is an access control technology 0UIFS 6TFS%BUB

    0UIFS 4ZTUFN3FTPVSDFT :PVSBQQ sandbox noaccess
  94. Installer

  95. Installer • Mac App Store • unnecessary • itself installer

    • Outside the Mac App Store • DMG File
  96. Installer

  97. Installer Generate DMG file

  98. Installer • DMG File • archive • decide a behavior

    in running disk image • convert to read only image ditto, hdid, and hdiutil Command AppleScript behavior
  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] [<options>] src ... dst_directory ditto [-v] [-V] [<options>] src_file dst_file ditto -c [-z | -j | -k] [-v] [-V] [-X] [<options>] src dst_archive ditto -x [-z | -j | -k] [-v] [-V] [<options>] 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.
  100. None
  101. None
  102. Conclusion

  103. Conclusion • Welcome to Cocoa Programming • Features • commonly

    used features • originally used features • distributing • installer
  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
  105. Let’ s TRY!!1

  106. News!

  107. ELECTRON

  108. Announcement

  109. None
  110. None
  111. shibuya.swift

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

  113. Thanks.