macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

registerForRemoteNotificationTypes:

INDEX>AppKit>NSApplication

リモート通知タイプをセットします

解説

リモート通知タイプをセットします。
Objective-C

- (void)registerForRemoteNotificationTypes:(NSRemoteNotificationType)types

Swift

func registerForRemoteNotificationTypes(_ types: NSRemoteNotificationType)

返り値

なし

引数

Swift
【NSRemoteNotificationType】

NSRemoteNotificationType.None
 なし
NSRemoteNotificationType.Badge
 バッチ
NSRemoteNotificationType.Sound
 サウンド
NSRemoteNotificationType.Alert
 アラート

フレームワーク

ApplicationKit

クラス

NSApplication

Instance Methods

使用可能

10.0

編集時のバージョン

10.10

参照

例文

    //NSApplication registerForRemoteNotificationTypes
    //
    @IBAction func function020(sender: AnyObject) {
        //共有アプリケーションインスタンスを取得
        let anApplication = MyApplication.sharedApplication()
        //バッジに設定
        anApplication.registerForRemoteNotificationTypes(NSRemoteNotificationType.Badge)
    }