Alex Muller
Alex Muller

Reputation: 1565

iPhone - having a Ripple effect on a UIImageView

I am attempting to create a ripple like effect on an imageView when it is touched down on, however I do not understand how to implement OpenGL for windows and porting it to iOS. I have attempted to use http://www.codeproject.com/KB/openGL/dsaqua.aspx as well as cocos2d however I find the latter completely and utterly confusing. Would anyone be willing to give some suggestions or can point me in the right direction?

Many thanks!

Upvotes: 8

Views: 28920

Answers (5)

Milan Kamilya
Milan Kamilya

Reputation: 2298

I have tried above mentioned codes but none work perfectly. Find out following source code. https://github.com/willstepp/gl_image_ripple

Upvotes: 1

Gautam Sareriya
Gautam Sareriya

Reputation: 1833

For Swift 3.0

let animation = CATransition()
animation.delegate = self
animation.duration = 5.0
animation.timingFunction = CAMediaTimingFunction(name : kCAMediaTimingFunctionEaseInEaseOut)
animation.type = "rippleEffect"
viewForAnimation.layer.add(animation, forKey: nil)

Upvotes: 3

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31722

Use below for ripple effect in iPhone

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:(UIViewAnimationTransition) 110 forView:view cache:NO];
[UIView commitAnimations];

For more effects you can check this link :

http://www.iphonedevwiki.net/index.php?title=UIViewAnimationState

Upvotes: 7

LFCameron7
LFCameron7

Reputation: 71

@Rony's CATransition Ripple in Swift

let animation = CATransition()
animation.delegate = self
animation.duration = 2
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.type = "rippleEffect"
myView.layer.addAnimation(animation, forKey: nil)

(This is my first post, so idk if I'm doing it right :D)

Upvotes: 6

Rony
Rony

Reputation: 638

If you want a ripple effect on a view you can use it.

    CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:2.0f];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:@"rippleEffect" ];
[myView.layer addAnimation:animation forKey:NULL];

Upvotes: 48

Related Questions