Simply constrain your views to the TextContainerLayoutGuide's anchors.
footerView.topAnchor.constraint(equalTo: textView.textContainerLayoutGuide.bottomAnchor).isActive = true
Place view in footer of UITextView
TextContainerLayoutGuide is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'TextContainerLayoutGuide'
github "noppefoxwolf/TextContainerLayoutGuide"
noppefoxwolf, noppelabs@gmail.com
TextContainerLayoutGuide is available under the MIT license. See the LICENSE file for more info.