Home > Software design >  Nativescript 6.x project using Xcode 12. Will Xcode 13 work?
Nativescript 6.x project using Xcode 12. Will Xcode 13 work?

Time:10-08

I've got a NS 6.x project.

I can build it using Xcode 12.

If I download Xcode 13 (for iOS 15 testing), will it build the same NS 6.x project - without breaking it, requiring ns/plugin updates.

Thanks.

CodePudding user response:

In case you haven't tried already, I have been able to compile an app using NS 6.8.0 on Xcode 13. A couple of points:

  1. At first it seemed to fail building, but it does now work. I think the solution was to remove my platforms folder but I can't confirm if this is the actual fix.
  2. My app now seems to be affected by a transparent status bar at the top of the app. When you start to scroll the page the colour fills in, but I am still trying to find a solution for this.

I hope that helps!?

CodePudding user response:

Regarding the transparent status bar, I was able to hack out this code and get it working:

in main-page.js:

const Color = require("tns-core-modules/color").Color
const Frame = require("tns-core-modules/ui/frame").Frame;
const platform = require("tns-core-modules/platform");

in onNavigatingTo

  let osVersionMajor = platform.device.osVersion.split(".")[0];
  if (platform.isIOS && osVersionMajor >= 15 ) {
    let navigationBar = Frame.topmost().ios.controller.navigationBar;
    let appearance = new UINavigationBarAppearance();
    appearance.configureWithOpaqueBackground();
    appearance.backgroundColor = new Color("#FF2525FE").ios;
    appearance.titleTextAttributes = NSDictionary.dictionaryWithDictionary({
      [NSForegroundColorAttributeName]: UIColor.whiteColor
    });
    navigationBar.standardAppearance = appearance;
    navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance;
  } 

This matches the blue title bar in the blue theme, but you could change the hex code for the background color to whatever you want. Also note, this is a NativeScript 6.8 JavaScript project.

  • Related