Repository: NativeScript/NativeScript
File: packages/core/ui/action-bar/index.ios.ts (TypeScript)

Code before:
		}

		// Set back button text
		if (previousController) {
			if (this.navigationButton) {
				const tapHandler = TapBarItemHandlerImpl.initWithOwner(new WeakRef(this.navigationButton));
				const barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction(this.navigationButton.text + '', UIBarButtonItemStyle.Plain, tapHandler, 'tap');
				previousController.navigationItem.backBarButtonItem = barButtonItem;
			} else {
				previousController.navigationItem.backBarButtonItem = null;
			}
		}

		// Set back button image
		let img: UIImage;
		if (this.navigationButton && isVisible(this.navigationButton) && this.navigationButton.icon) {
			img = loadActionIcon(this.navigationButton);
		}

		// TODO: This could cause issue when canceling BackEdge gesture - we will change the backIndicator to
		// show the one from the old page but the new page will still be visible (because we canceled EdgeBackSwipe gesutre)
		// Consider moving this to new method and call it from - navigationControllerDidShowViewControllerAnimated.
		const image = img ? img.imageWithRenderingMode(1 /* AlwaysOriginal */) : null;
		const appearance = this._getAppearance(navigationBar);
		appearance.setBackIndicatorImageTransitionMaskImage(image, image);
		this._updateAppearance(navigationBar, appearance);

		// Set back button visibility
		if (this.navigationButton) {
			this.navigationButton._navigationItem = navigationItem;
			navigationItem.setHidesBackButtonAnimated(!isVisible(this.navigationButton), false);
		}

		// Populate action items
		this.populateMenuItems(navigationItem);

		// update colors explicitly - they may have to be cleared form a previous page
		this.updateColors(navigationBar);

		// the 'flat' property may have changed in between pages
		this.updateFlatness(navigationBar);

		if (!this.isLayoutValid) {
			this.layoutInternal();
		}

		// Make sure accessibility values are up-to-date on the navigationItem
		navigationItem.accessibilityValue = this.accessibilityValue;
		navigationItem.accessibilityLabel = this.accessibilityLabel;
		navigationItem.accessibilityLanguage = this.accessibilityLanguage;
		navigationItem.accessibilityHint = this.accessibilityHint;

Review comment (suggestion):
Likely need to use `majorVersion` conditional like rest of the file here:
https://github.com/NativeScript/NativeScript/blob/b6f95d416e83ec7ace0fbd4e64b54962038d32d3/packages/core/ui/action-bar/index.ios.ts#L357

Code after:
		}

		// Set back button text
		if (previousController) {
			if (this.navigationButton) {
				const tapHandler = TapBarItemHandlerImpl.initWithOwner(new WeakRef(this.navigationButton));
				const barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction(this.navigationButton.text + '', UIBarButtonItemStyle.Plain, tapHandler, 'tap');
				previousController.navigationItem.backBarButtonItem = barButtonItem;
			} else {
				previousController.navigationItem.backBarButtonItem = null;
			}
		}

		// Set back button image
		let img: UIImage;
		if (this.navigationButton && isVisible(this.navigationButton) && this.navigationButton.icon) {
			img = loadActionIcon(this.navigationButton);
		}

		// TODO: This could cause issue when canceling BackEdge gesture - we will change the backIndicator to
		// show the one from the old page but the new page will still be visible (because we canceled EdgeBackSwipe gesutre)
		// Consider moving this to new method and call it from - navigationControllerDidShowViewControllerAnimated.
		const image = img ? img.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal) : null;
		if (majorVersion >= 15) {
			const appearance = this._getAppearance(navigationBar);
			appearance.setBackIndicatorImageTransitionMaskImage(image, image);
			this._updateAppearance(navigationBar, appearance);
		} else {
			navigationBar.backIndicatorImage = image;
			navigationBar.backIndicatorTransitionMaskImage = image;
		}

		// Set back button visibility
		if (this.navigationButton) {
			this.navigationButton._navigationItem = navigationItem;
			navigationItem.setHidesBackButtonAnimated(!isVisible(this.navigationButton), false);
		}

		// Populate action items
		this.populateMenuItems(navigationItem);

		// update colors explicitly - they may have to be cleared form a previous page
		this.updateColors(navigationBar);

		// the 'flat' property may have changed in between pages
		this.updateFlatness(navigationBar);

		if (!this.isLayoutValid) {
			this.layoutInternal();
		}