diff --git a/JSONCreator.xcworkspace/contents.xcworkspacedata b/JSONCreator.xcworkspace/contents.xcworkspacedata index 8a88220..21fc6d2 100644 --- a/JSONCreator.xcworkspace/contents.xcworkspacedata +++ b/JSONCreator.xcworkspace/contents.xcworkspacedata @@ -2,10 +2,10 @@ + location = "group:mvm_core/MVMCore/MVMCore.xcodeproj"> + location = "group:mvm_core_ui/MVMCoreUI.xcodeproj"> diff --git a/JSONCreator_iOS/JSONCreator/DetailViewController.swift b/JSONCreator_iOS/JSONCreator/DetailViewController.swift index 09f818b..59f8ce5 100644 --- a/JSONCreator_iOS/JSONCreator/DetailViewController.swift +++ b/JSONCreator_iOS/JSONCreator/DetailViewController.swift @@ -34,6 +34,7 @@ class DetailViewController: UIViewController { textView.smartDashesType = .no textView.smartQuotesType = .no textView.smartInsertDeleteType = .no + textView.autocapitalizationType = .none let shareButton = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareButtonPressed)) let buildButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(play)) @@ -56,7 +57,9 @@ class DetailViewController: UIViewController { @objc func play() { do { + let decoder = JSONDecoder() 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 pageType = page?.optionalStringForKey(KeyPageType) let template = page?.optionalStringForKey("template")