Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React Native bridge EventEmitters from UIViewController

$
0
0

So I’m using an SDK that returns a view. Right now I have it as a UIViewController and then I'm creating an instance of that in another class that's an RCTViewManager and returning the instance view to bridge it. How would you bridge EventEmitters from the ViewController to React Native with an RCTViewManager in the middle of them? Thanks so much for your time!

This is my RCTViewManager that's exporting my view and functions, I just need Event Emitters now

import Foundation
import UIKit

@objc(MapViewManager)
class MapViewManager : RCTViewManager {
  var viewController:SDKViewController? = SDKViewController.init()


  @objc(functionOne)
  func functionOne(){
    DispatchQueue.main.async {
       self.viewController?.functionOne()
    }
  }
  @objc(functionTwo)
  func functionTwo(){
    DispatchQueue.main.async {
       self.viewController?.functionTwo()
    }
  }
  override func view() -> UIView! {
    return self.SDKViewController?.view
  }

  }



Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>