Your First iOS App - Part 17: Writing Methods | Ray Wenderlich Videos

Learn how to add multiple rounds into Bulls-Eye, and how to write your own methods along the way.

This is a companion discussion topic for the original entry at

Hey there! I’m trying to implement the random number code of

targetValue = Int.random(in: 1...100)

but I get an error that says “Type Int has no member ‘random’.” Just revert back to arc4random?
Thank you :slight_smile:

@klyndon Be sure you’re using Xcode 10 - you can download the latest beta at Develop - Apple Developer.

1 Like

In case somebody new to the IOS/Xcode ecosystem starts seeing this problem, I am updating this comment. Basically, if you find that by having animations True for the UIAlertController things take forever to respond or if you turn that off and still find that using the Hit Me button back to back means you need to wait a long time, check your Simulator Debug settings and turn off Slow Animations… why is that on in the first place. Not sure. Slow Animations

@fergjo00 Thank you for sharing your solution - much appreciated! :]