From 359ff2bfc26261c6ccd7f14c49a8965afee46257 Mon Sep 17 00:00:00 2001 From: Martin Svoboda Date: Thu, 2 Nov 2023 11:19:27 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=8E=A8=20Increase=20deployment=20targ?= =?UTF-8?q?et?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACKategories.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ACKategories.xcodeproj/project.pbxproj b/ACKategories.xcodeproj/project.pbxproj index 7bdaf097..df29a302 100644 --- a/ACKategories.xcodeproj/project.pbxproj +++ b/ACKategories.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -1585,7 +1585,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1661,7 +1661,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", From 7b3f4f4bee1c36ab30e78f53ed963690f52777d6 Mon Sep 17 00:00:00 2001 From: Martin Svoboda Date: Thu, 2 Nov 2023 11:20:02 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=8E=A8=20Update=20hexString=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scanLocation and scanHexInt32 are deprecated from iOS 13.0 --- ACKategories-iOS/UIColorExtensions.swift | 37 +++++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/ACKategories-iOS/UIColorExtensions.swift b/ACKategories-iOS/UIColorExtensions.swift index 376da899..b5962b96 100644 --- a/ACKategories-iOS/UIColorExtensions.swift +++ b/ACKategories-iOS/UIColorExtensions.swift @@ -16,17 +16,38 @@ public extension UIColor { } /** - Initialize color from hex string (eg. "#ff00ff"). Leading '#' is mandatory. + Initialize color from hex string (eg. "#ff00ff"). Leading '#' is not mandatory. - parameter hexString: Hex string to create color from */ - convenience init(hexString: String) { - var rgbValue: UInt32 = 0 - let scanner = Scanner(string: hexString) - scanner.scanLocation = 1 // bypass '#' character - scanner.scanHexInt32(&rgbValue) - self.init(hex: rgbValue) - } + convenience init(hexString: String) { + var hexSanitized = hexString.trimmingCharacters(in: .whitespacesAndNewlines) + hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "") + + var rgb: UInt64 = 0 + + var r: CGFloat = 0.0 + var g: CGFloat = 0.0 + var b: CGFloat = 0.0 + let a: CGFloat = 1.0 + + let length = hexSanitized.count + + guard Scanner(string: hexSanitized).scanHexInt64(&rgb) else { + self.init() + return + } + + if length == 6 { + r = CGFloat((rgb & 0xFF0000) >> 16) / 255.0 + g = CGFloat((rgb & 0x00FF00) >> 8) / 255.0 + b = CGFloat(rgb & 0x0000FF) / 255.0 + } else { + self.init() + } + + self.init(red: r, green: g, blue: b, alpha: a) + } /** Returns color as hex string (eg. '#ff00ff') or nil if RGBA components couldn't be loaded. From 778837877da7d345980628555198817fadddabd6 Mon Sep 17 00:00:00 2001 From: Martin Svoboda Date: Thu, 2 Nov 2023 11:26:10 +0100 Subject: [PATCH 3/5] =?UTF-8?q?Revert=20"=F0=9F=8E=A8=20Update=20hexString?= =?UTF-8?q?=20init"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7b3f4f4bee1c36ab30e78f53ed963690f52777d6. --- ACKategories-iOS/UIColorExtensions.swift | 37 +++++------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/ACKategories-iOS/UIColorExtensions.swift b/ACKategories-iOS/UIColorExtensions.swift index b5962b96..376da899 100644 --- a/ACKategories-iOS/UIColorExtensions.swift +++ b/ACKategories-iOS/UIColorExtensions.swift @@ -16,38 +16,17 @@ public extension UIColor { } /** - Initialize color from hex string (eg. "#ff00ff"). Leading '#' is not mandatory. + Initialize color from hex string (eg. "#ff00ff"). Leading '#' is mandatory. - parameter hexString: Hex string to create color from */ - convenience init(hexString: String) { - var hexSanitized = hexString.trimmingCharacters(in: .whitespacesAndNewlines) - hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "") - - var rgb: UInt64 = 0 - - var r: CGFloat = 0.0 - var g: CGFloat = 0.0 - var b: CGFloat = 0.0 - let a: CGFloat = 1.0 - - let length = hexSanitized.count - - guard Scanner(string: hexSanitized).scanHexInt64(&rgb) else { - self.init() - return - } - - if length == 6 { - r = CGFloat((rgb & 0xFF0000) >> 16) / 255.0 - g = CGFloat((rgb & 0x00FF00) >> 8) / 255.0 - b = CGFloat(rgb & 0x0000FF) / 255.0 - } else { - self.init() - } - - self.init(red: r, green: g, blue: b, alpha: a) - } + convenience init(hexString: String) { + var rgbValue: UInt32 = 0 + let scanner = Scanner(string: hexString) + scanner.scanLocation = 1 // bypass '#' character + scanner.scanHexInt32(&rgbValue) + self.init(hex: rgbValue) + } /** Returns color as hex string (eg. '#ff00ff') or nil if RGBA components couldn't be loaded. From 0033349a911712606f46d3d6417d429b91a5dec0 Mon Sep 17 00:00:00 2001 From: Martin Svoboda Date: Thu, 2 Nov 2023 11:26:20 +0100 Subject: [PATCH 4/5] =?UTF-8?q?Revert=20"=F0=9F=8E=A8=20Increase=20deploym?= =?UTF-8?q?ent=20target"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 359ff2bfc26261c6ccd7f14c49a8965afee46257. --- ACKategories.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ACKategories.xcodeproj/project.pbxproj b/ACKategories.xcodeproj/project.pbxproj index df29a302..7bdaf097 100644 --- a/ACKategories.xcodeproj/project.pbxproj +++ b/ACKategories.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -1585,7 +1585,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1661,7 +1661,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", From 8b52c8bcb4b9e833c1db9250a7c53f0d37b21ce3 Mon Sep 17 00:00:00 2001 From: Martin Svoboda Date: Thu, 2 Nov 2023 11:19:27 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20Increase=20deployment=20targ?= =?UTF-8?q?et?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACKategories.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ACKategories.xcodeproj/project.pbxproj b/ACKategories.xcodeproj/project.pbxproj index 7bdaf097..df29a302 100644 --- a/ACKategories.xcodeproj/project.pbxproj +++ b/ACKategories.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -1585,7 +1585,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1661,7 +1661,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "ACKategories-iOS/Supporting files/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks",