You need to create an Array<Int>
using the Range<Int>
rather than casting it.
let intArray: [Int] = Array(min...max)
Put the Range in the init.
let intArray = [Int](min...max)
I figured it out:
let intArray = [Int](min...max)
Giving credit to someone else.
do:
let intArray = Array(min...max)
This should work because Array
has an initializer taking a SequenceType
and Range
conforms to SequenceType
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With