@@ -49,12 +49,12 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
49
49
}
50
50
51
51
/**
52
- Validates and updates the textview.
52
+ Validates and updates the textview.
53
53
54
- - parameter pretty: If the JSON is to be pretty printed.
54
+ - parameter pretty: If the JSON is to be pretty printed.
55
55
56
- - returns: if the format was valid.
57
- */
56
+ - returns: if the format was valid.
57
+ */
58
58
func validateAndFormat( pretty: Bool ) -> Bool {
59
59
60
60
if textView? . string? . characters. count == 0 {
@@ -80,8 +80,8 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
80
80
}
81
81
82
82
/**
83
- Actual function that generates the model.
84
- */
83
+ Actual function that generates the model.
84
+ */
85
85
func generateModel( ) {
86
86
87
87
// The base class field is blank, cannot proceed without it. Possibly can have a default value in the future.
@@ -106,9 +106,9 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
106
106
107
107
let swiftyState = self . includeSwiftyCheckbox? . state == 1 ? true : false
108
108
let supportSwiftyState = self . supportSwiftyJSONCheckbox? . state == 1 ? true : false
109
-
109
+
110
110
let nscodingState = self . supportNSCodingCheckbox? . state == 1 ? true : false
111
-
111
+
112
112
let objectMapperState = self . includeObjectMapperCheckbox? . state == 1 ? true : false
113
113
let supportObjectMapperState = self . supportObjectMapperCheckbox? . state == 1 ? true : false
114
114
@@ -122,7 +122,7 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
122
122
}
123
123
124
124
@IBAction func recalcEnabledBoxes( sender: AnyObject ) {
125
-
125
+
126
126
let supportSwiftyState = self . supportSwiftyJSONCheckbox? . state == 1 ? true : false
127
127
let supportObjectMapperState = self . supportObjectMapperCheckbox? . state == 1 ? true : false
128
128
@@ -132,15 +132,15 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
132
132
else {
133
133
self . includeSwiftyCheckbox? . enabled = false
134
134
}
135
-
135
+
136
136
if supportObjectMapperState {
137
137
self . includeObjectMapperCheckbox? . enabled = true
138
138
}
139
139
else {
140
140
self . includeObjectMapperCheckbox? . enabled = false
141
141
}
142
142
}
143
-
143
+
144
144
// MARK: Internal Methods
145
145
146
146
/**
@@ -177,11 +177,11 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
177
177
}
178
178
179
179
/**
180
- Handle Error message that is provided by the JSON helper and extract the message and showing them accordingly.
180
+ Handle Error message that is provided by the JSON helper and extract the message and showing them accordingly.
181
181
182
- - parameters:
183
- - error: NSError that was provided.
184
- */
182
+ - parameters:
183
+ - error: NSError that was provided.
184
+ */
185
185
func handleError( error: NSError ? ) {
186
186
if let _ = error!. userInfo [ " debugDescription " ] as? String ? {
187
187
let message : String = error!. userInfo [ " NSDebugDescription " ] ! as! String
@@ -214,19 +214,19 @@ class SJEditorViewController: NSViewController, NSTextViewDelegate {
214
214
}
215
215
216
216
/**
217
- Show that the JSON is fine with proper icon.
218
- */
217
+ Show that the JSON is fine with proper icon.
218
+ */
219
219
func correctJSONMessage( ) {
220
220
errorImageView? . image = NSImage . init ( named: " success " )
221
221
messageLabel? . stringValue = " Valid JSON! "
222
222
}
223
223
224
224
/**
225
- Show the invalid JSON error with proper error and message.
225
+ Show the invalid JSON error with proper error and message.
226
226
227
- - parameters:
228
- - message: Error message that is to be shown.
229
- */
227
+ - parameters:
228
+ - message: Error message that is to be shown.
229
+ */
230
230
func invalidJSONError( message: String ) {
231
231
errorImageView? . image = NSImage . init ( named: " failure " )
232
232
messageLabel? . stringValue = message
0 commit comments