Swift2 stillImageStabilizationSupported(手ぶれ補正対応)の確認の仕方

カメラアプリを作る時、手ぶれ補正対応をする為にstillImageStabilizationSupportedがTrueになる事を確認する必要があるのですが、対応機種(iPhone6sPlus)でもTrueにならなかったので調べた事をメモします。

NGパターン

// 手ぶれ補正
if myImageOutput.stillImageStabilizationSupported == true {
    myImageOutput.automaticallyEnablesStillImageStabilizationWhenAvailable = true
}

// セッションをOutputに追加.
mySession.addOutput(myImageOutput)

OKパターン

// セッションをOutputに追加.
mySession.addOutput(myImageOutput)

// 手ぶれ補正
if myImageOutput.stillImageStabilizationSupported == true {
    myImageOutput.automaticallyEnablesStillImageStabilizationWhenAvailable = true
}

セッションをaddOutputした後じゃないとstillImageStabilizationSupportedを確認することは出来ないという事でした。

参考URL

stackoverflow.com