Bogdan Laukhin
Bogdan Laukhin

Reputation: 1454

How to assign "dispatch_get_main_queue()" to a constant in Swift?

Can't get a clue - how to assign "dispatch_get_main_queue()" to a constant in Swift?

For example in Objective-C it looks following:

#define kMainQueue dispatch_get_main_queue()

Should I use typealias in this case, or smth else? Thank you

Upvotes: 0

Views: 119

Answers (1)

Gordon Childs
Gordon Childs

Reputation: 36159

Do you mean this?

let kMainQueue = dispatch_get_main_queue()

kMainQueue is a constant thanks to the let

Upvotes: 3

Related Questions