'evaluate js expression in swift

How to get expression output for given string expression from object. eg:

given
    let expression = "$.name"
    let obj = ["name": "abc", "date": "20-Apr"]
    
    exprected output = "abc"


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source