Quickies

[categories] [index] [all (527)] [latest]

Cocoa AppKit
  1. - (void)startPulsing {
        CABasicAnimation* a = [CABasicAnimation animation];
    
        a.keyPath = @"opacity";
        a.fromValue = [NSNumber numberWithFloat:1.0];
        a.toValue = [NSNumber numberWithFloat:0.8];
        a.duration = 1.0;
        a.repeatCount = HUGE_VALF;
        a.autoreverses = YES;
        a.timingFunction = [CAMediaTimingFunction
                            functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    
        [self.layer addAnimation:a forKey:@"pulseAnimation"];
    }