move project location, fix textview capitalization

This commit is contained in:
panxi 2019-11-25 11:42:38 -05:00
parent 775139401a
commit faf98a135d
2 changed files with 5 additions and 2 deletions

View File

@ -2,10 +2,10 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:mvm_core_ui/MVMCoreUI.xcodeproj"> location = "group:mvm_core/MVMCore/MVMCore.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:mvm_core/MVMCore/MVMCore.xcodeproj"> location = "group:mvm_core_ui/MVMCoreUI.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:JSONCreator_iOS/JSONCreator.xcodeproj"> location = "group:JSONCreator_iOS/JSONCreator.xcodeproj">

View File

@ -34,6 +34,7 @@ class DetailViewController: UIViewController {
textView.smartDashesType = .no textView.smartDashesType = .no
textView.smartQuotesType = .no textView.smartQuotesType = .no
textView.smartInsertDeleteType = .no textView.smartInsertDeleteType = .no
textView.autocapitalizationType = .none
let shareButton = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareButtonPressed)) let shareButton = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareButtonPressed))
let buildButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(play)) let buildButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(play))
@ -56,7 +57,9 @@ class DetailViewController: UIViewController {
@objc func play() { @objc func play() {
do { do {
let decoder = JSONDecoder()
if let data = textView.text.data(using: .utf8), let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [AnyHashable: Any] { if let data = textView.text.data(using: .utf8), let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [AnyHashable: Any] {
let pageModel = try decoder.decode(PageModel.self, from: data)
let page = jsonObject.optionalDictionaryForKey(KeyPage) let page = jsonObject.optionalDictionaryForKey(KeyPage)
let pageType = page?.optionalStringForKey(KeyPageType) let pageType = page?.optionalStringForKey(KeyPageType)
let template = page?.optionalStringForKey("template") let template = page?.optionalStringForKey("template")