 
     }
 
+    func bottomSpacingForCurrentLayout() -> CGFloat {
+
+        let bottomInset: CGFloat
+
+        if #available(iOS 11.0, *) {
+            let safeBottomInset = view.safeAreaInsets.bottom
+            bottomInset = safeBottomInset > 0 ? safeBottomInset : 12
+        } else {
+            bottomInset = 12
+        }
+
+        return -bottomInset
+
+    }
+
+    override func viewSafeAreaInsetsDidChange() {
+        containerBottomConstraint.constant = bottomSpacingForCurrentLayout()
+    }
+
     // MARK: - Touch Events
 
     @objc private func handleTap(recognizer: UITapGestureRecognizer) {

    // MARK: - Private Interface Elements

    private let contentView = UIView()

    private var leadingConstraint: NSLayoutConstraint!
    private var trailingConstraint: NSLayoutConstraint!

        maxWidthConstraint.priority = .required
        maxWidthConstraint.isActive = true

        containerBottomConstraint = contentView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
        containerBottomConstraint.isActive = true
        containerBottomConstraint.constant = bottomSpacingForCurrentLayout()

        // Content Stack View

