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:

  1. Core - extensions of the core layer of ScadeKit
  2. Extensions - extension for Foundation
  3. Graphics - extensions of the graphics layer of ScadeKit
  4. 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

  1. Open Package.swift
  2. Add dependencies:
dependencies: [
  .package(name: "ScadeExtensions", url: "https://github.com/scade-platform/ScadeExtensions", .branch("main")),
],
targets: [
  .target(
     dependencies: ["ScadeExtensions"],
  )
]
  1. Import library to swift file
import ScadeUI