Refactoring

This commit is contained in:
Leon Böttger committed 2025-07-27 16:04:58 +02:00
1 parent af5ff5e4fe
commit a311aa01b0
18 files changed
+50 -18

No files matched your search

+26
View File
@@ -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()
}
}