     }
 
     // MARK: - Configuration Methods
+    override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
+
+        let safeInsets = self.view.layoutMargins
+        richTextView.textContainerInset = safeInsets
+        htmlTextView.textContainerInset = safeInsets
+    }
 
     private func configureConstraints() {
 

    
    func updateTitleHeight() {
        let referenceView: UIScrollView = editingMode == .richText ? richTextView : htmlTextView
        let layoutInsets = view.layoutMargins
        let insets = titleTextField.textContainerInset
        let sizeThatShouldFitTheContent = titleTextField.sizeThatFits(CGSize(width:view.frame.width - (insets.left + insets.right + layoutInsets.left + layoutInsets.right), height: CGFloat.greatestFiniteMagnitude))
        titleHeightConstraint.constant = max(sizeThatShouldFitTheContent.height, titleTextField.font!.lineHeight + insets.top + insets.bottom)

        var contentInset = referenceView.contentInset

        edgesForExtendedLayout = UIRectEdge()
        navigationController?.navigationBar.isTranslucent = false

        view.backgroundColor = .white
        view.addSubview(richTextView)
        view.addSubview(htmlTextView)
