Swiftpack.co - Package - SDGGiesbrecht/SDGInterface

macOS • Linux • iOS • watchOS • tvOS

Documentation

SDGInterface

SDGInterface provides tools for implementing a graphical user interface.

Καὶ ὁ Λόγος σὰρξ ἐγένετο καὶ ἐσκήνωσεν ἐν ἡμῖν, καὶ ἐθεασάμεθα τὴν δόξαν αὐτοῦ, δόξαν ὡς μονογενοῦς παρὰ πατρός, πλήρης χάριτος καὶ ἀληθείας.

And the Word became flesh and dwelt among us and we have watched His glory, the glory of the Only Begotten of the Father, full of grace and truth.

―‎יוחנן⁩/Yoẖanan

Features

  • API unification accross platforms.
  • Localized menu bar.

Example Usage

import SDGApplication

internal class SystemMediator: SDGApplication.SystemMediator {

  internal func finishLaunching(_ details: LaunchDetails) -> Bool {
    Application.setSamplesUp()
    return true
  }
}
Application.main(mediator: SystemMediator())

Importing

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(url: "https://github.com/SDGGiesbrecht/SDGInterface", .upToNextMinor(from: Version(0, 5, 0))),
    ],
    targets: [
        .target(name: "MyTarget", dependencies: [
            .productItem(name: "SDGApplication", package: "SDGInterface"),
            .productItem(name: "SDGMenuBar", package: "SDGInterface"),
            .productItem(name: "SDGContextMenu", package: "SDGInterface"),
            .productItem(name: "SDGErrorMessages", package: "SDGInterface"),
            .productItem(name: "SDGMenus", package: "SDGInterface"),
            .productItem(name: "SDGPopOvers", package: "SDGInterface"),
            .productItem(name: "SDGWindows", package: "SDGInterface"),
            .productItem(name: "SDGTables", package: "SDGInterface"),
            .productItem(name: "SDGProgressIndicators", package: "SDGInterface"),
            .productItem(name: "SDGButtons", package: "SDGInterface"),
            .productItem(name: "SDGImageDisplay", package: "SDGInterface"),
            .productItem(name: "SDGTextDisplay", package: "SDGInterface"),
            .productItem(name: "SDGViews", package: "SDGInterface"),
            .productItem(name: "SDGKeyboard", package: "SDGInterface"),
            .productItem(name: "SDGInterfaceBasics", package: "SDGInterface"),
        ])
    ]
)

The modules can then be imported in source files:

import SDGApplication
import SDGMenuBar
import SDGContextMenu
import SDGErrorMessages
import SDGMenus
import SDGPopOvers
import SDGWindows
import SDGTables
import SDGProgressIndicators
import SDGButtons
import SDGImageDisplay
import SDGTextDisplay
import SDGViews
import SDGKeyboard
import SDGInterfaceBasics

About

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

Github

link
Stars: 3
Help us keep the lights on

Dependencies

Used By

Total: 1

Releases

0.5.0 - Dec 1, 2019

Breaking Changes

  • View.native has been renamed to View.cocoaView to contrast against swiftUIView.
  • Font.resized(to:) has been dropped. It has been sunk into SDGCornerstone’s SDGText instead.

New Features

  • SwiftUI‐related features are available on iOS.
  • All views can be incorporated into SwiftUI hierarchies via their swiftUIView property.

0.4.0 - Oct 25, 2019

Breaking Changes

  • Swift 5.1
  • alignFirstBaselines(ofSubviews:) has been removed in favour of alignLastBaselines(ofSubviews:) for compatibility with older platforms.

New Features

  • All platform restrictions have been dropped.
  • Wrappers are available for incorporating SwiftUI into View hierarchies.
  • Progress indicators are available.

Bug Fixes

  • Bundle validation verifies that NSAppleEventsUsageDescription is localized if present.

0.3.1 - Sep 26, 2019

New Features

  • Interface elements are localized into German.
  • CoreGraphics key codes are available on all platforms.

Bug Fixes

  • Bundle validation checks for the localized name flag.
  • Bundle validation checks Info.plist against the fallback localization’s InfoPlist.strings file.

0.3.0 - Jul 18, 2019

Breaking Changes

  • More types have been moved out of SDGInterfaceElements into specialized modules.
  • More alias pairs have been replaced with encapsulating types.

0.2.1 - Jul 15, 2019

New Features

  • TextFields have a bindable text value.
  • Windows have a closeAction that will be executed when the window closes.

Bug Fixes

  • Changing the sort order causes Table views to refresh.