You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2026/06/13 15:51:01 UTC
(cordova-ios) 01/01: fix: proper macro check for `TARGET_OS_VISION`
This is an automated email from the ASF dual-hosted git repository.
GitToTheHub pushed a commit to branch pr-fix-macro-check-TARGET_OS_VISION
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
commit ac270150bebdef4b4a97e448515df7490f04490b
Author: Manuel Beck <ma...@outlook.de>
AuthorDate: Sat Jun 13 17:50:52 2026 +0200
fix: proper macro check for `TARGET_OS_VISION`
- `TARGET_OS_VISION` is defined by Appleās headers as a macro with a value, so `#ifndef TARGET_OS_VISION` is the wrong test. On iPhone it is typically defined as 0, which still makes `#ifndef` false. That means the guarded code gets excluded even though you are not on visionOS.
- Test the macro by `#if !TARGET_OS_VISION` instead of `#ifndef TARGET_OS_VISION`
- Generated-By: GPT-5.3-Codex
---
CordovaLib/Classes/Public/CDVViewController.m | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/CordovaLib/Classes/Public/CDVViewController.m b/CordovaLib/Classes/Public/CDVViewController.m
index f5d6877d..32406650 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -577,7 +577,7 @@ static UIColor *defaultBackgroundColor(void) {
- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView
{
-#ifndef TARGET_OS_VISION
+#if !TARGET_OS_VISION
if (self.webView.hidden) {
self.statusBar.hidden = true;
return;
@@ -587,7 +587,7 @@ static UIColor *defaultBackgroundColor(void) {
#endif
}
-#ifndef TARGET_OS_VISION
+#if !TARGET_OS_VISION
- (BOOL)prefersStatusBarHidden
{
// The CDVStatusBar plugin overrides this in a category extension, and
@@ -731,7 +731,7 @@ static UIColor *defaultBackgroundColor(void) {
- (void)createStatusBarView
{
-#ifndef TARGET_OS_VISION
+#if !TARGET_OS_VISION
// If cordova-plugin-statusbar is loaded, we'll let it handle the status
// bar to avoid introducing conflict
if (NSClassFromString(@"CDVStatusBar") != nil)
@@ -889,7 +889,7 @@ static UIColor *defaultBackgroundColor(void) {
- (void)showStatusBar:(BOOL)visible
{
-#ifndef TARGET_OS_VISION
+#if !TARGET_OS_VISION
[self.statusBar setAlpha:(visible ? 1 : 0)];
[self setNeedsStatusBarAppearanceUpdate];
#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org