Disable PSPDFKit thumbnail - ios

I'm trying to disable the thumbnail see image that comes with PSPDFKit, I'm not sure exactly what its called so I'm having a really hardtime finding it in the code. Anyone that has used this library before have any idea where this thumbnail is coming from, what its called, or has anything that might help! Thanks.

To Disable the ScrobbleBar(Thumbnail Preview) and Position Overlay(Page no:) of the PDF in PSPDFKit
you have to do the following
PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:yourMagazine];
pdfController.scrobbleBarEnabled = NO; // Disable the Bottom Scrobble Bar
pdfController.pageLabelEnabled = NO; // Disables the bottom document site position overlay.

Related

Missing buttons from AirPrint dialog

I've implemented AirPrinting from my app but I'm facing a strange issue. Whenever the print dialog appears, there are no Cancel or Done/Print buttons displayed, as shown in the following image.
The code I'm using is as follows:
if ([UIPrintInteractionController canPrintURL:pdfUrl]) {
UIPrintInfo *aPrintInfo = [UIPrintInfo printInfo];
aPrintInfo.outputType = UIPrintInfoOutputGeneral;
aPrintInfo.jobName = [NSString stringWithFormat:#"%#-PRINT",[[NSUserDefaults standardUserDefaults] stringForKey:#"Kiosk ID"]];
UIPrintInteractionController *aPrintController = [UIPrintInteractionController sharedPrintController];
aPrintController.showsNumberOfCopies=YES;
aPrintController.showsPaperSelectionForLoadedPapers=YES;
aPrintController.printingItem = pdfUrl;
aPrintController.printInfo = aPrintInfo;
[aPrintController presentAnimated:YES completionHandler:NULL];
}
Does anyone have experience with this problem and know how to rectify? What's really odd is that the actions for these hidden buttons still work; so if I tap where the print button should be, it'll print and likewise I can close the dialog by tapping the top left where the Cancel button should be.
Cheers!
p.s using latest version of IOS 11, issue occurs in simulator and on device.
[Edit] I've just now tested a print example from Apple found at
https://developer.apple.com/library/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422-Intro-DontLinkElementID_2
and although the code to bring up the AirPrint dialog are very similar (more-so after I tweaked a few bits of my code) the demo code worked as expected (buttons visible) while my code still does not. Very confusing.
[Edit 2] Using the code sample above in a fresh project works as expected too. Yet, in my full app, it does not. Does anyone have experience as to why that my be? Are system dialogs affected by the size of the app perhaps? Doesn't seem likely, but there is definitely something awry with my app using this code that isn't obvious.
[Edit 3] I enhanced the fresh project by incrementally introducing the same elements from my main project, going as far as bringing in the same Pods and setting up the same UI structure, and adding UIImage elements. It did not have the exact same number of views, and those were not doing the same things as my main project, but the memory usage was similar. And yet still, it worked. Are workspace corruptions a thing in Xcode, something behind the scenes not represented in any UI that might explain this?
[Edit 4] I just created a completely new project, reinstalled all the pods, then moved my source files from my original project to the new project. Quell surprise, the issue still remains in the new project.
[Edit 5] Solved! I finally found the issue thanks in part to the tip from the accepted answer below. It was due to having a global tint colour set to Clear, but also having individual Views within each controller also setting the tint colour to clear. This affected the dialog being shown and as such the buttons were invisible. Once I changed the Views to have an actual colour for the Tint property the print dialog buttons were once again visible.
There is no direct issue with UIPrintInteractionController code. As you mention click of done and cancel buttons are working as expected. The only problem is visibility of buttons.
Try changing navigation bar tint color before presenting print controller.
self.navigationBar.barStyle = UIBarStyle.Black
self.navigationBar.tintColor = .black
Note:- I don't have your code. This is only one of the problems and solution related to your issue.
I have also used your code and it is working as expected it has cancel and print button in iOS 11 also. Here is the code
([UIPrintInteractionController canPrintURL:self.pdfUrl]) {
UIPrintInfo *aPrintInfo = [UIPrintInfo printInfo];
aPrintInfo.outputType = UIPrintInfoOutputGeneral;
aPrintInfo.jobName = #"test job";
UIPrintInteractionController *aPrintController = [UIPrintInteractionController sharedPrintController];
aPrintController.showsNumberOfCopies=YES;
aPrintController.showsPaperSelectionForLoadedPapers=YES;
aPrintController.printingItem = self.pdfUrl;
aPrintController.printInfo = aPrintInfo;
[aPrintController presentAnimated:YES completionHandler:NULL];
}
Please check if pdfUrl is having valid URL, also in UI pdf should load if it is a valid url.
Below is the url which I am using
self.pdfUrl = [NSURL URLWithString:#"http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf"];
Edit 1:-
Attaching the screen shot

Camera Using custom Camera Preview Renderer is not clear

I am using the following link to display the camera preview using Custom renderers
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/view/
I was able to bring up the camera preview. But the preview is not at all clear. There is no Auto focus as well.
Screenshot for reference
How can I make the camera preview clearer, because I wish to use the same later on for OCR.
Thanks,
I think you already figured this out but I'm going to post the solution here for reference.
You need to setup the "Focus Mode" in the Camera properties.
Camera Preview = Camera.Open(1);
// Set the parameters.
if (Preview != null)
{
Camera.Parameters cameraParameters = Preview.GetParameters();
// Autofocus
cameraParameters.FocusMode = Camera.Parameters.FocusModeContinuousPicture;
// Set
cameraPreview.Preview.SetParameters(cameraParameters);
}
For the example you mentioned (the one in https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/view/) you should place this code in you Android Cutom Renderer (CameraPreviewRenderer method OnElementChanged).
It worked for me. Hope this helps.
//Write logic inside the RunOnUiThread.
MainActivity.Instance.RunOnUiThread(() => { SetupUserInterface(); SetupEventHandlers(); AddView(view); cameraQuality = CameraQuality.High; });

Overlay text on the application to show debug information

I am basically developing an iOS SDK which will be used by other apps using Cocoa pods. My question is:
Is it feasible to overlay plain text on the screens of the host app, showing them important debug information(as they use the app)? pretty much like the fps information on games screens. If yes, suggestions?
Have been searching around but all I can find are discussions around overlaying on Camera, Map and Video player, like the following:
How do i overlay a text box over a native camera view in IOS
Is it possible to add a text overlay to videos?
Change text of label in ios camera overlay UIPickercontroller
Text overlay not showing in GPUImage iOS
Any guidance in this respect would be appreciated.
Yes, should be feasible, I would add a "debug" subview to the window and set the userInteractionEnabled = NO so that view does not consume touches.
Something like this should get you started:
#if DEBUG
UILabel *debugInfo = [[UILabel alloc] init];
debugInfo.text = #"some debug information here";
debugInfo.numberOfLines = 0;
[debugInfo sizeToFit];
debugInfo.userInteractionEnabled = NO;
[[[[UIApplication sharedApplication] delegate] window]addSubview:debugInfo];
#endif

Change iOS System Keyboard Background Image and Buttons Image

Rather than creating a custom keyboard...how can I change the ios keyboard background image and get reference of the keyboard button or just the keyboard view programatically?
I do not want to replicate the whole ios keyboard, just tweak the keyboard here and there.
Solution Update:
You cannot update only the background or the buttons of the iOS System Keyboard! This is dues to the reason that Apple has limited the access to the Keyboard API. The most you can do is change the keyboard background color i.e. dark or light.
If you need to change the background to an image like me, you need to extend the ios keyboard i.e. make your own custom keyboard!
Please check below for accepted answer!
Hope this helps!
You can do something like this,
myTextField.keyboardType = UIKeyboardTypeDecimalPad; // many other options
myTextField.keyboardAppearance = UIKeyboardAppearanceDark; //many other options
If you want totally customize keyboard then refer this tutorial.
Hope this will help :)
For dark background you can use
mytextfield.keyboardAppearance = UIKeyboardAppearanceAlert;
For more customisation follow this link:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextInputTraits_Protocol/index.html

Black temporary alert box in iOS

I need a black temporary transparent box that must show something like "Loading...." with a spinner it. We can see such a view in twitter when "Tweeting" an update - it says "Sending tweet..." kinda thing.
Is this an inbuilt behavior in UIKit. How do I get this box to show up on screen for a few seconds and disappear.
please help.
You need to use DSActivityView. All this is handled there. Instead of doing your own thing I suggest you use this.
For what you need this is how you need to go -
#import "DSActivityView.h"
[DSActivityView activityViewForView:self.view withLabel:#"Tweeting"]; //to show spinner with label
[DSActivityView removeView]; //once its done
You can also try using MBProgressHud

Resources