Created
May 11, 2017 09:13
-
-
Save chriswebb09/a1e800658f115414ce292639b9806dd1 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 MainView: UIView { | |
@IBOutlet private weak var myTextfield: UITextField! | |
@IBOutlet private weak var myButton: UIButton! | |
weak var delegate: MainViewDelegate? | |
override func layoutSubviews() { | |
super.layoutSubviews() | |
myButton.addTarget(self, action: #selector(buttonTap), for: .touchUpInside) | |
} | |
func buttonTap() { | |
guard let searchText = myTextfield.text else { return } | |
delegate?.searchButtonTappedWithTerm(with: searchText) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment