Created
March 10, 2020 07:17
-
-
Save Cee/e6849b981aabef9d3ff568d847ec87d6 to your computer and use it in GitHub Desktop.
TextField Playground
This file contains 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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
class MyViewController : UIViewController { | |
override func loadView() { | |
let view = UIView() | |
view.backgroundColor = .white | |
let textField = UITextField() | |
textField.borderStyle = .roundedRect | |
textField.frame = CGRect(x: 150, y: 200, width: 200, height: 20) | |
textField.placeholder = "Test" | |
view.addSubview(textField) | |
self.view = view | |
textField.becomeFirstResponder() | |
} | |
} | |
// Present the view controller in the Live View window | |
PlaygroundPage.current.liveView = MyViewController() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment