pardipbhatti8791
2/2/2016 - 5:33 PM

how to generate random number in swift ?

how to generate random number in swift ?


//  Use Below Code To Generate Random Number In Swift

func getRandomNumber() -> String {
        let randomNumber = GKRandomSource.
        sharedRandom().nextIntWithUpperBound(10)   // 10 Means it will generate number between 0 to 10 
    }