macOS/iOS API解説

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

目次

frameRate

INDEX>AppKit>NSAnimation

アニメーションのフレームレートを返します

Objective-C

@property float frameRate

Swift

var frameRate: Float

解説

アニメーションのフレームレートを返します。

設定値

Objective-C

float

Swift

Float

フレームレート

フレームワーク

ApplicationKit

クラス

NSAnimation

使用可能

10.4

関連記事(外部サイト)

参照

例文

Objective-C

Swift 1.2

    //NSAnimation frameRate
    @IBAction func function006(sender: AnyObject) {
        //NSAnimationProgress
        var progMarks : [NSAnimationProgress] =  [
            0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5,
            0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0  ]
        var i :Int
        var count :Int = 20
        //アニメーション設定
        theAnim006 = NSAnimation(duration: 10.0, animationCurve: NSAnimationCurve.EaseInOut)
        
        theAnim006!.frameRate = 20.0
        theAnim006!.delegate = self
        theAnim006!.animationBlockingMode = NSAnimationBlockingMode.Blocking
        theAnim006!.animationCurve = NSAnimationCurve.EaseInOut
        theAnim006!.duration = 5.0
        //登録
        for (i = 0 ; i<count ; i++){
            theAnim006!.addProgressMark(progMarks[i])
            NSLog("theAnim006 %f",progMarks[i])
        }
        dispatch_async(dispatch_get_main_queue()) {
            self.theAnim006!.startAnimation()
        }
    }

Swift1.1

 //NSAnimation
    @IBAction func function006(sender: AnyObject) {
        //NSAnimationProgress
        var progMarks : [NSAnimationProgress] =  [
            0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5,
            0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0  ]
        var i :Int
        var count :Int = 20
        //アニメーション設定
        theAnim006 = NSAnimation(duration: 10.0, animationCurve: NSAnimationCurve.EaseInOut)
        
        theAnim006.frameRate = 20.0
        theAnim006.delegate = self
        theAnim006.animationBlockingMode = NSAnimationBlockingMode.Blocking
        theAnim006.animationCurve = NSAnimationCurve.EaseInOut
        theAnim006.duration = 5.0
        //登録
        for (i = 0 ; i<count ; i++){
            theAnim006.addProgressMark(progMarks[i])
            NSLog("theAnim006 %f",progMarks[i])
        }
        dispatch_async(dispatch_get_main_queue()) {
            self.theAnim006.startAnimation()
        }
    }

編集時バージョン

10.10.3
Swift1.2