Slide 1

Slide 1 text

potatotips #19 @nakajijapan Introducing Teiten

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

NKJMultiMovieCaptureView https://github.com/nakajijapan/NKJMultiMovieCaptureView NKJMovieComposer https://github.com/nakajijapan/NKJMovieComposer NKJPagerViewController https://github.com/nakajijapan/NKJPagerViewController etc PhotoSlider https://github.com/nakajijapan/PhotoSlider

Slide 4

Slide 4 text

Not UIKit, but AppKit

Slide 5

Slide 5 text

UIKitͷ஌͕ࣝ͋Ε͹ ͳΜͰ΋Ͱ͖Δ

Slide 6

Slide 6 text

UIKitͷ஌͕ࣝ͋Ε͹ ͳΜͰ΋Ͱ͖Δ ͳΜͱ͔

Slide 7

Slide 7 text

OS XΞϓϦ ࡞ͬͯΈ·ͨ͠

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Teiten https://github.com/nakajijapan/teiten

Slide 10

Slide 10 text

Teiten https://github.com/nakajijapan/teiten

Slide 11

Slide 11 text

Teiten https://github.com/nakajijapan/teiten

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Why? • Swiftͷग़ݱ • ςϯγϣϯΞήΞήϚοΫε • Mac Developer Programߪೖ • ͓ۚͱ͍͏ϓϨογϟʔ • ݸਓతʹ؂ࢹ͢Δͷ͕޷͖ • ৗࣝͷൣғ಺ʂʂ

Slide 14

Slide 14 text

What? • You can capture a photo by each specified number of seconds. • Shooting interval I offers 2 pattern. • Saved images is converted to video.

Slide 15

Slide 15 text

Tech • Camera Control • AVFoundation • Generating Movie • CoreVideo, CoreMedia

Slide 16

Slide 16 text

ಈըੜ੒ खಈࡱӨ ઃఆ Χ΢ϯτμ΢ϯ ϓϨϏϡʔ About Teiten

Slide 17

Slide 17 text

About Teiten DEMO MOVIE

Slide 18

Slide 18 text

΋͏ͻͱͻͶΓ

Slide 19

Slide 19 text

LGTM‼

Slide 20

Slide 20 text

Drag and Drop

Slide 21

Slide 21 text

Tech • Drag and Drop • AppKit • NSTableView

Slide 22

Slide 22 text

Tech • Drag and Drop • AppKit • NSTableView %SBHHJOHͷૢ࡞͕͋Β͔͡Ί༻ҙ͞Ε͍ͯΔ

Slide 23

Slide 23 text

Drag and Drop NSTableView ҰߦҰྻͰߏ੒

Slide 24

Slide 24 text

// set the drag type that allow let types:[AnyObject] = [NSImage.imageTypes(), NSFilenamesPboardType, kUTTypeURL] self.tableView.registerForDraggedTypes(types) NSTableView Registry Data Type

Slide 25

Slide 25 text

self.tableView.setDraggingSourceOperationMask( NSDragOperation.Every, forLocal: false ) NSTableView υϥοάͰ͖Δૢ࡞ͷछྨɺଞͷWindowʹ΋ υϥοάͰ͖Δ͔Ͳ͏͔΋ࢦఆͰ͖Δ

Slide 26

Slide 26 text

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 } NSTableView NSDragOperation

Slide 27

Slide 27 text

// MARK: - Drag func tableView(tableView: NSTableView, pasteboardWriterForRow row: Int) -> NSPasteboardWriting? { return self.entity } NSPasteboardWriting /41BTUFCPBSE8SJUJOHϓϩτίϧΛ࣮૷ͨ͠Ϋϥε ͷΠϯελϯεΛฦ͢

Slide 28

Slide 28 text

NSPasteboardWriting • NSPasteboardͷ࢓૊ΈΛར༻͢Δ • NSTableView͕ͦͷ࢓૊ΈΛ಺แ͍ͯ͠ΔͷͰͦͷ·· ར༻͢Δ • NSPasteboardWritingϓϩτίϧΛ࣮૷͢Δ • ϖʔετͨ͠ͱ͖ͷॻ͖ࠐΈઃఆ

Slide 29

Slide 29 text

class FileEntity: NSObject, NSPasteboardWriting { var fileURL:NSURL! (..snip..) // MARK: - NSPasteboardWriting func writableTypesForPasteboard(pasteboard: NSPasteboard!) -> [AnyObject]! { return self.fileURL.writableTypesForPasteboard(pasteboard) } func pasteboardPropertyListForType(type: String!) -> AnyObject! { return self.fileURL.pasteboardPropertyListForType(type) } func writinOptionsForType(type: String!, pasteboard: NSPasteboard!) -> NSPasteboardWritingOptions { return self.fileURL.writingOptionsForType(type, pasteboard: pasteboard) } } NSPasteboardWriting Protocol

Slide 30

Slide 30 text

class FileEntity: NSObject, NSPasteboardWriting { var fileURL:NSURL! (..snip..) // MARK: - NSPasteboardWriting func writableTypesForPasteboard(pasteboard: NSPasteboard!) -> [AnyObject]! { return self.fileURL.writableTypesForPasteboard(pasteboard) } func pasteboardPropertyListForType(type: String!) -> AnyObject! { return self.fileURL.pasteboardPropertyListForType(type) } func writinOptionsForType(type: String!, pasteboard: NSPasteboard!) -> NSPasteboardWritingOptions { return self.fileURL.writingOptionsForType(type, pasteboard: pasteboard) } } NSPasteboardWriting NSPasteboardWriting͸NSURLΛ࣮૷͍ͯ͠Δ

Slide 31

Slide 31 text

Drag and Drop ׬੒

Slide 32

Slide 32 text

Demo

Slide 33

Slide 33 text

·ͱΊ

Slide 34

Slide 34 text

Good • UIKitɺͦΕҎ֎ͷframeworkΛଟ༻͍ͯ͠Ε͹ͱ͔͔ͬ Γ͸े෼ • ͋Δఔ౓ͷ΋ͷ͸؆୯ʹ࡞੒Ͱ͖ͯ͠·͏

Slide 35

Slide 35 text

Not Good • OS Xಛ༗ͷॲཧΛ͠Α͏ͱ͢Δͱ͔ͬ͠ΓυΩϡϝϯτ ΛಡΉඞཁ͕͋Δ

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

Thanks.