Github user spurreiter commented on the pull request:

    
https://github.com/apache/cordova-plugin-statusbar/commit/fff289c0b8a7d0eb5b94f06d8ace9733054185bd#commitcomment-25084420
  
    First of all I am not an iOS developer, but IMHO the change does not set 
`frame.origin.y` if `isIOS7` is set.
    
    ```
      if (isIOS7) { //< true
        ...
      } else { 
        if (isIOS11) { //< never reaches here 
          ...
        } else { 
          frame.origin.y = height >= 20 ? height - 20 : 0; //< never reaches 
here 
        }
      }
    ```
    
    For wrongly set max SDK version but running on iOS11 this would even be 
unset as well...
    
    ```
      if (isIOS7) { //< false
        ...
      } else {
        if (isIOS11) { //< true
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
          // compiler strips code
    #endif
        } else { 
          frame.origin.y = height >= 20 ? height - 20 : 0; //< never reaches 
here
        }
      }
    ```
    
    So wouldn't it be better to do?
    
    ```
      if (isIOS7) { 
        ...
      } else {
        frame.origin.y = height >= 20 ? height - 20 : 0;
        if (isIOS11) {
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
          if (@available(iOS 11.0, *)) {
            ...
          } 
    #endif
        }
      }
    ```
    



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to