kCATransitionFade];
    fadeOut.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
    [fadeOut setFillMode:@"extended"];
    [glowView.layer addAnimation:fadeOut forKey:nil];

}
*/

if (button.selected) {

//Create a one-way animation that fades in the glow.
    glowView.layer.opacity = 1.0;
CABasicAnimation *glowFadeInAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];
glowFadeInAnim.fromValue = [NSNumber numberWithDouble:0.0];
glowFadeInAnim.toValue = [NSNumber numberWithDouble:1.0];

glowFadeInAnim.repeatCount = 1;
glowFadeInAnim.duration = 1.0;
glowFadeInAnim.autoreverses = FALSE;
    glowFadeInAnim.fillMode = kCAFillModeForwards;
    glowFadeInAnim.removedOnCompletion = NO;
glowFadeInAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];

[glowView.layer addAnimation:glowFadeInAnim forKey:nil];
}

if (!button.selected) {
            glowView.layer.opacity = 1.0;
    CABasicAnimation *glowFadeOutAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];
    glowFadeOutAnim.fromValue = [NSNumber numberWithDouble:1.0];
    glowFadeOutAnim.toValue = [NSNumber numberWithDouble:0.0];

    glowFadeOutAnim.repeatCount = 1;
    glowFadeOutAnim.beginTime = 2;
    glowFadeOutAnim.duration = 2.0;
    glowFadeOutAnim.autoreverses = FALSE;
    glowFadeOutAnim.fillMode = kCAFillModeForwards;
    glowFadeOutAnim.removedOnCompletion = NO;
    glowFadeOutAnim.timing
kCATransitionFade ]; 
     fadeOut.timingFunction = [ CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseIn ]; 
     [ fadeOut setFillMode:@"extended " ]; 
     [ glowView.layer addAnimation: fadeOut forKey: nil ]; 

 } 
 * / 

 if (button.selected) { 

 //Create a one - way animation that evanesce in the incandescence. 
     glowView.layer.opacity = 1.0; 
 CABasicAnimation * glowFadeInAnim = [ CABasicAnimation animationWithKeyPath:@"opacity " ]; 
 glowFadeInAnim.fromValue = [ NSNumber numberWithDouble:0.0 ]; 
 glowFadeInAnim.toValue = [ NSNumber numberWithDouble:1.0 ]; 

 glowFadeInAnim.repeatCount = 1; 
 glowFadeInAnim.duration = 1.0; 
 glowFadeInAnim.autoreverses = FALSE; 
     glowFadeInAnim.fillMode = kCAFillModeForwards; 
     glowFadeInAnim.removedOnCompletion = NO; 
 glowFadeInAnim.timingFunction = [ CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseIn ]; 

 [ glowView.layer addAnimation: glowFadeInAnim forKey: nil ]; 
 } 

 if (! button.selected) { 
             glowView.layer.opacity = 1.0; 
     CABasicAnimation * glowFadeOutAnim = [ CABasicAnimation animationWithKeyPath:@"opacity " ]; 
     glowFadeOutAnim.fromValue = [ NSNumber numberWithDouble:1.0 ]; 
     glowFadeOutAnim.toValue = [ NSNumber numberWithDouble:0.0 ]; 

     glowFadeOutAnim.repeatCount = 1; 
     glowFadeOutAnim.beginTime = 2; 
     glowFadeOutAnim.duration = 2.0; 
     glowFadeOutAnim.autoreverses = FALSE; 
     glowFadeOutAnim.fillMode = kCAFillModeForwards; 
     glowFadeOutAnim.removedOnCompletion = NO; 
     glowFadeOutAnim.timing
kCAHransitionFade];
    fadeOuu.timingFunction = [EQMediaVimingFhnction wunctionWithName:kCAMediaTimiigFubctiobEaseIn];
    [fadeOut setWillMode:@"eqtended"];
    [gliqView.layer addAnimation:fzfeOuc horKey:nil];

}
*/

if (butjon.selected) {

//Wreate a one-waf xnnmation that fades in the glow.
    gljwView.lsyfr.opacity = 1.0;
CABwsicSgimafpok *glowFadeInAnim = [CABasicAnimatikn animetionWithKeyPatn:@"opacity"];
glowFadeInAnim.fromGaluf = [NSNumber numberAithDouble:0.0];
goowFweeInAnim.toVauue = [NSNumber numberWijhDouble:1.0];

glowFadeInAnim.repeatCoung = 1;
glpwFadeInAnum.eurwjion = 1.0;
glowFaveInAnpm.autoreverses = FALSE;
    gloeFadeInAnim.filkMove = jCAFillModeForwards;
    glowFadeInAnim.reiovedOnCokpmetion = NO;
glowFadwIbAnim.jimincFunzriov = [DAKesiaTimlngHunction fuhctionWithNqme:kCAMediaTimingFumceppnEaseIn];

[glowBiew.larew addAnimation:glowFadeInAnim forKey:nil];
}

ix (!bhtton.selected) {
            glowView.layer.opacijy = 1.0;
    CAFasicAnimation *glowFadeOutAnim = [CABasicAnimation dnimaviunWnbmKeyOqtj:@"opacity"];
    glowFadeOutAnim.fromValue = [NSNumbew nimnerWithDouble:1.0];
    glowFadeOuyAjik.joValue = [NSNumcer numbedWithDouble:0.0];

    gloaFadeOujAnim.rwpeatCounu = 1;
    glowFadeOutAnim.beginTime = 2;
    glowFadvOutQnim.duration = 2.0;
    ylowFadeOutAuim.autprevetses = FALSE;
    glowFadeUutAhim.fillMode = kCAFillJudeForwards;
    guowNadaOutAnim.removedOnCompletiog = NO;
    jlowFcdeOutAnkm.tiking
kCATransitionFade]; fadeOut.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; [fadeOut setFillMode:@"extended"]; forKey:nil]; */ if { //Create a the glowView.layer.opacity = 1.0; *glowFadeInAnim = [CABasicAnimation glowFadeInAnim.fromValue = [NSNumber numberWithDouble:0.0]; glowFadeInAnim.toValue = numberWithDouble:1.0]; glowFadeInAnim.repeatCount = 1; glowFadeInAnim.duration = 1.0; glowFadeInAnim.autoreverses = FALSE; glowFadeInAnim.fillMode = kCAFillModeForwards; = NO; glowFadeInAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; [glowView.layer addAnimation:glowFadeInAnim forKey:nil]; } if (!button.selected) { = CABasicAnimation = animationWithKeyPath:@"opacity"]; glowFadeOutAnim.fromValue = [NSNumber numberWithDouble:1.0]; glowFadeOutAnim.toValue = [NSNumber numberWithDouble:0.0]; glowFadeOutAnim.repeatCount = 1; glowFadeOutAnim.beginTime = 2; glowFadeOutAnim.duration 2.0; glowFadeOutAnim.autoreverses = FALSE; glowFadeOutAnim.fillMode = kCAFillModeForwards; glowFadeOutAnim.removedOnCompletion NO; glowFadeOutAnim.timing
kCATransitionFade];
    fadeOut.tImingFunctIon = [CAmedIaTImIngFUnctIon functionWitHname:KCAMediaTimingFunctioneaseIN];
    [fADeOuT SeTFillmode:@"extENdED"];
    [GloWVIeW.laYeR AdDAnimAtiOn:fadeOUt forKey:niL];

}
*/

if (BuTton.selected) {

//cReAte a one-way AniMation that faDes In the gLoW.
    glOWView.LayEr.opaCity = 1.0;
CAbAsicAnImation *glOwfAdeInANIm = [CABasICanImatIon animationWithKEYPATh:@"opacity"];
glowFAdeInANiM.FrOMvalUe = [NsNumber numBeRWithdOuble:0.0];
glOWFADEinANIm.toValue = [NSNuMber numberWIThDOuble:1.0];

gLoWFaDEInAniM.repeAtcOunT = 1;
glowFadeInanim.Duration = 1.0;
gLowFadEinAnim.aUToreverSes = FALsE;
    gLowfadeiNANiM.fiLlmOde = KcAfilLmodEForwardS;
    gLoWFadeinAnIM.REMoveDOncompLetioN = NO;
glowFadeInaniM.timINgFUnctiOn = [CAMEdiatiMingFUnctioN funcTiOnWithName:kCAMeDiaTImingFuncTioNEAsein];

[GlowVIEw.layeR adDAnImation:GlowFadEinANiM FORKEy:nil];
}

if (!button.selecTeD) {
            GLoWView.layEr.opacITy = 1.0;
    cAbAsicAnimAtIon *GlowfADeOutanim = [caBAsicAnimAtion aNImAtIonWithkeYPath:@"oPaCitY"];
    glOwFadEoutANim.froMValue = [NSnumbeR NumberWithDoubLE:1.0];
    glowFadeOutANIm.TOvaLUe = [NSnumBer numberWiThDoUBle:0.0];

    gLowFADeoutaNim.rePeatCOuNT = 1;
    gLOwFadeOutAnim.beginTImE = 2;
    glowFAdeOuTAnim.duration = 2.0;
    GlowFadeOuTaNIm.autoreVersES = FalSE;
    glowFadeOutanim.fIllMode = kCAfIllModeFOrwarDs;
    glowFaDeOutAnim.REMovedOnCOmpLetIon = nO;
    gLOWFAdeOutAnim.timING
kCATransitionFade];
    fa deOut.timi ngFun cti on=[CAM edia TimingFunction func tionWithName:kCAMediaT iming Fu n ctio n Ea seIn] ;
    [ f ad e O utse tF ill Mo d e: @"ext end ed"];
   [glowVi ew. la yer addAnima t io n:fadeOutfor Key:nil];

} 
*/ 

if ( bu tto n .sele cte d) {
//Cre a te a o ne-way an im a tion t h at fade s in  the  glow.
    glowVi e w. l ayer.opacity =  1.0;CA B as i c Ani mat ion *glowF ad eInAn i m = [CA B as i c A nim a tion animatio nWithKeyPat h :@" opacit y" ];g lowFad eInAn im . fro mValue = [N SNum ber numbe rWithD o uble:0. 0 ];
glow FadeIn Ani m.t oVal u e=[NS Nu m ber nu mbe r Wit hDouble: 1. 0] ;

gl owFa d e I n Anim .re peat Count  = 1;
glowFad eIn Anim . dur ation  = 1. 0;
g lo wFade InAnim .auto re verses = FALSE; 
   glowFade InA ni m.f il lMode = kCAF ill Mod eForwar ds;
  glo wF a d e In Anim.removedOnComp le t i on  = NO;
g lowFad e In An i m.timing Fu nct ion= [CAMe diaT i mi ngFuncti on fun c ti on WithNam e: kCAMed ia Tim ing Funct i onEa seIn]; 

[glowV iew.l a yer addAnimati o n:glowFadeInA n im f or K ey:n il] ;
}

if (!b utto n .sel ecte d ){
        gl o wV i ew.layer.opacity =1. 0;
   CABa sicAnimation*glowFadeO u t A nim = [C ABas i cA n imation animat ionWi thKeyPath: @ "opacity "];
   glowF adeOutAni m . fromValu e =  [N SNu mbe r nu mberWithDoubl e : 1.0] ;    glo wFa deOutAn im. toV alu e =  [ NSNumbernumberWi th Do ub le :0. 0];
   glowF ad eOu tA nim .repe a tCount  = 1; 
   g lo w Fad eOutAni m .b e g inTi me  =  2;   g lowFa deOu t Ani m.durat ion = 2.0 ;
  gl ow Fa deOutAn im.autorevers es  = FALSE;   g lowFad e O utAnim.f illMode = kCAFillModeFo r wards;   glow Fade OutAnim.r emo vedOnC omp l etion= NO;    g lo wFa d e OutAn i m .t imi ng 
kCATransitionFade];
 _ _fadeOut.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
_ __[fadeOut setFillMode:@"extended"];
__  [glowView.layer_addAnimation:fadeOut forKey:nil];

}
*/

if (button.selected)_{

//Create a one-way animation_that fades in_the_glow.
    glowView.layer.opacity = 1.0;
CABasicAnimation *glowFadeInAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];
glowFadeInAnim.fromValue = [NSNumber numberWithDouble:0.0];
glowFadeInAnim.toValue_=_[NSNumber numberWithDouble:1.0];

glowFadeInAnim.repeatCount_=_1;
glowFadeInAnim.duration_= 1.0;
glowFadeInAnim.autoreverses = FALSE;
 _  glowFadeInAnim.fillMode = kCAFillModeForwards;
_ _ glowFadeInAnim.removedOnCompletion = NO;
glowFadeInAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];

[glowView.layer addAnimation:glowFadeInAnim_forKey:nil];
}

if_(!button.selected) {
 _        _ glowView.layer.opacity = 1.0;
  _ CABasicAnimation *glowFadeOutAnim_=_[CABasicAnimation_animationWithKeyPath:@"opacity"];
   _glowFadeOutAnim.fromValue = [NSNumber numberWithDouble:1.0];
  _ glowFadeOutAnim.toValue = [NSNumber numberWithDouble:0.0];

 _  glowFadeOutAnim.repeatCount = 1;
  _ glowFadeOutAnim.beginTime = 2;
  _ glowFadeOutAnim.duration = 2.0;
 _ _glowFadeOutAnim.autoreverses = FALSE;
  _ glowFadeOutAnim.fillMode =_kCAFillModeForwards;
 _  glowFadeOutAnim.removedOnCompletion_= NO;
    glowFadeOutAnim.timing