Swift提示框
来源:互联网 发布:喜夜网络娴主播 编辑:程序博客网 时间:2024/06/05 15:31
Alerts
var alert = NSAlert() alert.messageText = 'Warning!" alert.informativeText = "Hehe" alert.alertStyle = NSAlertStyle.CirticalAlertStyle alert.showSuppressionButton = true alert.suppresionButton?.title = "No more" alert.runModal()
从对话框获取反馈
alert.addButtonWithTitle("Ignore it") alert.addButtonWithTitle("Do noting") let choice = alert.runModal() switch choice{ case NSAlertFirstButtonReturn: ... } if alert.suppressionButton!.state == 1{ print("checked") }
将对话框平铺在window中
let myCode = { (choice:NSModalResponse) -> Void in switch choice{ case NSAlertFirstButtonReturn: ... } if alert.suppressionButton!.state == 1{ print("checked") } } alert.beginSheetModalForWindow(window,completionHandler:myCode)
Panel
文件选择器
读取
* canChooseFiles
* canChooseDirectories
* allowsMultipleSelection
* URLs
var myOpen = NSOpenPanel() myOpen.canChooseFiles = true myOpen.canChooseDirectories = true myOpen.allowMultipleSelection = true myOpen.begin(completionHandler: { (result) in if result == NSFileHandlingPanelOKButton{ print(myOpen.urls) } })
保存
- title
- prompt
- URL
nameFieldStringValue
var mySave = NSSavePanel()mySave.title = "Save a File Here"mySave.prompt = "Save Me"mySave.beginWithCompletionHandler{ (result) -> Void in if result == NSFileHandlingPanelOKButton{ print(mySave.URL) print(mySave.nameFieldStringValue) }}
0 0
- swift 提示框
- Swift 提示框 UIAlertViewController
- Swift提示框
- swift输入验证码提示框
- Swift - 告警提示框(UIAlertController)的用法
- Swift - 告警提示框(UIAlertController)的用法
- Swift - 告警提示框(UIAlertController)的用法
- Swift - 告警提示框(UIAlertController)的用法
- Swift - 告警提示框(UIAlertController)的用法
- Swift - 警告提示框(UIAlertController)的用法
- Swift - 告警提示框(UIAlertController)的用法
- Swift开发---toast 界面底部显示的提示框
- 一款自定义的提示框JHToast(swift)
- swift学习之弹出提示框的几种方式
- swift实现提示框第三方库:MBProgressHUD
- Swift 简单易用的弹框提示
- IOS 基于Swift的弹出提示框(仿Android的Toast 和等待提示框)
- (Swift报错提示)dataWithContentsOfURL
- arm-none-eabi-g++ -Xlinker -T "../LF3Kmonitor.ld" -Xlinker -Map="Bogota_ICT_V.map"-ram-hosted.ld -mc
- ECMAScript6(ES6)标准之对象Object扩展方法及新特性
- caffe 学习资源
- dll编写为什么加上 extern "C" 和 __stdcall /__cdecl
- CentOS7使用firewalld打开关闭防火墙与端口
- Swift提示框
- Windows下关于稀疏编码建模工具箱SPAMS的配置
- 安卓布局中layout_gravity和gravity的区别
- DOM事件
- [乐意黎转载]PHP mysql_fetch_object() 函数
- 算法---选择排序
- 大数据时代,连犯罪都能预测?
- Android webview使用详解
- 电脑安装第二个MySQL service 免安装版时,用dos安装提示 the service already exists