iOS and Xcode provide a wide variety of tools and options to deal with color contrast ratios. From system colors, that automatically support Increase Contrast, to high contrast color and asset variants, and even a built-in contrast calculator.

You may also find interesting...

The most straightforward way for making sure your colors work well in all appearances (dark, light, increase contrast, and all the combinations) is to use the provided system colors. Check the background and label semantic colors too. All the info in the Color section of Apple’s Human Interface Guidelines: https://developer.apple.com/design/human-interface-guidelines/color
Second day of @a11yTO! And again, lots of talks with a ton of practical information. So here's a thread with some of my highlights. And very proud that @spotifydesign was one of the sponsors! #a11yTOconf

There is an Environment Overrides panel in the toolbar on top of Xcode's Debug Area. It allows you to select some of the most common accessibility options and Dynamic Type sizes, like in the Accessibility Inspector, plus select dark/light mode.