How to return a Range of Int in Swift? -


how can return range of int function in swift? i've searched swift 2.1 docs, web, so, , tried:

func myfunc() -> range { // } func myfunc() -> ( int ... int ) { // } func myfunc() -> range< int >  { // } 

... , many others ...

sorry being bone-headed here, , in advance!

your third 1 correct. compiles , works, example:

func oneto10() -> range<int> {     return 1...10  }   

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -