Priyankadmehta
iPF Noob
i tried following code for giving gesture recognizer with swipe effect
- (void)viewDidLoad
{
[self.view addGestureRecognizer:swipeRecognizer];*/
UISwipeGestureRecognizer* rightSwipeGestureRecognizer = [[[UISwipeGestureRecognizer alloc] initWithTarget:self actionselector(swipeRight] autorelease];
rightSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:rightSwipeGestureRecognizer];
UISwipeGestureRecognizer* leftSwipeGestureRecognizer = [[[UISwipeGestureRecognizer alloc] initWithTarget:self actionselector(swipeLeft] autorelease];
leftSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:leftSwipeGestureRecognizer];
}
-(IBAction)swipeRightUIGestureRecognizer *)sender{
[self PlayClickSound];
[self removeViews];
videoView *videoview1 = [[videoView alloc]
initWithNibName:nil bundle:nil];
// videoview1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
videoview1.contentViewLangId=contentViewLangId;
videoview1.topicId=topicId;
NSLog(@"Video : %@",topicId);
[self presentModalViewController:videoview1 animated:YES];
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
// [animation setType"oglFlip"];
[animation setType:kCAValueFunctionScale];
//[animation setSubtype:direction];
[animation setDuration:1.0];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
//return animation;
}
-(IBAction)swipeLeftUIGestureRecognizer *)sender{
[self PlayClickSound];
[self removeViews];
linkView *linkview1 = [[linkView alloc]
initWithNibName:nil bundle:nil];
//linkview1.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
linkview1.contentViewLangId=contentViewLangId;
linkview1.topicId=topicId;
NSLog(@"Quiz : %@",topicId);
CATransition *transition = [CATransition animation];
// [transition.durat];
transition.duration = 0.75;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.type = kCATransitionFromLeft;
transition.subtype = kCATransitionFromLeft;
transitioning = YES;
transition.delegate = self;
[self presentModalViewController:linkview1 animated:transitioning];
}
- (void)viewDidLoad
{
[self.view addGestureRecognizer:swipeRecognizer];*/
UISwipeGestureRecognizer* rightSwipeGestureRecognizer = [[[UISwipeGestureRecognizer alloc] initWithTarget:self actionselector(swipeRight] autorelease];
rightSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:rightSwipeGestureRecognizer];
UISwipeGestureRecognizer* leftSwipeGestureRecognizer = [[[UISwipeGestureRecognizer alloc] initWithTarget:self actionselector(swipeLeft] autorelease];
leftSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:leftSwipeGestureRecognizer];
}
-(IBAction)swipeRightUIGestureRecognizer *)sender{
[self PlayClickSound];
[self removeViews];
videoView *videoview1 = [[videoView alloc]
initWithNibName:nil bundle:nil];
// videoview1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
videoview1.contentViewLangId=contentViewLangId;
videoview1.topicId=topicId;
NSLog(@"Video : %@",topicId);
[self presentModalViewController:videoview1 animated:YES];
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
// [animation setType"oglFlip"];
[animation setType:kCAValueFunctionScale];
//[animation setSubtype:direction];
[animation setDuration:1.0];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
//return animation;
}
-(IBAction)swipeLeftUIGestureRecognizer *)sender{
[self PlayClickSound];
[self removeViews];
linkView *linkview1 = [[linkView alloc]
initWithNibName:nil bundle:nil];
//linkview1.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
linkview1.contentViewLangId=contentViewLangId;
linkview1.topicId=topicId;
NSLog(@"Quiz : %@",topicId);
CATransition *transition = [CATransition animation];
// [transition.durat];
transition.duration = 0.75;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.type = kCATransitionFromLeft;
transition.subtype = kCATransitionFromLeft;
transitioning = YES;
transition.delegate = self;
[self presentModalViewController:linkview1 animated:transitioning];
}