Skip to content

Instantly share code, notes, and snippets.

@manucodin
Created October 4, 2022 08:19
Show Gist options
  • Save manucodin/5d9e3d7365eca2631ea7fd07a70697f8 to your computer and use it in GitHub Desktop.
Save manucodin/5d9e3d7365eca2631ea7fd07a70697f8 to your computer and use it in GitHub Desktop.
func addLookAroundController(lookAroundController: UIViewController) {
view.addSubview(lookAroundController.view)
lookAroundController.view.translatesAutoresizingMaskIntoConstraints = false
lookAroundController.view.heightAnchor.constraint(equalToConstant: 90).isActive = true
lookAroundController.view.widthAnchor.constraint(equalToConstant: 130).isActive = true
lookAroundController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 16).isActive = true
lookAroundController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16).isActive = true
addChild(lookAroundController)
lookAroundController.didMove(toParent: self)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment