How To Access The Uiprintinteractioncontroller Class With Nativescript
I'm trying to implement AirPrint printing and need to instantiate UIPrintInteractionController. However, I can't seem to get it to find the class. How can I access this UIKit class
Solution 1:
Use the following syntax for your case :
functionfindPrinter() {
var printController = UIPrintInteractionController;
console.log(printController.isPrintingAvailable());
}
exports.findPrinter = findPrinter;
Here are some more example for Objective-C to JS based on the {N} documenation
Objective-C code
NSMutableArray * array = [[NSMutableArray alloc] init];
Class buttonClass = [UIButtonclass];
UIButton * button = [[buttonClass alloc] init];
[array setObject: buttonClass atIndex: 0];
[array setObject: button atIndex: 1];
NativeScript code
vararray = new NSMutableArray();
var buttonClass = UIButton;
var button = new buttonClass();
array.setObjectAtIndex(buttonClass, 0);
array.setObjectAdIndex(button, 1);
More details can be found at NativeScript documentation
Post a Comment for "How To Access The Uiprintinteractioncontroller Class With Nativescript"