From 3df78d42187f754fb7bda1732c357b94201c5693 Mon Sep 17 00:00:00 2001 From: Xavi Moll Date: Tue, 14 Aug 2018 11:19:02 +0200 Subject: [PATCH 1/2] Enabled the modification of the contentMode applied to the iconImageView --- Source/APESuperHUD.swift | 1 + Source/HudAppearance.swift | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Source/APESuperHUD.swift b/Source/APESuperHUD.swift index d4f89a2..968a146 100644 --- a/Source/APESuperHUD.swift +++ b/Source/APESuperHUD.swift @@ -164,6 +164,7 @@ public class APESuperHUD: UIViewController { hudView.clipsToBounds = false } iconImageView.tintColor = HUDAppearance.iconColor + iconImageView.contentMode = HUDAppearance.iconContentMode messageLabel.font = HUDAppearance.messageFont titleLabel.font = HUDAppearance.titleFont diff --git a/Source/HudAppearance.swift b/Source/HudAppearance.swift index bbca803..ce64b1e 100644 --- a/Source/HudAppearance.swift +++ b/Source/HudAppearance.swift @@ -73,6 +73,9 @@ public struct HUDAppearance { /// The title font in the HUD public static var titleFont = UIFont.systemFont(ofSize: 20, weight: .bold) + /// The content mode used to render the icon + public static var iconContentMode: UIViewContentMode = .scaleToFill + /// The size of the icon inside the HUD public static var iconSize = CGSize(width: 48, height: 48) From ab2c03e3dbb282a392fed50fbc01b42bb7a0ef11 Mon Sep 17 00:00:00 2001 From: Xavi Moll Date: Tue, 14 Aug 2018 11:45:41 +0200 Subject: [PATCH 2/2] Updated the readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 41a3358..0e53d9d 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,9 @@ HUDAppearance.messageFont = UIFont.systemFont(ofSize: 13, weight: .regular) /// The title font in the HUD HUDAppearance.titleFont = UIFont.systemFont(ofSize: 20, weight: .bold) +/// The content mode used to render the icon +HUDAppearance.iconContentMode = .scaleToFill + /// The size of the icon inside the HUD HUDAppearance.iconSize = CGSize(width: 48, height: 48)