CGRect Gradientrect=cgrectmake (-imageview3.bounds.size.width*1.5,0,4*imageView3.bounds.size.width, imageView3.bounds.size.height); Cagradientlayer*gradientlayer =[Cagradientlayer layer]; Gradientlayer.frame=Gradientrect; Gradientlayer.colors= @[(ID) Hexcolor (bb975e). Cgcolor, (ID) [Uicolor Whitecolor]. Cgcolor, (ID) Hexcolor (bb975e). Cgcolor]; Gradientlayer.locations= @[@(0.25),@(0.5),@(0.75)]; Gradientlayer.startpoint= Cgpointmake (0,0.5); Gradientlayer.endpoint= Cgpointmake (1,0.5); Gradientlayer.position= Cgpointmake (imageview3.bounds.size.width*0.5, imageview3.bounds.size.height/2.0); [Imageview3.layer Addsublayer:gradientlayer]; Calayer*masklayer =[Calayer layer]; Masklayer.frame=cgrectoffset (Imageview3.bounds, imageview3.bounds.size.width*1.5,0); Masklayer.contents= (__bridgeID) ([UIImage imagenamed:@"LaunchImage3"]. Cgimage); Gradientlayer.mask=Masklayer; Cabasicanimation* Fadeanim = [cabasicanimation animationwithkeypath:@"Locations"]; Fadeanim.fromvalue= @[@(0.0),@(0.0),@(0.25)]; Fadeanim.tovalue= @[@(0.75),@(1.0),@(1.0)]; Fadeanim.duration=2; Fadeanim.repeatcount=Cgfloat_max; [Gradientlayer Addanimation:fadeanim Forkey:nil];
UIView adding a flashing gradient light