Created
August 28, 2019 07:51
-
-
Save HassanElDesouky/1d202b490f4796dc63e8a3ed991c788d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListIconController: UIViewController { | |
//.. | |
@objc private func handleChangeColor(notification: Notification) { | |
guard let colorDict = notification.userInfo else { return } | |
guard let colors = colorDict["colorDict"] as? [UIColor] else { return } | |
firstColorData = colors[0].encode() | |
secondColorData = colors[1].encode() | |
iconView.backgroundImage.image = nil | |
setIconGradient(colorOne: colors[0], colorTwo: colors[1]) | |
} | |
@objc private func handleChangeIcon(notification: Notification) { | |
guard let iconDict = notification.userInfo else { return } | |
guard let image = iconDict["iconDict"] as? UIImage else { return } | |
iconView.backgroundImage.image = nil | |
iconView.image.image = image | |
iconView.image.image = iconView.image.image?.withRenderingMode(.alwaysTemplate) | |
iconView.image.tintColor = .white | |
iconView.contentMode = .scaleAspectFit | |
} | |
@objc private func handleChangeImage(notification: Notification) { | |
guard let iconDict = notification.userInfo else { return } | |
guard let image = iconDict["iconDict"] as? UIImage else { return } | |
isImage = true | |
iconView.image.image = nil | |
iconView.backgroundImage.image = image | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment