How to program a delay in Swift 3?
Hello everyone! I just started learning Swift 3 and can't figure out how to create a delay in the code. I need that after clicking a button, after 2 seconds some action is performed (for example, hide a UILabel).\n\nEarlier I saw that in Swift 2 `dispatch_after` was used, but in Swift 3 this syntax seems to have changed. I tried to write like this:\n\n```swift\ndispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(2 * NSEC_PER_SEC)), dispatch_get_main_queue()) {\n // my code\n}\n```\n\nBut Xcode gives an error: `'dispatch_after' is unavailable: Use DispatchQueue.main.asyncAfter`. I understand that I need to use something else, but the documentation seems complicated for a beginner.\n\nPlease tell me how to properly create a delay in Swift 3? Preferably with a simple example so that I