Elements. Build native projects for any modern development platform, using the language(s) of your choice. Oxygene (Object Pascal), C#, Swift, Java, Go. | RemObjects Software

SharedUI.Shared

Language: Silver, Platform: All, Category: SharedUI
https://github.com/remobjects/ElementsSamples/tree/master/Silver/All/SharedUI/SharedUI.Shared

$(MSBuildThisFileDirectory)MainWindowController.swift

open __partial class MainWindowController {

	private func setup() {
		//
		//  Do any shared initilaization, here
		//
	}

	//
	// Add Shared code here
	//

	@Notify public var valueA: String!
	@Notify public var valueB: String!
	@Notify public private(set) var result: String!

	@IBAction
	public func calculateResult(_ sender: id!) {
		if (length(valueA) == 0) | (length(valueB) == 0) {
			result = "(value required)"
		} else {
			if let a = Convert.TryToDoubleInvariant(valueA), let b = Convert.TryToDoubleInvariant(valueB) {
				result = Convert.ToString(a + b)
			} else {
				result = valueA + valueB
			}
		}
	}
}