Subscribe ( )

iPhone Programming Tutorials



You must be logged in to post Login Register


Sliding a view using transitions

User Post

3:38 pm
November 20, 2008




posts 5


I am having issues with sliding a view in and out of the screen using CATransitions. I have no problem getting the view (it's like a bookmark) to slide onto the screen from the top. The problem I'm having is once the view is on the screen getting it to transition off of the screen.

This is the code I'm using to perform the slide on. The method getAnimationForDirection:type:duration: is just a helper method that returns a populated CATransition object. BookmarkView contains a single UIImageView and is a retained property on the view controller.

- (void)showBookmark
    bookmark = [[BookmarkView alloc] initWithFrame:CGRectMake(25, 0, 80, 250)];
    [swipeView addSubview:bookmark];
    CATransition *animation = [self getAnimationForDirection:kCATransitionFromBottom type:kCATransitionMoveIn duration:1.0];

    [[bookmark layer] addAnimation:animation forKey:@”BookmarkTransition”];

About the iCodeBlog forum

Currently Online:

3 Guests

Maximum Online: 25


Groups: 2

Forums: 6

Topics: 215

Posts: 618


There are 435 members

There are 1 guests

Brandon has made 87 posts

Top Posters:

bobcubsfan - 52

crazyiez - 30

VertigoSol - 26

Uhu - 17

AdeC - 17

Administrator: Brandon | Moderators: VertigoSol

© - Version 3.1.4 (Build 357)