Search code examples
iosxcodeback-buttonnavigationbarairprint

AirPrint shows two back (< <) icons


i am willing to export some pdf files from my application using AirPrint in iOS. however when i present the UIPrintInteractionController it shows two back icons as < <. I have attached the images and code to get what i am doing. I think the icons are one for my own navigation bar and another of UIPrintInteractionController, i tried to hide the barItems but didn't work out. here's the code:

UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController];
            printController.delegate = self;

            NSMutableArray *printingItems = [NSMutableArray array];
            if(exportCSV) [printingItems addObject:csvData];
            if(exportPDF) [printingItems addObject:pdfData];

            UIPrintInfo *printInfo = [UIPrintInfo printInfo];
            printInfo.outputType = UIPrintInfoOutputGeneral;
            printInfo.jobName = @"MyHealth Export";
            printInfo.duplex = UIPrintInfoDuplexLongEdge;
            printController.printInfo = printInfo;
            printController.showsPageRange = YES;
            printController.printingItems = printingItems;

            dispatch_async(dispatch_get_main_queue(), ^{
                [printController presentAnimated:YES completionHandler:^(UIPrintInteractionController *printInteractionController, BOOL completed, NSError *error) { //code}

Image: enter image description here

Any help is appreciated.. Thanks in advance :)


Solution

  • Are you sure its two buttons and not one? It looks like you or something else may have set the title of the controller underneath or its Back button label to @"<". Normally it would show the larger < symbol followed by either the title of the controller below or "Back" if the title was too large. Somehow that seems to be set to "<" from what I can see.

    Is there anywhere where you change the title of the navigationItem? Perhaps in the attribute inspector for the navigation item which lets you put in a Back button label?