OutSystems / OSCore-iOS

Library for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift protocol for stack agnostic plugin implementation

Index

Motivation

This repository contains a protocol that interfaces business logic with iOS platform.

Developers are able to create their own integrations of PlatformProtocol for their target mobile framework.

This structure allows us to develop native plugins, portable between techonological stacks (ie: Cordova, React-native, Flutter...)

Supported Platforms

  • iOS

Usage

  1. Include the POD_NAME pod in your project.

  2. Create an extension that implements PlatformProtocol.

extension CordovaInterface: PlatformProtocol {
    func sendResult(result: String?, error: NSError?, callBackID: String) {
        // ... processes and sends a response back to Cordova
    }
    
    func trigger(event: String, data: String) {
        // ... triggers an event on the Cordova webview 
    }
}

Methods

  • sendResult(result: String?, error: NSError?, callBackID: String) will send messages back to the mobile framework.

  • trigger(event: String, data: String) will trigger an event on the mobile framework's webview.

About

Library for iOS

License:MIT License


Languages

Language:Ruby 36.6%Language:Swift 30.0%Language:Shell 21.7%Language:Objective-C 11.7%