# `GSDispatchAsyncMain`

*Function*

Runs the given block on the main queue synchronously.

## Declaration

```swift
func GSDispatchAsyncMain(_ body: @escaping () -> Void)
```

```objc
void GSDispatchAsyncMain(void (^body)());
```

```python
GSDispatchAsyncMain(body)
```

## Discussion

If the function is called on the main queue, the block is invoked immediately. Otherwise, the block is dispatched asynchronously on the main queue.

