Skip to content

Instantly share code, notes, and snippets.

@abdulowork
Created April 5, 2017 11:49
Show Gist options
  • Save abdulowork/9257d3f731d076ebe80c1e3b77712d9a to your computer and use it in GitHub Desktop.
Save abdulowork/9257d3f731d076ebe80c1e3b77712d9a to your computer and use it in GitHub Desktop.
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class ObjcClass: NSObject {
func thisMethodWillBeEnqueuedToRunLoop() {
print("I am executed")
}
}
print("I am on \(Thread.current)")
print(1)
ObjcClass().performSelector(onMainThread: #selector(ObjcClass.thisMethodWillBeEnqueuedToRunLoop), with: nil, waitUntilDone: false)
print(2)
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment