-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the nervousnet-HUB-iOS wiki!
AxonStore (Download / Remove Webview Axons) AxonStore is a purely static class. It contains methods to download a list of available axons from the online "store" and allows you to install selected axons. Check out the axon repository (some information there might be a bit outdated)
-
getRemoteAxonList() -> Array<AxonDetails>: Get a list of the available axons in the online store. -
downloadAndInstall(axonName: String) -> Bool: Install an axon.axonNameas provided by the remote list. Returnstrueif successful. -
downloadAndInstall(axonIndex: Int) -> Bool: Install an axon.axonIndexas in the remote axon list. Returnstrueif successful. -
getInstalledAxonsList() -> Array<AxonDetails>: List of currently installed axons. -
removeLocalAxon(axonName: String) -> Bool: Remove installed axon
AxonServerController (Displaying Webview Axons)
Create a WebView and call loadUrl with the following URL: http://localhost:8080/axon-res/<axname>/axon.html where axname is the name of the axon as provided by the AxonStore.
subscribe:
NotificationCenter.default.addObserver(self, selector: #selector(onNNEvent(_:)), name: NNEvent.name, object: nil)Here we subscribe the current object/listener (self) to events with name NNEvent.name (a string) and trigger method onNNEvent() if an event occurs.
publish:
NotificationCenter.default.post(name: NNEvent.name, object: nil, userInfo: event.info)We post an NNEvent.name and provide additional info in userInfo which needs to be a map ([key : value])
unpacking event info:
@objc private func onNNEvent(_ notification : NSNotification)The signature of a function triggered on event needs to look like this. Access userInfo by calling notification.userInfo