Skip to content

Demo app dark mode support and letterbox/stepper fix#241

Open
Janneman84 wants to merge 4 commits into
kostub:masterfrom
Janneman84:master
Open

Demo app dark mode support and letterbox/stepper fix#241
Janneman84 wants to merge 4 commits into
kostub:masterfrom
Janneman84:master

Conversation

@Janneman84

@Janneman84 Janneman84 commented Jun 15, 2026

Copy link
Copy Markdown

Test dark mode in simulator with cmd+shift+A

Simulator Screenshot - iPhone 17 - 2026-06-15 at 15 44 45

I noticed the equation you create yourself (at the top) does not change color or change font/size like the rest. Is this by design? I mean I could easily fix this.

Oh and I suggest you change the default textColor from UIColor.black to UIColor.label.

… also fixes the shifted stepper (liquid glass). One constraint was adjusted but the editor updated a bunch of stuff.
…ft+A. This also required switching to system colors in the color pallette, of which a few more were added and reordered for a full rainbow.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the example application to support modern iOS devices and dark mode by removing legacy launch images, updating the XIB layout, and adopting dynamic system colors. However, two issues were identified regarding dark mode compatibility: the math label retains a hardcoded white background in the XIB, which will cause text to become invisible (white-on-white) in dark mode. It is recommended to set the background color of the math label to clear/transparent both in the XIB and programmatically in the view controller.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread iosMathExample/View.xib Outdated
<rect key="frame" x="10" y="65" width="300" height="60"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<rect key="frame" x="10" y="65" width="373" height="60"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The mathLabel (jao-lN-IEn) has a hardcoded white background (#FFFFFF) in the XIB. In dark mode, since its text color is set to UIColor.labelColor (which becomes white), the text will be white on a white background, making the custom equation completely invisible. Changing the background color to a transparent/clear color resolves this issue and allows the parent view's dynamic background to show through.

<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit where I changed it to clear.

Comment on lines +100 to +101
// For night mode compatibility we use .labelColor
self.mathLabel.textColor = UIColor.labelColor;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To ensure that the custom equation label (self.mathLabel) is fully compatible with dark mode, we should also programmatically set its background color to clear. This acts as a safe fallback in case the XIB's background color is not updated, preventing white-on-white text invisibility in dark mode.

    // For night mode compatibility we use .labelColor
    self.mathLabel.textColor = UIColor.labelColor;
    self.mathLabel.backgroundColor = UIColor.clearColor;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out MTMathUILabel already sets background to clear when created from a xib. So this extra line would be unnecessary.

You actually pointed out a bug because you would expect the background color to be whatever you set it in the xib. Currently this just gets ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant