Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 832345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:20:55+00:00 2026-05-15T04:20:55+00:00

I have a pdf page displayed with CGContextDrawPDFPage in QuartzDemo sample application. I want

  • 0

I have a pdf page displayed with CGContextDrawPDFPage in QuartzDemo sample application.

I want to keep this page shown and have an image slide in from top over this page, just as it can be seen in the iBooks application.

It’s a book, the sliding image is a bookmark that slides in when you are about to close the book.

I added this code by DyingCactus (hint: im a newbie to obj c and iphone dev) as follows:

In QuartzViewController.m, the animation starts to show but the view slides away before the animation is finished, in fact I think the animation goes on while the view is sliding away.

-(void)viewWillDisappear:(BOOL)animated
{
    [self.quartzView setFrame:CGRectMake(150, -200, 100, 200)];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [self.quartzView setFrame:CGRectMake(150, 0, 100, 200)];
    [UIView commitAnimations];  
}

How can I keep the view visible and finish the animation before view disappears?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:20:56+00:00Added an answer on May 15, 2026 at 4:20 am

    I assume you’re modifying the QuartzDemo sample app from Apple.

    Best way I can think of right now is to replace the back button on the navigation controller with your own button when the view being shown is the PDF view.

    Your custom back button can then manage the animation and view popping sequence as needed.

    Only annoyance with this is that the back button no longer has a left-arrow shape.

    Here are the changes needed in QuartzViewController.m:

    #import "QuartzImages.h"  //<-- add this import
    ...
    -(void)viewDidLoad
    {
        // Add the QuartzView
        [scrollView addSubview:self.quartzView];
    
        //add custom back button if this is the PDF view...
        if ([self.quartzView isKindOfClass:[QuartzPDFView class]])
        {
            self.navigationItem.leftBarButtonItem =
            [[UIBarButtonItem alloc] initWithTitle:@"QuartzDemo"
                                     style:UIBarButtonItemStyleBordered
                                     target:self
                                     action:@selector(myBackButtonHandler:)];
        }
    }
    
    - (void)myBackButtonHandler:(id)sender
    {
        [self.quartzView setFrame:CGRectMake(150, -200, 100, 200)];
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
        [UIView setAnimationDuration:1.0];
        [self.quartzView setFrame:CGRectMake(150, 0, 100, 200)];
        [UIView commitAnimations]; 
    }
    
    - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
    {
        [self.navigationController popViewControllerAnimated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pdf page displayed with CGContextDrawPDFPage. I want to keep this page
I have a PDF which has an image on it (a logo) I want
I have a CATiledLayer that is used to display a PDF page (this CATiledLayer
I have a Silverlight 4 application from which I'm attempting to display a PDF.
I have a pdf doc which has 2 pages per page I want to
I have a 600 page PDF that I call an intent from a previously
I have subclassed UIView object inside a uiscrollview which displays a pdf page. I
I have ASP.NET page with an iframe on it for displaying some pdf reports
I have some PDF files in a public rails folder. I want to set
I have an PDF Viewer in my application. I use the CGPDFDocumentRef and CGPDFPageRef

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.