Skip to content

Commit

Permalink
Use scanHexInt64 instead of the deprecated scanHexInt32 in iOS 13
Browse files Browse the repository at this point in the history
  • Loading branch information
BalestraPatrick authored Jun 10, 2021
1 parent 79a0b70 commit bc72dc4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ extension String {
return (red: 0, green: 0, blue: 0)
}

var rgbValue:UInt32 = 0
Scanner(string: cString).scanHexInt32(&rgbValue)
var rgbValue:UInt64 = 0
Scanner(string: cString).scanHexInt64(&rgbValue)

return (red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
Expand Down

0 comments on commit bc72dc4

Please sign in to comment.