Skip to content

Instantly share code, notes, and snippets.

@sTinGe

sTinGe/wrapper.swift

Last active Dec 21, 2019
Embed
What would you like to do?
// avoid ambiguous position by using wrapper
let wrapper = UIView()
let view = HeaderView()
view.translatesAutoresizingMaskIntoConstraints = false
wrapper.addSubview(view)
NSLayoutConstraint.activate([
view.leftAnchor.constraint(equalTo: wrapper.leftAnchor),
view.rightAnchor.constraint(equalTo: wrapper.rightAnchor),
view.topAnchor.constraint(equalTo: wrapper.topAnchor),
view.bottomAnchor.constraint(equalTo: wrapper.bottomAnchor),
])
tableView.tableFooterView = wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.