Created
August 6, 2016 21:24
-
-
Save pixelspark/bc39f437ef5b306a0d3155e01f93fd3a to your computer and use it in GitHub Desktop.
This file contains 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
public func assertMainThread(_ file: StaticString = #file, line: UInt = #line) { | |
assert(Thread.isMainThread, "Code at \(file):\(line) must run on main thread!") | |
} | |
public func asyncMain(_ block: () -> ()) { | |
DispatchQueue.main.async(execute: block) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment