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

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -