Demo app dark mode support and letterbox/stepper fix#241
Conversation
… 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.
There was a problem hiding this comment.
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.
| <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"/> |
There was a problem hiding this comment.
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"/>
There was a problem hiding this comment.
I added a commit where I changed it to clear.
| // For night mode compatibility we use .labelColor | ||
| self.mathLabel.textColor = UIColor.labelColor; |
There was a problem hiding this comment.
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;There was a problem hiding this comment.
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.
…rs for night mode legibility
Test dark mode in simulator with cmd+shift+A
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
textColorfromUIColor.blacktoUIColor.label.