From faf98a135dc349b55e4ba235426497ed863bee3f Mon Sep 17 00:00:00 2001 From: panxi Date: Mon, 25 Nov 2019 11:42:38 -0500 Subject: [PATCH 1/3] move project location, fix textview capitalization --- JSONCreator.xcworkspace/contents.xcworkspacedata | 4 ++-- JSONCreator_iOS/JSONCreator/DetailViewController.swift | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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") From 4d0e3b651ee8c9c310328ef23cb734c3d12d9884 Mon Sep 17 00:00:00 2001 From: panxi Date: Mon, 25 Nov 2019 11:45:01 -0500 Subject: [PATCH 2/3] remove test code --- JSONCreator_iOS/JSONCreator/DetailViewController.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/JSONCreator_iOS/JSONCreator/DetailViewController.swift b/JSONCreator_iOS/JSONCreator/DetailViewController.swift index 59f8ce5..d9705bb 100644 --- a/JSONCreator_iOS/JSONCreator/DetailViewController.swift +++ b/JSONCreator_iOS/JSONCreator/DetailViewController.swift @@ -57,9 +57,7 @@ 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") From f973b442c9b3777c087a8d213d6b45a96b2bf43c Mon Sep 17 00:00:00 2001 From: panxi Date: Tue, 26 Nov 2019 13:25:37 -0500 Subject: [PATCH 3/3] update --- JSONCreator_iOS/JSONCreator/AppDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JSONCreator_iOS/JSONCreator/AppDelegate.swift b/JSONCreator_iOS/JSONCreator/AppDelegate.swift index 364d09f..d9fe595 100644 --- a/JSONCreator_iOS/JSONCreator/AppDelegate.swift +++ b/JSONCreator_iOS/JSONCreator/AppDelegate.swift @@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Setup our core object with the default implementation - MVMCoreUIObject.sharedInstance()?.defaultInitialSetup() + CoreUIObject.sharedInstance()?.defaultInitialSetup() return true }