New stuff.
This commit is contained in:
parent
27202e83b7
commit
d343ae2017
22
JSONCreator_iOS/JSONCreator/Assets.xcassets/alternate.imageset/Contents.json
vendored
Normal file
22
JSONCreator_iOS/JSONCreator/Assets.xcassets/alternate.imageset/Contents.json
vendored
Normal 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"
|
||||
}
|
||||
}
|
||||
BIN
JSONCreator_iOS/JSONCreator/Assets.xcassets/alternate.imageset/icons8-flip-vertical-100.png
vendored
Normal file
BIN
JSONCreator_iOS/JSONCreator/Assets.xcassets/alternate.imageset/icons8-flip-vertical-100.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 947 B |
BIN
JSONCreator_iOS/JSONCreator/Assets.xcassets/alternate.imageset/icons8-flip-vertical-50.png
vendored
Normal file
BIN
JSONCreator_iOS/JSONCreator/Assets.xcassets/alternate.imageset/icons8-flip-vertical-50.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 539 B |
@ -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 = ""
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user