ScadeExtensions library
What is it
Extensions, additions for SCADE SDK functionality.
Purpose is adding SDK utilities for common usage.
How to use
Open https://github.com/scade-platform/ScadeExtensions/tree/main/Sources
There is 4 categories for Extensions:
- Core - extensions of the core layer of ScadeKit
- Extensions - extension for Foundation
- Graphics - extensions of the graphics layer of ScadeKit
- UI - extensions of the UI layer of ScadeKit
Install ScadeExtension library to SCADE project and use any extensions
For example, elementProvider extension for the List widget:
import ScadeKit
import ScadeUI
class MainPageAdapter: SCDLatticePageAdapter {
override func load(_ path: String) {
super.load(path)
list.elementProvider { (item: String, element) in
(element["label"] as? SCDWidgetsLabel)?.text = item
}
list.items = ["Phone Number", "Street", "First name"]
}
}
How to install
- Open Package.swift
- Add dependencies:
dependencies: [
.package(name: "ScadeExtensions", url: "https://github.com/scade-platform/ScadeExtensions", .branch("main")),
],
targets: [
.target(
dependencies: ["ScadeExtensions"],
)
]
- Import library to swift file
import ScadeUI
Updated almost 3 years ago