[swift-users] Is there method indiicate current thread is mainthread in swift?

Jose Cheyo Jimenez cheyo at masters3d.com
Wed Jul 13 09:25:27 CDT 2016


Oh, I think foundation on Linux is not up to date yet. 

> On Jul 13, 2016, at 1:12 AM, qi bo <qibo_cn at outlook.com> wrote:
> 
> my swift is 2016-05-09-a-ubuntu14.04.
> import Foundation
> if Thread.isMainThread {
> ...
> }
> but unresolved identifier "Thread" occur
> 
> 
> 
> On Wed, Jul 13, 2016 at 3:41 PM +0800, "Jose Cheyo Jimenez" <cheyo at masters3d.com> wrote:
> 
> //swift 2.2+
> NSThread.isMainThread()
> 
> //swift 3+
> Thread.isMainThread
> 
> 
>> On Jul 13, 2016, at 12:27 AM, qi bo via swift-users <swift-users at swift.org> wrote:
>> 
>> isMainThread is an method in object-c. how to indicate current thread is main thread?
>> 
>> thank you
>> Bob
>> 
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160713/8582ca19/attachment.html>


More information about the swift-users mailing list