Preparing for growth.
This commit is contained in:
parent
d343ae2017
commit
9084669695
@ -22,6 +22,9 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0AA7BDD2230DA06D00EED90B /* MolecularModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA7BDD1230DA06D00EED90B /* MolecularModel.swift */; };
|
||||
0ADD8082231055F500A5E643 /* ObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ADD8081231055F500A5E643 /* ObjectParser.swift */; };
|
||||
0ADD8086231056FF00A5E643 /* ObjectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ADD8085231056FF00A5E643 /* ObjectCell.swift */; };
|
||||
0ADD80882310570A00A5E643 /* ArrayCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ADD80872310570A00A5E643 /* ArrayCell.swift */; };
|
||||
D2B1E3F322F4A68F0065F95C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3F222F4A68F0065F95C /* AppDelegate.swift */; };
|
||||
D2B1E3F522F4A68F0065F95C /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3F422F4A68F0065F95C /* MasterViewController.swift */; };
|
||||
D2B1E3F722F4A68F0065F95C /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3F622F4A68F0065F95C /* DetailViewController.swift */; };
|
||||
@ -55,6 +58,9 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0AA7BDD1230DA06D00EED90B /* MolecularModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MolecularModel.swift; sourceTree = "<group>"; };
|
||||
0ADD8081231055F500A5E643 /* ObjectParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjectParser.swift; sourceTree = "<group>"; };
|
||||
0ADD8085231056FF00A5E643 /* ObjectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjectCell.swift; sourceTree = "<group>"; };
|
||||
0ADD80872310570A00A5E643 /* ArrayCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayCell.swift; sourceTree = "<group>"; };
|
||||
D2B1E3EF22F4A68F0065F95C /* JSONCreator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JSONCreator.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D2B1E3F222F4A68F0065F95C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
D2B1E3F422F4A68F0065F95C /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = "<group>"; };
|
||||
@ -91,6 +97,15 @@
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0ADD8084231056B500A5E643 /* Table Cells */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0ADD8085231056FF00A5E643 /* ObjectCell.swift */,
|
||||
0ADD80872310570A00A5E643 /* ArrayCell.swift */,
|
||||
);
|
||||
path = "Table Cells";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D2B1E3E622F4A68F0065F95C = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -111,10 +126,12 @@
|
||||
D2B1E3F122F4A68F0065F95C /* JSONCreator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0ADD8084231056B500A5E643 /* Table Cells */,
|
||||
0AA7BDD0230DA05600EED90B /* Models */,
|
||||
D2B1E3F222F4A68F0065F95C /* AppDelegate.swift */,
|
||||
D2B1E3F422F4A68F0065F95C /* MasterViewController.swift */,
|
||||
D2B1E3F622F4A68F0065F95C /* DetailViewController.swift */,
|
||||
0ADD8081231055F500A5E643 /* ObjectParser.swift */,
|
||||
D2B1E3F822F4A68F0065F95C /* Main.storyboard */,
|
||||
D2B1E3FB22F4A6930065F95C /* Assets.xcassets */,
|
||||
D2B1E40922F4C9F00065F95C /* JSON */,
|
||||
@ -234,7 +251,10 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
0AA7BDD2230DA06D00EED90B /* MolecularModel.swift in Sources */,
|
||||
0ADD80882310570A00A5E643 /* ArrayCell.swift in Sources */,
|
||||
D2B1E3F722F4A68F0065F95C /* DetailViewController.swift in Sources */,
|
||||
0ADD8086231056FF00A5E643 /* ObjectCell.swift in Sources */,
|
||||
0ADD8082231055F500A5E643 /* ObjectParser.swift in Sources */,
|
||||
D2B1E3F522F4A68F0065F95C /* MasterViewController.swift in Sources */,
|
||||
D2B1E3F322F4A68F0065F95C /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
|
||||
@ -12,10 +12,17 @@ import MVMCoreUI
|
||||
|
||||
class DetailViewController: UIViewController {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
// MARK: - Outlets
|
||||
//--------------------------------------------------
|
||||
|
||||
let textView = UITextView(frame: .zero)
|
||||
let tableView = UITableView(frame: .zero, style: .plain)
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
var objectifiedJSON: [Any] = []
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Lifecycle
|
||||
@ -26,6 +33,31 @@ class DetailViewController: UIViewController {
|
||||
|
||||
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
|
||||
@ -34,24 +66,24 @@ class DetailViewController: UIViewController {
|
||||
|
||||
view.addSubview(textView)
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
textView.font = UIFont.systemFont(ofSize: 20)
|
||||
} else {
|
||||
textView.font = UIFont.systemFont(ofSize: 14)
|
||||
}
|
||||
|
||||
textView.font = UIFont.systemFont(ofSize: UIDevice.current.userInterfaceIdiom == .pad ? 20 : 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
|
||||
}
|
||||
|
||||
private func setupNavigationMenu() {
|
||||
|
||||
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))
|
||||
let altButton = UIBarButtonItem(barButtonSystemItem: .bookmarks, target: self, action: #selector(clearTextView))
|
||||
let objectViewButton = UIBarButtonItem(barButtonSystemItem: .bookmarks, target: self, action: #selector(objectView))
|
||||
let refreshButton = UIBarButtonItem(barButtonSystemItem: .refresh, target: self, action: #selector(refreshJSON))
|
||||
|
||||
navigationItem.setRightBarButtonItems([altButton, clearButton, shareButton, buildButton], animated: true)
|
||||
navigationItem.setLeftBarButtonItems([clearButton, objectViewButton], animated: true)
|
||||
navigationItem.setRightBarButtonItems([buildButton, shareButton, refreshButton], animated: true)
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -112,6 +144,14 @@ class DetailViewController: UIViewController {
|
||||
|
||||
MVMCoreNavigationHandler.shared()?.dismissTopViewController(animated: true)
|
||||
}
|
||||
|
||||
@objc func objectView() {
|
||||
|
||||
}
|
||||
|
||||
@objc func refreshJSON() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// MARK:- TextView Delegate
|
||||
@ -160,3 +200,21 @@ extension DetailViewController: UITextDropDelegate {
|
||||
// Nothing for now....
|
||||
}
|
||||
}
|
||||
|
||||
extension DetailViewController: UITableViewDelegate, UITableViewDataSource {
|
||||
|
||||
func numberOfSections(in tableView: UITableView) -> Int {
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
|
||||
return objectifiedJSON.count
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
|
||||
return UITableViewCell()
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ class MasterViewController: UIViewController, UITableViewDelegate, UITableViewDa
|
||||
|
||||
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
|
||||
|
||||
return molecularModels[section].category
|
||||
return molecularModels[section].category.capitalized
|
||||
}
|
||||
|
||||
func numberOfSections(in tableView: UITableView) -> Int {
|
||||
|
||||
15
JSONCreator_iOS/JSONCreator/ObjectParser.swift
Normal file
15
JSONCreator_iOS/JSONCreator/ObjectParser.swift
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// ObjectParser.swift
|
||||
// JSONCreator
|
||||
//
|
||||
// Created by Kevin Christiano on 8/23/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
class ObjectParser {
|
||||
|
||||
|
||||
}
|
||||
27
JSONCreator_iOS/JSONCreator/Table Cells/ArrayCell.swift
Normal file
27
JSONCreator_iOS/JSONCreator/Table Cells/ArrayCell.swift
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// ArrayCell.swift
|
||||
// JSONCreator
|
||||
//
|
||||
// Created by Kevin Christiano on 8/23/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ArrayCell: UITableViewCell {
|
||||
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
}
|
||||
27
JSONCreator_iOS/JSONCreator/Table Cells/ObjectCell.swift
Normal file
27
JSONCreator_iOS/JSONCreator/Table Cells/ObjectCell.swift
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// ObjectCell.swift
|
||||
// JSONCreator
|
||||
//
|
||||
// Created by Kevin Christiano on 8/23/19.
|
||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class ObjectCell: UITableViewCell {
|
||||
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user