Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Anthia Tillbury
Anthia Tillbury
3,388 Points

Why is randomisation not in Foundation?

Why, when attempting to randomise a number, is it the GameKit framework that contains that function, rather than say Foundation?

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Anthia,

Honestly, there is no real answer to that questions other than it is just what the Developers chose to do with the language as it was being designed. but, if I had to guess at their reasoning, I would say it would be because gaming would need a randomizer the most out of any type of app development, so putting it in GameKit seems to make the most sense.
But, like I said, when the language was being designed, that placement was the decision they made.

:) :dizzy:

Anthia Tillbury
Anthia Tillbury
3,388 Points

I suppose, one of those things.

I noticed in the documentation that Generating Random Numbers (OSX/iOS) leads down a cryptographic path:

https://developer.apple.com/documentation/security/randomization_services

It seems like a bit of a jump.