FreSwiftMainController
public protocol FreSwiftMainController
FreSwiftMainController: Our SwiftController extends this Protocol.
-
Map of functions to connect Objective C to Swift
Declaration
Swift
var functionsToSet: FREFunctionMap { get set } -
FREContext
Declaration
Swift
var context: FreContextSwift! { get set } -
Tag used when tracing logs
Declaration
Swift
static var TAG: String { get set } -
Returns functions which connect Objective C to Swift
Declaration
Swift
func getFunctions(prefix: String) -> [String] -
Allows Objective C to call our Swift Controller
Declaration
Parameters
namename of the function
ctxcontext
argcnumber of arguments
argvarray of FREObject arguments
-
Called by Objective C when ANE is loaded into memory
@objc func applicationDidFinishLaunching(_ notification: Notification) { appDidFinishLaunchingNotif = notification } public func onLoad() { NotificationCenter.default.addObserver(self, selector: #selector(applicationDidFinishLaunching), name: UIApplication.didFinishLaunchingNotification, object: nil) }Declaration
Swift
func onLoad() -
trace(_:Extension method) trace: sends StatusEvent to our swc with a level of “TRACE”
trace("Hello")Declaration
Swift
func trace(_ value: Any...)Parameters
valuevalue to trace to console
Return Value
Void
-
info(_:Extension method) info: sends StatusEvent to our swc with a level of “TRACE” The output string is prefixed with ℹ️ INFO:
info("Hello")Declaration
Swift
func info(_ value: Any...)Parameters
valuevalue to trace to console
Return Value
Void
-
warning(_:Extension method) warning: sends StatusEvent to our swc with a level of “TRACE” The output string is prefixed with ⚠️ WARNING:
warning("Hello")Declaration
Swift
func warning(_ value: Any...)Parameters
valuevalue to trace to console
Return Value
Void
-
dispatchEvent(name:Extension methodvalue: ) dispatchEvent: sends StatusEvent to our swc with a level of name and code of value replaces DispatchStatusEventAsync
dispatchEvent("MY_EVENT", "ok")Declaration
Swift
func dispatchEvent(name: String, value: String)Parameters
namename of event
valuevalue passed with event
Return Value
Void
View on GitHub
Install in Dash
FreSwiftMainController Protocol Reference