mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-19 04:46:08 +00:00
Refactoring
This commit is contained in:
1 parent
af5ff5e4fe
commit
a311aa01b0
18 files changed
+50
-18
No files matched your search
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// DeviceListCell.swift
|
||||
// ShareExtension
|
||||
//
|
||||
// Created by Grishka on 20.09.2023.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class DeviceListCell: NSCollectionViewItem {
|
||||
public var clickHandler: (() -> Void)?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
let btn: NSButton = view as! NSButton
|
||||
btn.isEnabled = true
|
||||
btn.setButtonType(.momentaryPushIn)
|
||||
btn.action = #selector(onClick)
|
||||
btn.target = self
|
||||
}
|
||||
|
||||
@IBAction func onClick(_: Any?) {
|
||||
guard let handler = clickHandler else { return }
|
||||
handler()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user