iOS Click to create ripple effect by Wusheying
-(void) viewdidload{[Super Viewdidload]; Rippleview = [[UIView alloc] initWithFrame: (cgrect) {0,0,300,300}]; Rippleview.backgroundcolor = [[Uicolor blackcolor] colorwithalphacomponent:0.3]; RippleView.layer.cornerRadius = 150; Rippleview.layer.maskstobounds=true; rippleview.alpha=0;} -(void) Touchesbegan: (Nsset *) touches withevent: (uievent *) event{[super Touchesbegan:touches withevent:event]; Uitouch *touch = [touches anyobject]; Cgpoint location = [Touch LocationInView:self.view]; [Self.view Addsubview:rippleview]; Rippleview.center = location; Rippleview.transform = Cgaffinetransformmakescale (0.5, 0.5); [UIView animatewithduration:0.1 animations:^{rippleview.alpha=1; self.view.alpha=0.3; }]; [UIView animatewithduration:0.7 delay:0 Options:uiviewanimationoptioncurve Easeinout animations:^{ Rippleview.transform = Cgaffinetransformmakescale (a); rippleview.alpha=0; Self.view.alpha=1; } completion:^ (BOOL finished) {[Rippleview Removefromsuperview]; }];}