Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

About Me

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

minne

Slide 5

Slide 5 text

GitHub

Slide 6

Slide 6 text

@nakajijjapan

Slide 7

Slide 7 text

iOS engineer

Slide 8

Slide 8 text

iOS engineer

Slide 9

Slide 9 text

fanatic

Slide 10

Slide 10 text

Talk about

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

Goal You get interested in Cocoa Programming

Slide 13

Slide 13 text

@nakajijapan as OS X Developer

Slide 14

Slide 14 text

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.

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Background

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Generate a Movie Manually Shot Preferences Preview Preview

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Asaren 8:00 ~ 9:00

Slide 28

Slide 28 text

Want you to enter our family

Slide 29

Slide 29 text

Introduction

Slide 30

Slide 30 text

NextSTEP

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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:

Slide 33

Slide 33 text

Cocoa

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

Features

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

Cocoa Bindings

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

Cocoa Bindings

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

Cocoa Bindings

Slide 47

Slide 47 text

Cocoa Bindings

Slide 48

Slide 48 text

Cocoa Bindings

Slide 49

Slide 49 text

Cocoa Bindings NSObjectController content 3FHJTUFSBTBO PCTFSWFS MyObject temperature 6QEBUF

Slide 50

Slide 50 text

Cocoa Bindings NSObjectController content /PUJGZ MyObject temperature /PUJGZ

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

Drag and Drop

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

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 }

Slide 58

Slide 58 text

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

Slide 59

Slide 59 text

Drag and Drop Teiten

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

Document Architecture

Slide 62

Slide 62 text

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

Slide 63

Slide 63 text

Document Architecture Mac Developer Library Document *NBHF 5FYU Document

Slide 64

Slide 64 text

Document Architecture Mac Developer Library Document 1IPUP4IPQ .VTJD Document

Slide 65

Slide 65 text

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

Slide 66

Slide 66 text

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

Slide 67

Slide 67 text

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

Slide 68

Slide 68 text

NSDocument

Slide 69

Slide 69 text

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

Slide 70

Slide 70 text

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

Slide 71

Slide 71 text

NSDocumentController

Slide 72

Slide 72 text

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

Slide 73

Slide 73 text

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

Slide 74

Slide 74 text

NSWindowController

Slide 75

Slide 75 text

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

Slide 76

Slide 76 text

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

Slide 77

Slide 77 text

NSWindowController Document Document Document DocumentController documents WindowController WindowController WindowController

Slide 78

Slide 78 text

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

Slide 79

Slide 79 text

NSViewController

Slide 80

Slide 80 text

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

Slide 81

Slide 81 text

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

Slide 82

Slide 82 text

NSViewController • Big Update!

Slide 83

Slide 83 text

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

Slide 84

Slide 84 text

NSViewController Window Window Window Window

Slide 85

Slide 85 text

NSViewController Window

Slide 86

Slide 86 text

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

Slide 87

Slide 87 text

Distributing

Slide 88

Slide 88 text

Distributing • AppStore • Developer Release

Slide 89

Slide 89 text

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

Slide 90

Slide 90 text

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

Slide 91

Slide 91 text

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

Slide 92

Slide 92 text

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

Slide 93

Slide 93 text

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

Slide 94

Slide 94 text

Installer

Slide 95

Slide 95 text

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

Slide 96

Slide 96 text

Installer

Slide 97

Slide 97 text

Installer Generate DMG file

Slide 98

Slide 98 text

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

Slide 99

Slide 99 text

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.

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

Conclusion

Slide 103

Slide 103 text

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

Slide 104

Slide 104 text

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

Slide 105

Slide 105 text

Let’ s TRY!!1

Slide 106

Slide 106 text

News!

Slide 107

Slide 107 text

ELECTRON

Slide 108

Slide 108 text

Announcement

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

shibuya.swift

Slide 112

Slide 112 text

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

Slide 113

Slide 113 text

Thanks.