delegate
デリゲート
@property(assign) id<NSAnimationDelegate> delegate
unowned(unsafe) var delegate: NSAnimationDelegate?
解説
デリゲートオブジェクト
設定値
@property(assign) id<NSAnimationDelegate> delegate
unowned(unsafe) var delegate: NSAnimationDelegate?
デリゲートオブジェクト(NSAnimationDelegate)
フレームワーク
ApplicationKit
クラス
NSAnimation
使用可能
10.4
関連記事(外部サイト)
参照
例文
Swift 1.2
//NSAnimation delegate @IBAction func function007(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 //アニメーション設定 theAnim007 = NSAnimation(duration: 10.0, animationCurve: NSAnimationCurve.EaseInOut) theAnim007!.frameRate = 20.0 theAnim007!.delegate = self theAnim007!.animationBlockingMode = NSAnimationBlockingMode.Blocking theAnim007!.animationCurve = NSAnimationCurve.EaseInOut theAnim007!.duration = 5.0 //登録 for (i = 0 ; i<count ; i++){ theAnim007!.addProgressMark(progMarks[i]) NSLog("theAnim006 %f",progMarks[i]) } dispatch_async(dispatch_get_main_queue()) { self.theAnim007!.startAnimation() } }
Swift1.1
//NSAnimation delegate @IBAction func function007(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