move project location, fix textview capitalization
This commit is contained in:
parent
775139401a
commit
faf98a135d
4
JSONCreator.xcworkspace/contents.xcworkspacedata
generated
4
JSONCreator.xcworkspace/contents.xcworkspacedata
generated
@ -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">
|
||||||
|
|||||||
@ -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")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user