Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Move to generic subscripts in Swift 4 #23

Open
lucianomarisi opened this issue May 14, 2017 · 2 comments
Open

Move to generic subscripts in Swift 4 #23

lucianomarisi opened this issue May 14, 2017 · 2 comments

Comments

@lucianomarisi
Copy link
Owner

lucianomarisi commented May 14, 2017

Since now generic subscripts have been introduced I think we should be aiming to move the API to them as this cleaner and simpler. For example:

let jsonDictionary: [String: Any] = ...
let value: String? = jsonDictionary[keyPath: "data.name"]

Would replace:

let jsonDictionary: [String: Any] = ...
let value: String? = jsonDictionary.json(atKeyPath: "data.name")
@Jon889
Copy link
Collaborator

Jon889 commented Dec 10, 2017

Unfortunately subscripts can't throw yet :/

@lucianomarisi
Copy link
Owner Author

That's a shame, I was hoping this feature would be introduced Swift 4, maybe next year.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants