Links showing in red instead of blue? - swift

When I use the canvas view, my app has normal blue links in both dark and light themes. However, when I run it in the simulator or on any test device, they are red instead of blue, in both light and dark themes. What the heck is going on?!?
I'm using latest version of everything, and I've tried it on multiple sim devices and physical devices. This is present on every screen in my app.

Turns out my co-developer had added an override in the AppDelegate that was changing the text colors. Removing that fixed the issue.

Related

UIButton has strange unexpected bakground color on different device

I've recently been building an app under iOS 15 (latest as of writing this code), and when I shipped a version of my app to test flight, one of my users sent me a video of the app working, and I noticed, all of my buttons have this strange background highlight effect. Is this some sort of accessibility mode? I've never seen this happen before. In included some screenshots below and the interface builder, there are no custom classes associated to this UIButton. And ALL of the buttons have this effect happening to them.
This other device has a strange background color attached:
But this is how its designed and how it shows up on my device and the simulator:
Here is a screenshot from Interface Builder:
I had a similar problem.
Change the style to default.
And then instead of the tint color, choose the text color.
The background can remain default.. and is therefore transparency.
Tested, works.
Example
Turns out my user had something in iOS accessibility settings turned on, called "Button Shapes". I had no idea...

How to support dark mode in splash screens?

I am trying to support dark mode in a splash screen, which means that I am using a named color inside the LaunschScreen.storyboard file, but I have this error:
Named colors do not work prior to iOS 11.0.
Clearly the problem is that named colors work only in the newer versions of iOS, but there is no easy fix for that. I tried to create a custom view and set the color there, but I just found out that it's not allowed to use custom classes in launch screens. For now the only solution that comes to my mind is to create two separate targets, one for iOS 11+, one for the lower versions but it's a bit overkill and I don't like the idea. Apparently there is no recommendation from Apple on how to support dark mode in launch screen (or at least I couldn't find anything). Any suggestion?
Use systemBackgroundColor for the main view background color.
You can change in Storyboard GUI (no code needed) automatically the system will set the right color in iOS13 and white for previous iOS versions.
PS: for other colors you can use System xxxx Color for standards.
As you said named colors will not work below iOS 11.
[alternative] So, you can create an Image View in Launch screen and set a dark appearance for that image like below.
You can apply your colors in that image.

Background color won't change on device

So, I have changed the view´s background color, sometimes by using the visual tool, other times using a image as a pattern for a UIColor. It all looks fine on device simulator, but when running on a device, all the backgrounds looks white.
It doesnt matter if I selected a solid color or used a image at the project bundle to color its background, they all stay white ONLY when running on the device. I even ran on retinal simulator, and it looked ok.
I had that once, after localizing my xibs. Tried many times (many days) to solve it, loading the images again and again, nothing worked. It made me crazy... should be an Xcode bug...
to save time, try to create another project, import the current one (I imported the code, class by class, and the images). It worked for me. no explanation to date!

Correct colour display of Default.png on iPhone

I'm using the Default.png method to create a splashscreen. I'm using the same file for my background and the Default.png (except default.png has the 20 pixel status bar at the top).
However, the iphone isn't displaying them in them the same. The Default.png is being displayed darker than the background, so it's painfully obvious when the app is loaded.
As a visual example of what I mean, please see below:
The image on left is the Default.png whereas the image on the right is when the app has loaded. The difference looks subtle here but when the whole image changes, it looks quite drastic.
Is this an issue with the colour-formatting of the pngs? Or is this an iOS feature whereby the Default.png appears slightly darker anyway?
It's probably not worth mentioning but I'm using Monotouch to develop my app, I doubt that would have anything to do with this.
I had a problem like this after editing a screenshot with OSX's Preview to cut out the status bar (as needed for iPad splashes). Preview sticked a color profile, and splash screen appears darker than the real thing in device.
If you open the image with GIMP, it shows a dialog offering to convert the color profile to SRGB. Take it (press "Convert") and save the image. This fixes the color difference.
Solved the problem. The designer sent me new versions of the backgrounds and the Default.png is now displaying the correct colour.
I have a feeling I had saved the previous version with a different colour profile to the background, hence why it was being displayed differently.

iPhone UIDatePicker Gradient - What are the colors?

I'm putting in a UIDatePicker in a UIView and I can see that the UIDatePicker has a border that is some kind of a dark color on the bottom and it gets lighter as you get higher. I want the containing UIView to use the same colors so that the UIDatePicker flows with the rest of the view and doesn't stand out.
I can put in a gradient in the containing view, but I don't know what colors to use! If anyone could suggest them, I'd appreciate it.
mj
Light Color (Top): RGB: 145,146,154
Dark Color (Bottom): RGB: 30,31,44
Use Digital Color Meter that is built-in to OS X (in the Utilities folder).
The colours displayed in Xcode don't always match those when the app is viewed on an actual iOS device, especially for UIDatePicker object.
What I've found useful is the following:
Run the app on an iOS device with your objects on screen
Take a screenshot (hold down the home button and the power button together)
Email that screenshot to your Mac
Use the OS X Digital Color Meter on the screenshot to get accurate RGB values
Remember to check both retina and non retina devices for colour matching.