Skip to content

Instantly share code, notes, and snippets.

@yusufozgul
Created February 28, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yusufozgul/9f0c77c1c5bd707c5d45be42b1b71bc6 to your computer and use it in GitHub Desktop.
Save yusufozgul/9f0c77c1c5bd707c5d45be42b1b71bc6 to your computer and use it in GitHub Desktop.
import UIKit
class DetailViewController: UIViewController
{
var selectedText: String?
override func viewDidLoad() {
super.viewDidLoad()
let label = UILabel()
label.text = "Selected Row: \(selectedText ?? "NO TEXT")"
label.sizeToFit()
label.center = view.center
self.view.addSubview(label)
self.view.backgroundColor = .systemBackground
}
init(selectedText: String) {
super.init(nibName: nil, bundle: nil)
self.selectedText = selectedText
}
required init?(coder: NSCoder) {
fatalError("Error")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment