Skip to content

Commit

Permalink
Font customisation added.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitazernov committed Dec 9, 2020
1 parent a4d947a commit aebda02
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Source/SPAlert/Views/SPAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ open class SPAlertView: UIView {
*/
public var dismissByTap: Bool = true

public var titleFont: UIFont = UIFont.boldSystemFont(ofSize: 22) {
didSet {
self.titleLabel?.font = titleFont
}
}

public var subtitleFont: UIFont = UIFont.systemFont(ofSize: 16) {
didSet {
self.subtitleLabel?.font = subtitleFont
}
}

/**
Vibro for this alert. Default value using for presets. If you init custom. haptic not configure.
*/
Expand Down Expand Up @@ -150,7 +162,7 @@ open class SPAlertView: UIView {
}

if let titleLabel = titleLabel {
titleLabel.font = UIFont.boldSystemFont(ofSize: 22)
titleLabel.font = titleFont
titleLabel.numberOfLines = 0
let style = NSMutableParagraphStyle()
style.lineSpacing = 3
Expand All @@ -160,7 +172,7 @@ open class SPAlertView: UIView {
}

if let subtitleLabel = subtitleLabel {
subtitleLabel.font = UIFont.systemFont(ofSize: 16)
subtitleLabel.font = subtitleFont
subtitleLabel.numberOfLines = 0
let style = NSMutableParagraphStyle()
style.lineSpacing = 2
Expand Down

0 comments on commit aebda02

Please sign in to comment.