Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct DailyShoping {
- var info:[String:Any] = ["Apple":100,"Oranage":130,"banana":90,"Water Milan":"Gift"]
- subscript (key:String) -> Any {
- get {
- if let newValue = info[key] {
- return newValue
- } else {
- return 0
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment