sharedRandom always giving me 0

In my AppDelegate, I'm picking a seed like this on my physical iPad Pro:


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

// Override point for customization after application launch.

sysRandom = GKRandomSource.sharedRandom()

randDist0 = GKRandomDistribution(randomSource: sysRandom!, lowestValue: 0, highestValue: 0xffffffff)

let _ = randDist0!.nextInt()

let toss = randDist0!.nextInt()

print("App Seed: \(toss)")

appSeed0 = toss


I keep getting a seed of 0, so I'm clearly not understanding something. The shared random source on my iPad should be giving me a random value, right? I was tossing twice just to be sure... What am I doing wrong here?

Replies

I think this gameaps must to be reimaging on code faster 🙂


pakar seo | jasa seo | kursus seo online | kursus adsense online

i hope this gameapps become popular. We will support u forever.