about summary refs log tree commit diff
path: root/modules/expo-bluesky-translate/ios/ExpoBlueskyTranslateModule.swift
blob: afa81372296c41bb595c904bb637385241db0ef2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import ExpoModulesCore
import Foundation
import SwiftUI

public class ExpoBlueskyTranslateModule: Module {
  public func definition() -> ModuleDefinition {
    Name("ExpoBlueskyTranslate")
    
    AsyncFunction("presentAsync") { (text: String) in
      DispatchQueue.main.async { [weak state = TranslateViewState.shared] in
        state?.isPresented = true
        state?.text = text
      }
    }
    
    View(ExpoBlueskyTranslateView.self) {}
  }
}