New stuff.

This commit is contained in:
Kevin G Christiano 2019-08-22 11:18:50 -04:00
parent 27202e83b7
commit d343ae2017
5 changed files with 48 additions and 18 deletions

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icons8-flip-vertical-50.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icons8-flip-vertical-100.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

View File

@ -27,27 +27,31 @@ class DetailViewController: UIViewController {
guard textView.superview == nil else { return }
textView.textDropDelegate = self
view.addSubview(textView)
if UIDevice.current.userInterfaceIdiom == .pad {
textView.font = UIFont.systemFont(ofSize: 20)
} else {
textView.font = UIFont.systemFont(ofSize: 14)
}
textView.translatesAutoresizingMaskIntoConstraints = false
textView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
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
view.addSubview(textView)
if UIDevice.current.userInterfaceIdiom == .pad {
textView.font = UIFont.systemFont(ofSize: 20)
} else {
textView.font = UIFont.systemFont(ofSize: 14)
}
textView.translatesAutoresizingMaskIntoConstraints = false
textView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
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
let shareButton = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareButtonPressed))
let buildButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(play))
let clearButton = UIBarButtonItem(barButtonSystemItem: .trash, target: self, action: #selector(clearTextView))
navigationItem.setRightBarButtonItems([clearButton, shareButton, buildButton], animated: true)
let altButton = UIBarButtonItem(barButtonSystemItem: .bookmarks, target: self, action: #selector(clearTextView))
navigationItem.setRightBarButtonItems([altButton, clearButton, shareButton, buildButton], animated: true)
}
//--------------------------------------------------
@ -61,6 +65,10 @@ class DetailViewController: UIViewController {
present(alert, animated: true, completion: nil)
}
//--------------------------------------------------
// MARK: - Actions
//--------------------------------------------------
@objc func shareButtonPressed() {
if let text = textView.text {
@ -71,6 +79,7 @@ class DetailViewController: UIViewController {
}
@objc func clearTextView() {
textView.text = ""
}

View File

@ -6,7 +6,6 @@
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import UIKit
import MVMCore
@ -69,10 +68,10 @@ class MasterViewController: UIViewController, UITableViewDelegate, UITableViewDa
func getData(for indexPath: IndexPath) -> String? {
let subDictionary = molecularModels[indexPath.section].molecules[indexPath.row] as! [String: Any]
let bb = subDictionary.keys.first!
let val = subDictionary[bb]
guard let subDictionary = molecularModels[indexPath.section].molecules[indexPath.row] as? [String: Any],
let bb = subDictionary.keys.first,
let val = subDictionary[bb]
else { return nil }
var json: String = ""
do {