NSRequestUserAttentionType
要求するユーザーのアテンションタイプ
enum { NSCriticalRequest = 0, NSInformationalRequest = 10 } typedef NSUInteger NSRequestUserAttentionType;
enum NSRequestUserAttentionType : UInt { case CriticalRequest case InformationalRequest }
解説
要求するユーザーのアテンションタイプ
フレームワーク
ApplicationKit
クラス
NSApplication
使用可能
10.1
更新時のバージョン
OS X 10.10
関連記事(外部サイト)
例文
//NSApplication requestUserAttention @IBAction func function060(sender: AnyObject) { //共有アプリケーションインスタンスを取得 let anApplication = MyApplication.sharedApplication() anApplication.requestUserAttention(NSRequestUserAttentionType.CriticalRequest) //デアクティベートして anApplication.hide(self) //deactivate() //3秒後にユーザーアテンションを var startTimer = NSTimer.scheduledTimerWithTimeInterval(3.0, target: self, selector: Selector("requestAttention:"), userInfo: nil, repeats: false) //10秒後にユーザーアテンションを var stopTimer = NSTimer.scheduledTimerWithTimeInterval(10.0, target: self, selector: Selector("cancelAttention:"), userInfo: nil, repeats: false) } //タイマーが起動した時の実行メソッド ドックで跳ねる func requestAttention(timer:NSTimer!) { //共有アプリケーションインスタンスを取得 let anApplication = MyApplication.sharedApplication() //ユーザーアテンションを開始 NSLog("start attention") anApplication.requestUserAttention(NSRequestUserAttentionType.CriticalRequest) } //タイマーが起動した時の実行メソッド ドックではねているのをやめる func cancelAttention(timer:NSTimer!) { //共有アプリケーションインスタンスを取得 let anApplication = MyApplication.sharedApplication() //ユーザーアテンションを停止 NSLog("stop attention") anApplication.cancelUserAttentionRequest(0) }