func hoge() -> Any {
return ["name": "aaa", "age": 10]
}
var d = hoge()
print(d)
// ワンライナーで値取得
(d as! [String: Any])["name"] //=> "aaa"
// Anyなやつがホントは何か知る方法のイディオム(get class name)
String(describing: type(of: d)) //=> "Dictionary<String, Any>"
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
11