How To Get Info About Current Thread In Swift

It’s sometimes useful when you need to know for debugging purposes which current thread is in usage.

If you need to know only inside logs info about a current thread you can use


You don’t need to import anything, you can use it in every place.

You’ll get the number and name. 1 and the main are for UI thread and the rest is for background threads.

If you need more info about a thread you can find their information like

Is it the main thread


Is it canceled