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

Introducing Teiten

Introducing Teiten

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

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

nakajijapan

July 14, 2015
Tweet

More Decks by nakajijapan

Other Decks in Technology

Transcript

  1. potatotips #19
    @nakajijapan
    Introducing Teiten

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  4. Not UIKit, but AppKit

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  15. About Teiten
    DEMO MOVIE

    View full-size slide

  16. ΋͏ͻͱͻͶΓ

    View full-size slide

  17. Drag and Drop

    View full-size slide

  18. Tech
    • Drag and Drop
    • AppKit
    • NSTableView

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  23. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  26. 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

    View full-size slide

  27. 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Λ࣮૷͍ͯ͠Δ

    View full-size slide

  28. Drag and Drop
    ׬੒

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide