K
K
KVS172016-01-15 09:57:40
Swift
KVS17, 2016-01-15 09:57:40

How to get the value of an element in Swift?

There is a variable structure
struct Param {
let total_item_id: Int
}
There is an element value
perametr1
▿ 1 elements
▿ [0] : Param
- total_item_id : 60
I write like this: let param2 = (perametr1["total_item_id"] as? NSInteger).stringValue
How to get the value 60 in string form? (I can’t figure it out for 2 hours already)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
ManWithBear, 2016-01-15
@KVS17

String(parameter1.total_item_id)
Ps in swift is preferable to camelCase for titles

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question