Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change colors #29

Closed
ZachAttackMLR opened this issue Mar 12, 2020 · 3 comments
Closed

Can't change colors #29

ZachAttackMLR opened this issue Mar 12, 2020 · 3 comments

Comments

@ZachAttackMLR
Copy link

In Interface.storyboard, I was easily able to change the fonts used, which was great. After getting that to work, I wanted to change the colors of "user@watch ...", along with the colors of "[TIME]", "[DATE]", etc.

This can't be done in the storyboard for some reason, so I tried to do it programmatically. When I create new IBOutlets (and then set the colors), nothing changes on the storyboard and the colors aren't updated.

I'm super new to Swift, so I'm assuming I'm just setting the colors incorrectly, but from all my Googling I can't figure out what I'm doing wrong. Any help would be appreciated. Thanks!

@kuglee
Copy link
Owner

kuglee commented Mar 12, 2020

It should be the same as the other ones. You can change them in the storyboard. Try cleaning the build folder, and build again.

@ZachAttackMLR
Copy link
Author

Figured out the problem. As suspected, there wasn't any issue with your code, but rather how Xcode handled me changing the colors in the storyboard. I first changed the color of one label to a custom color, and that custom hex color stuck around in the "Colors" pop-up (but not in "Recently Used Colors") when I was trying to change the colors of other labels. Since I gave up earlier and closed Xcode, I re-launched Xcode, and changing one label's color to a custom color from the storyboard magically worked. I then attempted to change other labels to the same color using the exact same process, and it didn't work.

The solution is dumb, but worked. Apparently in Xcode (at least on my machine), in order to change the color of a different label, I had to re-input the text's original color (in this case #FFFFFF), hit enter/return, close the "Colors" window, select a new label, and then go back to the label I was trying to change and input the custom color. This worked perfectly without any need to alter code.

Closing since it's obviously now a non-issue. Thanks for the quick response and help!

@ZachAttackMLR
Copy link
Author

In case anyone is curious, here's what I ended up with. Changed the font to Hack Nerd by adding the .ttf file to the same directory SF-Mono-Regular.otf, changed text and colors for the labels not connected to IBOutlets, and then adjusted some spacing. The hex for the green color is #5BEE96 , and #F5C013 for the yellow.

IMG_0256

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

No branches or pull requests

2 participants