Skip to content

Commit

Permalink
fix: alert message
Browse files Browse the repository at this point in the history
- Fix alert message
  • Loading branch information
eapuzzo authored Mar 10, 2022
1 parent 6f684d0 commit b90e328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public struct AlertContent {
public var confirmActionTitle: String?
public var cancelAction: Action?
public var cancelActionTitle: String?
public var isHTMLBased: Bool? = false
public var isHTMLBased: Bool = false


public init (
Expand All @@ -46,7 +46,7 @@ public struct AlertContent {
confirmActionTitle: String? = nil,
cancelAction: Action? = nil,
cancelActionTitle: String? = nil,
isHTMLBased: Bool? = nil
isHTMLBased: Bool = false
) {
self.title = title?.localized
self.message = message?.localized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ public class AppAlertViewController: UIViewController {
let font = Font.getFont(size: fontSize, style: .regular)
messageTextView.font = font

guard let message = content.message, let isHTMLBased = content.isHTMLBased else {
guard let message = content.message else {
messageTextView.isHidden = content.message == nil
return
}

messageTextView.isHidden = false

guard !isHTMLBased else {
guard !content.isHTMLBased else {
let attributedMessage = try? NSMutableAttributedString(data: message.data(using: .utf8) ?? Data(), options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding:String.Encoding.utf8.rawValue], documentAttributes: nil)
messageTextView.attributedText = attributedMessage
return
Expand Down

0 comments on commit b90e328

Please sign in to comment.