-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPluginTableCellView.swift
More file actions
51 lines (37 loc) · 1.37 KB
/
PluginTableCellView.swift
File metadata and controls
51 lines (37 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// PluginTableCellView.swift
// XcodeHelper
//
// Created by dhcdht on 2016/10/18.
// Copyright © 2016年 DXStudio All rights reserved.
//
import Cocoa
protocol PluginTableCellViewDelegate {
func installButtonTapped(cell: PluginTableCellView, button: FillableButton) -> Void
func linkButtonTapped(cell: PluginTableCellView, button: NSButton) -> Void
}
class PluginTableCellView: NSTableCellView {
var delegate: PluginTableCellViewDelegate?
@IBOutlet var installButton: FillableButton?
@IBOutlet var titleField: NSTextField?
@IBOutlet var descriptionField: NSTextField?
@IBOutlet var linkButton: NSButton?
@IBOutlet var previewButton: PreviewImageButton?
override func awakeFromNib() {
super.awakeFromNib()
self.installButton?.target = self
self.installButton?.action = #selector(self.installButtonTapped(sender:))
self.linkButton?.target = self
self.linkButton?.action = #selector(self.linkButtonTapped(sender:))
}
override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
// Drawing code here.
}
func installButtonTapped(sender: FillableButton) -> Void {
self.delegate?.installButtonTapped(cell: self, button: sender)
}
func linkButtonTapped(sender: NSButton) -> Void {
self.delegate?.linkButtonTapped(cell: self, button: sender)
}
}