mirror of
https://github.com/grishka/NearDrop.git
synced 2025-12-18 04:37:42 +01:00
27 lines
509 B
Swift
27 lines
509 B
Swift
|
|
//
|
||
|
|
// 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(_ sender:Any?){
|
||
|
|
guard let handler=clickHandler else {return}
|
||
|
|
handler()
|
||
|
|
}
|
||
|
|
}
|