mirror of
https://github.com/grishka/NearDrop.git
synced 2026-04-03 09:46:19 +02:00
An experimental share extension to send files and too much refactoring
closes #4
This commit is contained in:
26
ShareExtension/DeviceListCell.swift
Normal file
26
ShareExtension/DeviceListCell.swift
Normal 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(_ sender:Any?){
|
||||
guard let handler=clickHandler else {return}
|
||||
handler()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user