From 589ece38605d4507b5bb0e1a25065c8101ce0d7a Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 2 Mar 2023 14:49:02 -0600 Subject: [PATCH] Fixes Scanner.scanHexInt32 deprecation warning --- AltStoreCore/Extensions/UIColor+Hex.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AltStoreCore/Extensions/UIColor+Hex.swift b/AltStoreCore/Extensions/UIColor+Hex.swift index ff8b78a9..cf537e57 100644 --- a/AltStoreCore/Extensions/UIColor+Hex.swift +++ b/AltStoreCore/Extensions/UIColor+Hex.swift @@ -25,8 +25,8 @@ public extension UIColor convenience init?(hexString: String) { let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) - var int = UInt32() - Scanner(string: hex).scanHexInt32(&int) + guard let int32 = Scanner(string: hex).scanInt32(representation: .hexadecimal), case let int = UInt32(int32) else { return nil } + let a, r, g, b: UInt32 switch hex.count { case 3: // RGB (12-bit)