mirror of
https://github.com/grishka/NearDrop.git
synced 2025-12-16 19:57:41 +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()
|
|
}
|
|
}
|