macOS/iOS API解説

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

目次

フルスクリーンモードにする

アプリケーションからフルスクリーンモードにするには

Swift

window.collectionBehavior = NSWindowCollectionBehavior.FullScreenPrimary

主に使用するウインドウのcollectionBehaviorにNSWindowCollectionBehavior.FullScreenPrimaryをセットする。

window.toggleFullScreen(self)

フルスクリーン、ウインドウモードの切り替え。

参照


currentSystemPresentationOptions - Cocoa API解説(iOS/OS X)

関連記事(外部サイト)


Technical Note TN2062: Creating Kiosks


Implementing the Full-Screen Experience


ReadMe.txt



osx - (OS X) Detecting when front app goes into fullscreen mode - Stack Overflow


Stork Lab: Emacs 23.3.50 フルスクリーン Lion 対応版

http://electricsheep.googlecode.com/svn/trunk/client_generic/MacBuild/ESWindow.m

例文

//NSApplication currentSystemPresentationOptions/presentationOptions
    @IBAction func function062(sender: AnyObject) {
       let anApplication = MyApplication.sharedApplication()
        window.collectionBehavior = NSWindowCollectionBehavior.FullScreenPrimary
        window.toggleFullScreen(self)
    }
    //NSApplication currentSystemPresentationOptions/presentationOptions
    @IBAction func function063(sender: AnyObject) {
        let anApplication = MyApplication.sharedApplication()
        switch anApplication.currentSystemPresentationOptions {
        case NSApplicationPresentationOptions.FullScreen:
            NSLog("system FullScreen YES")
        case NSApplicationPresentationOptions.Default:
            NSLog("system FullScreen NO")
        default:
            break
        }
        switch anApplication.presentationOptions {
        case NSApplicationPresentationOptions.FullScreen:
            NSLog("app FullScreen YES")
        case NSApplicationPresentationOptions.Default:
            NSLog("app FullScreen NO")
        default:
            break
        }
    }