Skip to content

Commit

Permalink
Merge pull request #14 from donggyushin/develop
Browse files Browse the repository at this point in the history
[Release] v1.0.5
  • Loading branch information
donggyushin authored Jan 23, 2022
2 parents c9399d6 + f3e16d8 commit 8b23d2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DGSnackBar.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'DGSnackBar'
s.version = '1.0.4'
s.version = '1.0.5'
s.summary = 'SnackBar that responds to the keyboard and shows a message at the bottom of the screen.'
s.homepage = 'https://github.com/donggyushin/DGSnackBar'
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
Expand Down
8 changes: 5 additions & 3 deletions Sources/DGSnackBar/DGSnackBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public class DGSnackBar {
window.subviews.compactMap({ $0 as? SnackBarView }).forEach({ $0.hideFading() })
window.addSubview(snackBarView)
snackBarView.translatesAutoresizingMaskIntoConstraints = false
snackBarView.bottomAnchor.constraint(equalTo: window.safeAreaLayoutGuide.bottomAnchor, constant: -10 - keyboardHeight).isActive = true
snackBarView.leftAnchor.constraint(equalTo: window.leftAnchor, constant: 20).isActive = true
snackBarView.rightAnchor.constraint(equalTo: window.rightAnchor, constant: -20).isActive = true
NSLayoutConstraint.activate([
snackBarView.bottomAnchor.constraint(equalTo: window.safeAreaLayoutGuide.bottomAnchor, constant: -10 - keyboardHeight),
snackBarView.leftAnchor.constraint(equalTo: window.leftAnchor, constant: 20),
snackBarView.rightAnchor.constraint(equalTo: window.rightAnchor, constant: -20)
])
}

@objc private func keyboardWillHide(_ notification: Notification) {
Expand Down

0 comments on commit 8b23d2c

Please sign in to comment.