ios - swift convert Range<Int> to [Int] -


how convert range array

i tried:

let min = 50 let max = 100 let intarray:[int] = (min...max) 

get error range<int> not convertible [int]

i tried:

let intarray:[int] = [min...max] 

and

let intarray:[int] = (min...max) [int]  

they don't work either.

you need create array<int> using range<int> rather cast it.

let intarray: [int] = array(min...max) 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -