I'm trying to create a wifi tress test by opening multiple URLs in succession in Xcode/Swift for iPad. It seems to open only the first successfully. The "sleep(x)" call makes no difference. Code snippet:
func counter()
{
seconds -= 1
label.text = String(seconds) + " Seconds"
if (seconds == 0)
{
let url1 = URL(string: "http://www.wix.com")!
let url2 = URL(string: "http://www.activistpost.com")!
let url3 = URL(string: "http://www.time.com")!
let url4 = URL(string: "http://www.steemit.com")!
let url5 = URL(string: "http://www.youtube.com")!
let url6 = URL(string: "http://www.cptts.net/61m.jpg")!
if #available(iOS 10.0, *) {
UIApplication.shared.open (url1)
sleep (5)
UIApplication.shared.open (url2)
sleep (5)
UIApplication.shared.open (url3)
sleep (5)
UIApplication.shared.open (url4)
sleep (5)
UIApplication.shared.open (url5)
sleep (5)
UIApplication.shared.open (url6)
} else {
// Fallback on earlier versions
}
Xcode 10.0 Beta 2