Skip to content

Commit

Permalink
Merge pull request #1261 from wakmusic/1208-remove-deprecated-toast-func
Browse files Browse the repository at this point in the history
๐Ÿ”€ :: (#1208) deprecated ํ† ์ŠคํŠธ ํ•จ์ˆ˜ ์ œ๊ฑฐ
  • Loading branch information
KangTaeHoon authored Aug 31, 2024
2 parents 7f5ab7f + a07f71f commit a2b9ca0
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public extension UIViewController {
)
}

@_disfavoredOverload
func showToast(
text: String,
font: UIFont = UIFont(name: "Pretendard-Light", size: 14) ??
Expand Down Expand Up @@ -92,44 +91,6 @@ public extension UIViewController {
SwiftEntryKit.display(entry: contentView, using: attributes)
}

@available(*, deprecated, message: "ํ† ์ŠคํŠธ ์œ„์น˜ ์กฐ์ • ๋ฒ„์ „์œผ๋กœ ๊ฐœ์„ ")
func showToast(
text: String,
font: UIFont = UIFont(name: "Pretendard-Light", size: 14) ??
.systemFont(ofSize: 14, weight: .light),
verticalOffset: CGFloat? = nil
) {
var attributes = EKAttributes.bottomFloat
attributes.displayDuration = 2
attributes.entryBackground = .color(color: EKColor(rgb: 0x101828).with(alpha: 0.8))
attributes.roundCorners = .all(radius: 20)
attributes.entranceAnimation = EKAttributes.Animation.init(
translate: .init(duration: 0.3),
fade: .init(from: 0, to: 1, duration: 0.3)
)
attributes.exitAnimation = EKAttributes.Animation.init(
fade: .init(from: 1, to: 0, duration: 0.3)
)

if let verticalOffset = verticalOffset {
attributes.positionConstraints.verticalOffset = verticalOffset
}

let style = EKProperty.LabelStyle(
font: font,
color: EKColor(rgb: 0xFCFCFD),
alignment: .center
)
let labelContent = EKProperty.LabelContent(
text: text,
style: style
)

let contentView = EKNoteMessageView(with: labelContent)
contentView.verticalOffset = 10
SwiftEntryKit.display(entry: contentView, using: attributes)
}

func hideKeyboardWhenTappedAround() {
let tap = UITapGestureRecognizer(target: self, action: #selector(UIViewController.dismissKeyboard))
tap.cancelsTouchesInView = false
Expand Down

0 comments on commit a2b9ca0

Please sign in to comment.