Skip to content

Instantly share code, notes, and snippets.

@tanner-west
Created June 30, 2023 02:16
Show Gist options
  • Save tanner-west/03c07c20a6a60b4c208c5b0d8a1087c3 to your computer and use it in GitHub Desktop.
Save tanner-west/03c07c20a6a60b4c208c5b0d8a1087c3 to your computer and use it in GitHub Desktop.
//
// RCTVisionModule.swift
// VisionNativeModulePOC
//
// Created by Tanner West on 6/2/23.
//
import Foundation
@objc(RCTVisionModule)
class RCTVisionModule: NSObject {
@objc(sayHello:specialNumber:callback:)
func sayHello(_ specialMessage: String, specialNumber: NSNumber, callback: RCTResponseSenderBlock) {
print("read this special message: ", specialMessage)
print("look at this special number: ", specialNumber)
let sum = specialNumber.decimalValue + 5
callback([sum, "the first arg is the special sum; this is just a string"])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment