-3

From here I'm trying to grab speed data from the class, but I cannot figure how.

Let's say I have a class SpeedTest; in MyViewController I instantiate:

let mySpeedTest = SpeedTest()

starting test

mySpeedTest.startSpeedTest(usedVC: self)

now, how do I grab the result in my MyViewController?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
biggreentree
  • 1,633
  • 3
  • 20
  • 35

1 Answers1

-1

You need

mySpeedTest.checkForSpeedTest()

mySpeedTest.speedTestCompletionBlock =  { [weak self] (megabytesPerSecond ,error)  in

    print(megabytesPerSecond)
}
Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87