framework instructions

Eonist edited this page Mar 28, 2017 · 1 revision
  1. Download Element and swift-utils
  2. make .framework from swift-utils files
  3. make .framework from Element files (drag Utils.framework into framework project)
  4. make a new App project. (drag both Element.framework and Utils.framework into app-project)
  5. Add both frameworks under Embedded binaries in the app's General settings

Add Hello world code to AppDelegate.applicationDidFinishLaunching method:

StyleManager.addStyle("Button{fill:blue;}")
let btn = Button(100,20)
window.contentView!.addSubview(btn)
func onClick(event:Event){
    if(event.type == ButtonEvent.upInside){Swift.print("hello world")}
}
btn.event = onClick

Add import statements to the top of the AppDelegate.swift class:

@testable import Element
@testable import Utils

Note: How to make .framework