-3

I upgraded my swift project to swift 4.2 and a very strange change occurred. The white color of my button became blue after run. In the story board, the color remains white but when I run the application, the color turns blue. I do not know what I have to do.

Jamil Hasnine Tamim
  • 4,389
  • 27
  • 43
King
  • 1,885
  • 3
  • 27
  • 84
  • Please add more information like, what kind of button that is (custom or system type). What's the state of button, are you accessing that button through code and manipulating it for any purpose etc. – Midhun MP Jan 06 '19 at 08:20
  • Did you migrate whole project to 4.2? Please explain with image or graphical representation. – Jamil Hasnine Tamim Jan 06 '19 at 08:53

2 Answers2

0

Check If your button type was earlier System or Custom

enter image description here

Yogesh Tandel
  • 1,738
  • 1
  • 19
  • 25
0

Xcode 8+, iOS 10+

I recently faced this problem and none of the posted answers did it. It turns out that with the release of iOS 10 SDK, the UIColor initializer init(red:green:blue:alpha:) now uses the extended sRGB range, so you have to set accordingly when configuring your color values on the Storyboard.

enter image description here

See Apple's documentation: https://developer.apple.com/reference/uikit/uicolor/1621925-init

Solution from : Color in storyboard not matching UIColor

Jamil Hasnine Tamim
  • 4,389
  • 27
  • 43