Search code examples
swiftpdfm13pdfkit

Make done button in M13PDFKit as Back Button


I'm using M13PDFKit. The done button in this image, i want to make it as back button. enter image description here


Solution

  • Goto PDFKBasicPDFViewer.m and follow the steps.

    Step 1:

    enter image description here

    Button code:

      self.backButtonTitle = @"Done";
      [buttonsArray addObject:[[UIBarButtonItem alloc] initWithTitle:self.backButtonTitle style:UIBarButtonItemStylePlain target:self action:@selector(dismissed)]];
    

    Step 2:

    enter image description here

    Dismiss View:

       - (void)dismissed
      {
        [self.navigationController popToRootViewControllerAnimated:YES];
      }
    

    Output:

    enter image description here