Created
June 27, 2023 21:01
-
-
Save xmhafiz/90fc7c80c6005e9ea1dc159ed7409731 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BottomSheetViewController: UIViewController { | |
// ... | |
// sub-class of this view controller will call this function to set a content | |
func setContent(content: UIView) { | |
contentView.addSubview(content) | |
NSLayoutConstraint.activate([ | |
content.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), | |
content.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), | |
content.topAnchor.constraint(equalTo: contentView.topAnchor), | |
content.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) | |
]) | |
view.layoutIfNeeded() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment