Created
January 26, 2019 00:41
-
-
Save DrBeta/ce19cfb2a816c7a08436d475472c34d9 to your computer and use it in GitHub Desktop.
This is a easy to use function that you can add to any swift code that waits for a time you specify in the "time" parameter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Dr.Beta | |
import Foundation | |
import UIKit | |
//Put the amount of seconds in the 'time' parameter. | |
func wait(time: UInt32) { | |
sleep(time) | |
} | |
//This line waits for 4 seconds | |
wait(time: 4) | |
//Now do whatever you want, in this case I print "It has been 4 seconds". | |
print("It has been 4 seconds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment