Introducing Teiten

Introducing Teiten

Teiten - 定点観測アプリ の紹介をしました。
http://teiten.nakajijapan.net/

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

A77456b262557e22986345f6d0555c58?s=128

nakajijapan

July 14, 2015
Tweet

Transcript

  1. potatotips #19 @nakajijapan Introducing Teiten

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

    OS X
  3. 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

  4. Not UIKit, but AppKit

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

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

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

  8. None
  9. Teiten https://github.com/nakajijapan/teiten

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

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

  12. None
  13. Why? • Swiftͷग़ݱ • ςϯγϣϯΞήΞήϚοΫε • Mac Developer Programߪೖ •

    ͓ۚͱ͍͏ϓϨογϟʔ • ݸਓతʹ؂ࢹ͢Δͷ͕޷͖ • ৗࣝͷൣғ಺ʂʂ
  14. What? • You can capture a photo by each specified

    number of seconds. • Shooting interval I offers 2 pattern. • Saved images is converted to video.
  15. Tech • Camera Control • AVFoundation • Generating Movie •

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

  17. About Teiten DEMO MOVIE

  18. ΋͏ͻͱͻͶΓ

  19. LGTM‼

  20. Drag and Drop

  21. Tech • Drag and Drop • AppKit • NSTableView

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

  23. Drag and Drop NSTableView ҰߦҰྻͰߏ੒

  24. // set the drag type that allow let types:[AnyObject] =

    [NSImage.imageTypes(), NSFilenamesPboardType, kUTTypeURL] self.tableView.registerForDraggedTypes(types) NSTableView Registry Data Type
  25. self.tableView.setDraggingSourceOperationMask( NSDragOperation.Every, forLocal: false ) NSTableView υϥοάͰ͖Δૢ࡞ͷछྨɺଞͷWindowʹ΋ υϥοάͰ͖Δ͔Ͳ͏͔΋ࢦఆͰ͖Δ

  26. 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
  27. // MARK: - Drag func tableView(tableView: NSTableView, pasteboardWriterForRow row: Int)

    -> NSPasteboardWriting? { return self.entity } NSPasteboardWriting /41BTUFCPBSE8SJUJOHϓϩτίϧΛ࣮૷ͨ͠Ϋϥε ͷΠϯελϯεΛฦ͢
  28. NSPasteboardWriting • NSPasteboardͷ࢓૊ΈΛར༻͢Δ • NSTableView͕ͦͷ࢓૊ΈΛ಺แ͍ͯ͠ΔͷͰͦͷ·· ར༻͢Δ • NSPasteboardWritingϓϩτίϧΛ࣮૷͢Δ • ϖʔετͨ͠ͱ͖ͷॻ͖ࠐΈઃఆ

  29. 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
  30. 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Λ࣮૷͍ͯ͠Δ
  31. Drag and Drop ׬੒

  32. Demo

  33. ·ͱΊ

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

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

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

  37. Thanks.