Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func showLiveText() {
- guard let image = imageView.image else {
- return
- }
- Task {
- let configuration = ImageAnalyzer.Configuration([.text])
- do {
- let analysis = try await imageAnalyzer.analyze(image, configuration: configuration)
- DispatchQueue.main.async {
- self.interaction.analysis = nil
- self.interaction.preferredInteractionTypes = []
- self.interaction.analysis = analysis
- self.interaction.preferredInteractionTypes = .automatic
- }
- } catch {
- print(error.localizedDescription)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement