From 1f0acc59b1b7ca252381e6348e7122c2ef0ab3d9 Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 2 Jan 2025 14:58:11 -0500 Subject: [PATCH 1/3] Fix layout issues in Privacy Settings --- .../WordPressUI/Extensions/UIImage+Color.swift | 13 ++++++++----- .../PrivacySettingsViewController.swift | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift b/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift index 4437aacdbe07..714fe82de028 100644 --- a/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift +++ b/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift @@ -4,13 +4,16 @@ public extension UIImage { /// Create an image of the given `size` that's made of a single `color`. /// - /// Size is in points. + /// - parameter size: Size in points. convenience init(color: UIColor, size: CGSize = CGSize(width: 1.0, height: 1.0)) { - let image = UIGraphicsImageRenderer(size: size).image { rendererContext in + let image = UIGraphicsImageRenderer(size: size).image { context in color.setFill() - rendererContext.fill(CGRect(origin: .zero, size: size)) + context.fill(CGRect(origin: .zero, size: size)) + } + if let cgImage = image.cgImage { + self.init(cgImage: cgImage, scale: image.scale, orientation: .up) + } else { + self.init() } - - self.init(cgImage: image.cgImage!) // Force because there's no reason that the `cgImage` should be nil } } diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift index 7f295f430f68..50be801ad3d7 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift @@ -38,7 +38,7 @@ class PrivacySettingsViewController: UITableViewController { PaddedInfoRow.self, SwitchRow.self, PaddedLinkRow.self - ], tableView: self.tableView) + ], tableView: self.tableView) handler = ImmuTableViewHandler(takeOver: self) reloadViewModel() From 33cba39c794450612fc26b5390fd5ffb605e0977 Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 2 Jan 2025 15:00:02 -0500 Subject: [PATCH 2/3] Add assertion --- Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift b/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift index 714fe82de028..73f507749adb 100644 --- a/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift +++ b/Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift @@ -13,6 +13,7 @@ public extension UIImage { if let cgImage = image.cgImage { self.init(cgImage: cgImage, scale: image.scale, orientation: .up) } else { + assertionFailure("faield to render image with color") self.init() } } From 5d1111bf12c1e8853d190ef1d5519fd6bbd8bc1c Mon Sep 17 00:00:00 2001 From: kean Date: Thu, 2 Jan 2025 15:00:21 -0500 Subject: [PATCH 3/3] Update release notes --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 9789b2bf087a..6475505c9181 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -8,6 +8,7 @@ * [*] Fix dynamic type support in the compliance popover [#23932] * [*] Improve transisions and interactive dismiss gestures for sheets [#23933] * [*] Add "Share" action to site link context menu on dashboard [#23935] +* [*] Fix layout issues in Privacy Settings section of App Settings [#23936] 25.6 -----