Skip to content

Instantly share code, notes, and snippets.

@PimCoumans
Created April 8, 2021 13:21
Show Gist options
  • Save PimCoumans/e6f959c094c8a3169d4c4f8e9f36df27 to your computer and use it in GitHub Desktop.
Save PimCoumans/e6f959c094c8a3169d4c4f8e9f36df27 to your computer and use it in GitHub Desktop.
import Foundation
extension CFRunLoop {
static func performNext(work: @escaping () -> Void) {
CFRunLoopPerformBlock(CFRunLoopGetMain(), CFRunLoopMode.defaultMode.rawValue, work)
}
}
@PimCoumans
Copy link
Author

Usage:

CFRunLoop.peformNext {
  /* Stuff you want to happen after autolayout is done or whatever */
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment