Mac-关于弹框


let alert:NSAlert=NSAlert()

alert.messageText="警告"

alert.addButton(withTitle:"好")

alert.alertStyle=NSAlertStyle.critical

//滑出式

alert.beginSheetModal(for:NSApplication.shared().keyWindow!) { (finished)in

print(finished)

}

//弹出式

alert.runModal()

你可能感兴趣的:(Mac-关于弹框)