You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/26 05:05:49 UTC

[GitHub] [cordova-plugin-statusbar] breautek commented on a change in pull request #134: feat: get statusbar height (top-inset)

breautek commented on a change in pull request #134: feat: get statusbar height (top-inset)
URL: https://github.com/apache/cordova-plugin-statusbar/pull/134#discussion_r350545105
 
 

 ##########
 File path: src/ios/CDVStatusBar.m
 ##########
 @@ -195,6 +195,14 @@ - (void) _ready:(CDVInvokedUrlCommand*)command
     }
 }
 
+- (void) height:(CDVInvokedUrlCommand*)command
+{
+    double statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
+    CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:statusBarHeight];
+    [result setKeepCallbackAsBool:YES];
 
 Review comment:
   Someone who has a bit more knowledgeable about iOS native development than me might be able shed more like but I think this `setKeepCallbackAsBool` is intended to be used to keep a reference of the callback so it can be invoked several times? Is this necessary here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org