Skip to content

Instantly share code, notes, and snippets.

@RyanBreaker
Created August 22, 2015 23:00
Show Gist options
  • Save RyanBreaker/6cbb9e4f286fa57a9fb2 to your computer and use it in GitHub Desktop.
Save RyanBreaker/6cbb9e4f286fa57a9fb2 to your computer and use it in GitHub Desktop.
import UIKit
class TableCell : UITableViewCell {
private(set) var textField: UITextField? = nil
override var textLabel: UILabel? { get {
return nil
}}
private func addTextField() {
textField = UITextField(frame: layer.bounds)
contentView.addSubview(textField!)
}
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
addTextField()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
addTextField()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment