Skip to content

Commit dd417aa

Browse files
committed
Added dynamicMemberLookup
1 parent 37b480c commit dd417aa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Iatheto/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>2.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Iatheto/JSON.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Foundation
2424
most cases, however, `Decimal` better preserves numbers than
2525
`Float` or `Double`.
2626
*/
27+
@dynamicMemberLookup
2728
public enum JSON: Codable, Equatable {
2829
/// Represents a JSON `null`.
2930
case null
@@ -64,6 +65,10 @@ public enum JSON: Codable, Equatable {
6465
try self.init(parsing: string.data(using: .utf8, allowLossyConversion: false)!)
6566
}
6667

68+
public subscript(dynamicMember member: String) -> JSON? {
69+
return self[member]
70+
}
71+
6772
/**
6873
Encodes the current instance into JSON returned as `Data`.
6974

0 commit comments

Comments
 (0)