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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -