Skip to content

Commit 77a0e31

Browse files
committed
Add NOTE about dispatchMain
1 parent 481f3e5 commit 77a0e31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ As of Swift 6.0.1, `Locale.current` is hardcoded to be `en_001` on Linux. Manual
1919
## TODOs
2020

2121
- TODO: Use base docker image that already includes static Linux SDK.
22-
- TODO: Don't depend on `Foundation`, importing `FoundationEssentials` instead would result in a smaller binary size. `RunLoop` and other useful classes, like `Process`, can only be accessed through `Foundation` currently.

Sources/ExampleApp/main.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Dispatch
12
import Foundation
23
#if canImport(SwiftGlibc)
34
@preconcurrency import SwiftGlibc
@@ -32,4 +33,6 @@ let signalHandlers = [
3233
return signalSource
3334
}
3435

36+
// NOTE: RunLoop is required for some classes, like Timer.
37+
// If you don't want to import Foundation (to decrease binary size), you can use `dispatchMain()`
3538
RunLoop.main.run()

0 commit comments

Comments
 (0)