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' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -