diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index e12a4090..49c0c2e0 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -25,7 +25,7 @@ import SwiftyJSON class ViewController: UITableViewController { - var json: JSON = JSON.null + var json: JSON = .null // MARK: - Table view data source @@ -78,7 +78,7 @@ class ViewController: UITableViewController { if let indexPath = self.tableView.indexPathForSelectedRow { let row = (indexPath as NSIndexPath).row - var nextJson: JSON = JSON.null + var nextJson: JSON = .null switch self.json.type { case .array: nextJson = self.json[row] diff --git a/Source/SwiftyJSON.swift b/Source/SwiftyJSON.swift index 5d10d44b..4a748a0c 100644 --- a/Source/SwiftyJSON.swift +++ b/Source/SwiftyJSON.swift @@ -525,7 +525,7 @@ extension JSON: Swift.ExpressibleByArrayLiteral { extension JSON: Swift.ExpressibleByNilLiteral { - @available(*, deprecated, message: "use JSON.null instead. Will be removed in future versions") + @available(*, deprecated, message: "https://git.io/vPlHM Use JSON.null if you want to create or compare null value. If you need optional JSON variable use Optional.none instead of nil") public init(nilLiteral: ()) { self.init(NSNull() as Any) } diff --git a/Tests/BaseTests.swift b/Tests/BaseTests.swift index 0ec670ed..9a53eed8 100644 --- a/Tests/BaseTests.swift +++ b/Tests/BaseTests.swift @@ -201,7 +201,7 @@ class BaseTests: XCTestCase { func testNullJSON() { XCTAssertEqual(JSON(NSNull()).debugDescription,"null") - let json:JSON = JSON.null + let json:JSON = .null XCTAssertEqual(json.debugDescription,"null") XCTAssertNil(json.error) let json1:JSON = JSON(NSNull()) diff --git a/Tests/ComparableTests.swift b/Tests/ComparableTests.swift index c027b07a..3194e239 100644 --- a/Tests/ComparableTests.swift +++ b/Tests/ComparableTests.swift @@ -297,7 +297,7 @@ class ComparableTests: XCTestCase { } func testNil() { - let jsonL1:JSON = JSON.null + let jsonL1:JSON = .null let jsonR1:JSON = JSON(NSNull()) XCTAssertEqual(jsonL1, jsonR1) XCTAssertTrue(jsonL1 != "123") diff --git a/Tests/LiteralConvertibleTests.swift b/Tests/LiteralConvertibleTests.swift index c55f2516..765c7c3e 100644 --- a/Tests/LiteralConvertibleTests.swift +++ b/Tests/LiteralConvertibleTests.swift @@ -51,7 +51,7 @@ class LiteralConvertibleTests: XCTestCase { } func testNil() { - let jsonNil_1:JSON = JSON.null + let jsonNil_1:JSON = .null XCTAssert(jsonNil_1 == JSON.null) let jsonNil_2:JSON = JSON(NSNull.self) XCTAssert(jsonNil_2 != JSON.null) diff --git a/Tests/PrintableTests.swift b/Tests/PrintableTests.swift index 5672c13a..708250b7 100644 --- a/Tests/PrintableTests.swift +++ b/Tests/PrintableTests.swift @@ -46,7 +46,7 @@ class PrintableTests: XCTestCase { } func testNil() { - let jsonNil_1:JSON = JSON.null + let jsonNil_1:JSON = .null XCTAssertEqual(jsonNil_1.description, "null") XCTAssertEqual(jsonNil_1.debugDescription, "null") let jsonNil_2:JSON = JSON(NSNull()) diff --git a/Tests/RawTests.swift b/Tests/RawTests.swift index a31b84ef..755f326d 100644 --- a/Tests/RawTests.swift +++ b/Tests/RawTests.swift @@ -92,7 +92,7 @@ class RawTests: XCTestCase { } func testNull() { - let json:JSON = JSON.null + let json:JSON = .null print(json.rawString()) XCTAssertTrue(json.rawString() == "null") }