macOS/iOS API解説

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

目次

startAnimation

INDEX>AppKit>NSAnimation

アニメーションをスタートさせます

Objective-C

- (void)startAnimation

Swift

func startAnimation()

解説

アニメーションをスタートさせます。

返り値

なし

引数

なし

フレームワーク

ApplicationKit

クラス

NSAnimation

使用可能

10.4

関連記事(外部サイト)

例文

Objective-C

[animation startAnimation];

Swift

//NSAnimation startAnimation
    @IBAction func function008(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
        //アニメーション設定
        theAnim008 = NSAnimation(duration: 10.0, animationCurve: NSAnimationCurve.EaseInOut)
        
        theAnim008.frameRate = 20.0
        theAnim008.delegate = self
        theAnim008.animationBlockingMode = NSAnimationBlockingMode.Blocking
        theAnim008.animationCurve = NSAnimationCurve.EaseInOut
        theAnim008.duration = 5.0
        //登録
        for (i = 0 ; i<count ; i++){
            theAnim008.addProgressMark(progMarks[i])
            NSLog("theAnim006 %f",progMarks[i])
        }
        dispatch_async(dispatch_get_main_queue()) {
            self.theAnim008.startAnimation()
        }
    }

編集時バージョン

10.10.3
Swift1.2