Styleguide fixes
This commit is contained in:
parent
e6f0843806
commit
d2e3b642cc
@ -45,7 +45,8 @@
|
|||||||
NSArray *arguments = [command arguments];
|
NSArray *arguments = [command arguments];
|
||||||
CDVPluginResult *pluginResult = nil;
|
CDVPluginResult *pluginResult = nil;
|
||||||
|
|
||||||
if (![self isPrintServiceAvailable]) {
|
if (![self isPrintServiceAvailable])
|
||||||
|
{
|
||||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
|
||||||
messageAsString:@"{success: false, available: false}"];
|
messageAsString:@"{success: false, available: false}"];
|
||||||
|
|
||||||
@ -54,7 +55,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([arguments count] == 0) {
|
if ([arguments count] == 0)
|
||||||
|
{
|
||||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
|
||||||
messageAsString:@"{success: false, available: true}"];
|
messageAsString:@"{success: false, available: true}"];
|
||||||
|
|
||||||
@ -70,13 +72,16 @@
|
|||||||
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
|
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
|
||||||
CDVPluginResult *pluginResult = nil;
|
CDVPluginResult *pluginResult = nil;
|
||||||
|
|
||||||
if (!completed || error) {
|
if (!completed || error)
|
||||||
|
{
|
||||||
NSString *result = [NSString stringWithFormat:@"{success: false, available: true, error: \"%@\"}", error.localizedDescription];
|
NSString *result = [NSString stringWithFormat:@"{success: false, available: true, error: \"%@\"}", error.localizedDescription];
|
||||||
|
|
||||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
|
||||||
messageAsString:result];
|
messageAsString:result];
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
||||||
messageAsString:@"{success: true, available: true}"];
|
messageAsString:@"{success: true, available: true}"];
|
||||||
}
|
}
|
||||||
@ -125,7 +130,8 @@
|
|||||||
{
|
{
|
||||||
Class printController = NSClassFromString(@"UIPrintInteractionController");
|
Class printController = NSClassFromString(@"UIPrintInteractionController");
|
||||||
|
|
||||||
if (printController) {
|
if (printController)
|
||||||
|
{
|
||||||
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
|
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
|
||||||
|
|
||||||
return (controller != nil) && [UIPrintInteractionController isPrintingAvailable];
|
return (controller != nil) && [UIPrintInteractionController isPrintingAvailable];
|
||||||
|
Loading…
Reference in New Issue
Block a user