1
1
mirror of https://github.com/bitgapp/eqMac.git synced 2024-12-12 16:24:12 +03:00
eqMac/native/app/Source/Extensions/NSOpenPanelExtensions.swift

22 lines
526 B
Swift
Raw Normal View History

2020-04-04 21:15:38 +03:00
//
// NSOpenPanelExtensions.swift
// eqMac
//
// Created by Roman Kisil on 01/04/2018.
// Copyright © 2018 Roman Kisil. All rights reserved.
//
import Foundation
import Cocoa
extension NSOpenPanel {
func selectSingleFile(_ handler: @escaping (NSApplication.ModalResponse) -> Void) -> Void {
title = "Select File"
allowsMultipleSelection = false
canChooseDirectories = false
canChooseFiles = true
canCreateDirectories = false
begin(completionHandler: handler)
}
}