Cocoa API解説(macOS/iOS)

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。

目次

currentValue

INDEX>AppKit>NSAnimation

現在値

Objective-C

@property(readonly) float currentValue

Swift

var currentValue: Float { get }

解説

現在値

設定値

Objective-C

@property(readonly) float currentValue

Swift

var currentValue: Float { get }

フレームワーク

ApplicationKit

クラス

NSAnimation

使用可能

10.4

関連記事(外部サイト)

例文

Objective-C

Swift

    //アニメーション
    func animation(animation: NSAnimation, didReachProgressMark progress: NSAnimationProgress) {
        
        if (animation == theAnim001?){
            NSLog("theAnim001")
        }
        if (animation == theAnim002?){
            NSLog("theAnim002")
        }
        if (animation == theAnim003?){
            NSLog("theAnim003")
            var returnValue = theAnim003.runLoopModesForAnimating?
            if ((returnValue) != nil){
                for mode : AnyObject in returnValue! {
                    NSLog("!! %@",mode as NSString)
                }
            }
        }
        if (animation == theAnim004?){
            NSLog("theAnim004")
        }
        if (animation == theAnim005?){
            NSLog("theAnim005")
        }
        if (animation == theAnim006?){
            NSLog("theAnim006")
        }
        if (animation == theAnim007?){
            NSLog("theAnim007")
        }
        if (animation == theAnim008?){
            NSLog("theAnim008")
        }
        if (animation == theAnim008?){
            NSLog("theAnim008")
        }
        if (animation == theAnim009?){
            NSLog("theAnim009 %.1f",theAnim009.currentProgress)
            if (theAnim009.currentProgress > 0.5){
                theAnim009.stopAnimation()
                NSLog("end")
            }
        }
        if (animation == theAnim010?){
            NSLog("theAnim010 %.1f",theAnim010.currentProgress)
            if (theAnim010.currentProgress > 0.5){
                theAnim010.stopAnimation()
                NSLog("end")
            }
        }
        if (animation == theAnim011?){
            NSLog("theAnim011 %.2f",theAnim011.currentValue)
            if (theAnim011.currentProgress > 0.5){
                theAnim011.stopAnimation()
                NSLog("end")
            }
        }
    }
    //NSAnimation currentValue
    @IBAction func function011(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
        //アニメーション設定
        theAnim011 = NSAnimation(duration: 10.0, animationCurve: NSAnimationCurve.EaseInOut)
        
        theAnim011.frameRate = 20.0
        theAnim011.delegate = self
        theAnim011.animationBlockingMode = NSAnimationBlockingMode.Blocking
        theAnim011.animationCurve = NSAnimationCurve.EaseInOut
        theAnim011.duration = 5.0
        //登録
        for (i = 0 ; i<count ; i++){
            theAnim011.addProgressMark(progMarks[i])
            NSLog("theAnim006 %f",progMarks[i])
        }
        dispatch_async(dispatch_get_main_queue()) {
            self.theAnim011.startAnimation()
        }
    }

編集時バージョン

10.10.3
Swift1.2