![swift](https://habrastorage.org/r/w120/webt/5a/d9/45/5ad945e07aec2411024034.png)
Swift
4
Вклад в тег
- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id < WebOpenPanelResultListener >)resultListener
{
// Create the File Open Dialog class.
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
// Enable the selection of files in the dialog.
[openDlg setCanChooseFiles:YES];
// Enable the selection of directories in the dialog.
[openDlg setCanChooseDirectories:NO];
if ( [openDlg runModal] == NSOKButton )
{
NSArray* files = [[openDlg URLs]valueForKey:@"relativePath"];
[resultListener chooseFilenames:files];
}
}