This commit is contained in:
Kevin G Christiano 2020-05-27 14:31:29 -04:00
parent 494b3f3535
commit 7b5113cf45

View File

@ -30,39 +30,13 @@ class DetailViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
guard textView.superview == nil else {
return
}
guard textView.superview == nil else { return }
title = "Raw JSON"
setupNavigationMenu()
setupTextView()
// setupTable()
}
private func setupTable() {
tableView.delegate = self
tableView.dataSource = self
tableView.register(ObjectCell.self, forCellReuseIdentifier: String(describing: ObjectCell.self))
tableView.register(ArrayCell.self, forCellReuseIdentifier: String(describing: ArrayCell.self))
view.addSubview(tableView)
tableView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
view.trailingAnchor.constraint(equalTo: tableView.trailingAnchor).isActive = true
view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: tableView.bottomAnchor).isActive = true
}
private func setupTextView() {
textView.textDropDelegate = self
textView.delegate = self
textView.smartDashesType = .no
textView.smartQuotesType = .no
textView.smartInsertDeleteType = .no
modalPresentationStyle = .formSheet
MVMCoreNavigationHandler.shared()?.viewControllerToPresentOn = self
view.addSubview(textView)
@ -72,6 +46,11 @@ class DetailViewController: UIViewController {
textView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
view.trailingAnchor.constraint(equalTo: textView.trailingAnchor).isActive = true
view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: textView.bottomAnchor).isActive = true
textView.delegate = self
textView.smartDashesType = .no
textView.smartQuotesType = .no
textView.smartInsertDeleteType = .no
textView.autocapitalizationType = .none
}
private func setupNavigationMenu() {