Using threads to update UI with Swift

后端 未结 2 1964
余生分开走
余生分开走 2021-02-05 08:48

I\'m developing a software with Xcode 6 using Swift. When I press a button, my code takes some informations from the web and writes them on my NSWindow.

So imagine some

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 09:19

    Swift 3.0 + version

    DispatchQueue.main.async() {
        // your UI update code
    }
    

    Posted this because XCode cannot suggest the correct syntax from swift 2.0 version

提交回复
热议问题