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. Why? • Swiftͷग़ݱ • ςϯγϣϯΞήΞήϚοΫε • Mac Developer Programߪೖ •

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

    number of seconds. • Shooting interval I offers 2 pattern. • Saved images is converted to video.
  3. // set the drag type that allow let types:[AnyObject] =

    [NSImage.imageTypes(), NSFilenamesPboardType, kUTTypeURL] self.tableView.registerForDraggedTypes(types) NSTableView Registry Data Type
  4. 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
  5. // MARK: - Drag func tableView(tableView: NSTableView, pasteboardWriterForRow row: Int)

    -> NSPasteboardWriting? { return self.entity } NSPasteboardWriting /41BTUFCPBSE8SJUJOHϓϩτίϧΛ࣮૷ͨ͠Ϋϥε ͷΠϯελϯεΛฦ͢
  6. 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
  7. 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Λ࣮૷͍ͯ͠Δ