Compatibility
- 0.10.0 and master5.35.25.15.04.2
- 0.10.0 and masteriOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
Tools for Implementing a Graphical User Interface
macOS • Windows • Web • CentOS • Ubuntu • tvOS • iOS • Android • Amazon Linux • watchOS
SDGInterface provides tools for implementing a graphical user interface.
―יוחנן/Yoẖanan
import Foundation
import SDGText
import SDGLocalization
import SDGInterface
import SDGApplication
public struct SampleApplication: SDGApplication.Application {
public init() {}
public var applicationName: ProcessInfo.ApplicationNameResolver {
return { form in
switch form {
case .english(let region):
switch region {
case .unitedKingdom, .unitedStates, .canada:
return "Sample"
}
case .español(let preposición):
switch preposición {
case .ninguna:
return "Ejemplar"
case .de:
return "del Ejemplar"
}
case .deutsch(let fall):
switch fall {
case .nominativ, .akkusativ, .dativ:
return "Beispiel"
}
case .français(let préposition):
switch préposition {
case .aucune:
return "Exemple"
case .de:
return "de l’Exemple"
}
case .ελληνικά(let πτώση):
switch πτώση {
case .ονομαστική:
return "Παράδειγμα"
case .αιτιατική:
return "το Παράδειγμα"
case .γενική:
return "του Παραδείγματος"
}
case .עברית:
return "דוגמה"
}
}
}
public var applicationIdentifier: String {
return "com.example.SampleApplication"
}
public func finishLaunching(_ details: LaunchDetails) -> Bool {
Swift.print("Hello, world!")
return true
}
}
@main extension SampleApplication {}
SDGInterface provides libraries for use with the Swift Package Manager.
Simply add SDGInterface as a dependency in Package.swift
and specify which of the libraries to use:
let package = Package(
name: "MyPackage",
dependencies: [
.package(
name: "SDGInterface",
url: "https://github.com/SDGGiesbrecht/SDGInterface",
.upToNextMinor(from: Version(0, 10, 0))
),
],
targets: [
.target(
name: "MyTarget",
dependencies: [
.product(name: "SDGApplication", package: "SDGInterface"),
.product(name: "SDGInterface", package: "SDGInterface"),
.product(name: "SDGInterfaceTestUtilities", package: "SDGInterface"),
.product(name: "SDGMenuBar", package: "SDGInterface"),
.product(name: "SDGErrorMessages", package: "SDGInterface"),
.product(name: "SDGProgressIndicators", package: "SDGInterface"),
.product(name: "SDGKeyboard", package: "SDGInterface"),
]
)
]
)
The modules can then be imported in source files:
import SDGApplication
import SDGInterface
import SDGInterfaceTestUtilities
import SDGMenuBar
import SDGErrorMessages
import SDGProgressIndicators
import SDGKeyboard
The SDGInterface project is maintained by Jeremy David Giesbrecht.
If SDGInterface saves you money, consider giving some of it as a donation.
If SDGInterface saves you time, consider devoting some of it to contributing back to the project.
Ἄξιος γὰρ ὁ ἐργάτης τοῦ μισθοῦ αὐτοῦ ἐστι.
For the worker is worthy of his wages.
―ישוע/Yeshuʼa