Posted By

chrisaiv on 10/21/16


Tagged

c objective swift


Versions (?)

Swift: Get Random Boolean


 / Published in: Objective C
 

This function will help you get a random true or false boolean value.

  1. func randomBool() -> Bool {
  2. return arc4random_uniform(2) == 0 ? true : false
  3. }

Report this snippet  

You need to login to post a comment.