Skip to content

Instantly share code, notes, and snippets.

Created January 31, 2018 15:55
What would you like to do?
Instantiating a custom UIView
import UIKit
// MARK: TestViewController
class TestViewController: UIViewController {
// MARK: Outlets
@IBOutlet var testView: TestView!
// MARK: View Methods
override func viewDidLoad() {
testView.delegate = self
// MARK: TestViewDelegate Methods
extension TestViewController: TestViewDelegate {
func testView(_ testView: TestView, didSelect button: UIButton) {
guard let buttonText = button.titleLabel?.text else {
print("\(buttonText) pressed")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment