Created
September 21, 2023 05:59
-
-
Save jarrodnorwell/227be30186f5ad2c5be0f2852410e8ab 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
let virtualControllerView = VirtualControllerView() | |
virtualControllerView.translatesAutoresizingMaskIntoConstraints = false | |
view.addSubview(virtualControllerView) | |
view.addConstraints([ | |
virtualControllerView.leadingAnchor.constraint(equalTo: view.leadingAnchor), | |
virtualControllerView.bottomAnchor.constraint(equalTo: view.bottomAnchor), | |
virtualControllerView.trailingAnchor.constraint(equalTo: view.trailingAnchor) | |
]) | |
virtualControllerView.addAButton { _ in | |
// used while user holds or when tapped (.touchDown) | |
} touchUpInside: { _ in | |
// used when user lets go (.touchUpInside) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment