Hello Devs!
Anyone has an idea if it is feasible to override the native camera in apple?
So if a user have an app called "xyz" installed, when the user open his native camera and qr code is detected, we display a pop if he wants to continue with "xyz"
Thanks
Live Text
RSS for tagEnable text interactions, translation, data detection, and QR code scanning within any image view on iOS, iPadOS, or macOS.
Posts under Live Text tag
10 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
We are using VNRecognizeTextRequest to detect text in documents, and we have noticed that even in some very clear and well-formatted documents, there are still instances where text blocks are missed. the live text also have the same issue.
I am creating an application that uses VNDetectBarcodesRequest to read QR codes from images and adjust the image orientation to match that of the QR code finder pattern.
The QR code was successfully read, and the coordinates of the QR code were obtained.Upon checking the obtained topLeft, topRight, and bottomLeft coordinates, they always seem to match the topLeft, topRight, and bottomLeft coordinates of the finder pattern.
Is it specified that the coordinates of topLeft, topRight, and bottomLeft obtained with VNDetectBarcodesRequest match the topLeft, topRight, and bottomLeft of the finder pattern? Or do they just happen to match?
I would appreciate it if you could tell me if the matching of coordinates is a specification.
Thank you for your help.
Hello everyone.
I use Translation Framework in my application. During development everything was fine, Translation framework worked well, but after two or three days of using the production version (that was published in AppStore and available for others also!) - my application stopped working. Translation framework gives errors:
Error sending 1 paragraphs Error Domain=TranslationErrorDomain Code=16 "Translation failed" UserInfo={NSLocalizedDescription=Translation failed, NSLocalizedFailureReason=Offline models not available for language pair}
Failed to translate input 0; returning error: Error Domain=TranslationErrorDomain Code=16 "Translation failed" UserInfo={NSLocalizedDescription=Translation failed, NSLocalizedFailureReason=Offline models not available for language pair}
Received unbridged NSError to API, converting to .internalError: Error Domain=TranslationErrorDomain Code=16 "Translation failed" UserInfo={NSLocalizedDescription=Translation failed, NSLocalizedFailureReason=Offline models not available for language pair}
Once again - it worked when I developed it, it was released on the AppStore, and suddenly it stopped working!
I’m developing an app to save words that users learn in a language they are studying.
Here’s the basic workflow:
Type a new word
Add the new word
Every time a word is added, it gets saved to a list that includes its meaning and the name of the language — useful when saving words in multiple languages
Problem:
For some reason, the “Add new word” button only works for the first word. The second word is not being added to the list.
Here is my code:
import SwiftUI
import NaturalLanguage
import Translation
struct ContentView: View {
@State private var inputWord: String = ""
@State private var detectedLanguage: String?
@State private var translationConfiguration: TranslationSession.Configuration?
@StateObject private var viewModel = WordViewModel()
var body: some View {
VStack(spacing: 24) {
// Input field
TextField("Type a word in any language", text: $inputWord)
.padding()
.background(Color(.systemGray6))
.cornerRadius(10)
// Button to translate and save
Button("Add new word") {
translateAndSave()
}
// .disabled(inputWord.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
.buttonStyle(.borderedProminent)
// List of saved words
Text("My Words")
.font(.system(.title2))
List {
ForEach(viewModel.words) { word in
VStack(alignment: .leading, spacing: 4) {
Text(word.inputWord)
.font(.headline)
Text(word.nativeTranslation)
.font(.subheadline)
.foregroundColor(.gray)
Text(word.detectedLanguage.uppercased())
.font(.caption)
.foregroundColor(.blue)
}
.padding(.vertical, 4)
}
}
Spacer()
}
.padding()
.animation(.easeInOut, value: detectedLanguage)
// Automatically triggers translation when configuration changes
.translationTask(translationConfiguration) { session in
do {
let response = try await session.translate(inputWord)
viewModel.addWord(
input: inputWord,
native: response.targetText,
detected: detectedLanguage ?? "Unknown"
)
// Reset fields after saving
inputWord = ""
detectedLanguage = nil
translationConfiguration = nil
} catch {
// Handle error
print("Translation error: \(error.localizedDescription)")
}
}
}
// Function to detect language
private func detectLanguage() {
let recognizer = NLLanguageRecognizer()
recognizer.processString(inputWord)
if let code = recognizer.dominantLanguage?.rawValue {
let name = Locale.current.localizedString(forIdentifier: code)
detectedLanguage = name?.capitalized
} else {
detectedLanguage = "Unable to detect"
}
}
// Function to prepare translation
private func translateAndSave() {
detectLanguage()
translationConfiguration = TranslationSession.Configuration(
source: nil,
target: Locale.Language(identifier: "en")
)
}
}
Question:
Does anyone have any idea what I can do to fix this?
Hi, DataScannerViewController does't recognize currencies less than 1.00 (e.g. 0.59 USD, 0.99 EUR, etc.). Why? How to solve the problem?
This feature is not described in Apple documentation, is there a solution?
This is my code:
func makeUIViewController(context: Context) -> DataScannerViewController {
let dataScanner = DataScannerViewController(recognizedDataTypes: [ .text(textContentType: .currency)])
return dataScanner
}
Using Apple SwiftUI Translate library: when calling:
try await session.prepareTranslation()
the first time, the API's Language Download sheet does not show (or shows briefly and dismisses immediately) Even when the sheet doesn't show, the keyboard is lowered, as though the sheet would be appearing, but then the keyboard raises as though the sheet was dismissed.
The following Errors are printed in the console dozens of times; but on all subsequent executions, the API Language Download sheet shows as expected.
The trigger code is in a function which is executed when a Translate button is tapped.
Any ideas would be welcome!
Console Error on first execution only
LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Attempt to map database failed: permission was denied. This attempt will not be retried.
Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Attempt to map database failed: permission was denied. This attempt will not be retried.
Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Attempt to map database failed: permission was denied. This attempt will not be retried.
Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Error returned from iconservicesagent image request: <ISBundleIdentifierIcon: 0x300df3c30> BundleID: (null) digest: 7749FEEE-F663-39B4-AD68-A18CFF762CCC - <ISImageDescriptor: 0x3033b26c0> - (64.00, 64.00)@2x v:4 l:5 a:0:0:0:0 t:() b:0 s:2 ps:0 digest: DF83A970-D4C9-3D90-BB7D-0BC21FC22E03 error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request}
Error returned from iconservicesagent image request: <ISTypeIcon: 0x300d0fb70>,Type: com.apple.appprotection.badge.faceid - <ISImageDescriptor: 0x3033ad0e0> - (32.00, 32.00)@2x v:0 l:5 a:0:0:0:0 t:() b:0 s:2 ps:0 digest: 648D7A72-90CB-3858-9409-5C554BB43B8E error: Error Domain=NSOSStatusErrorDomain Code=-609 "Client is disallowed from making such an icon request" UserInfo={NSLocalizedDescription=Client is disallowed from making such an icon request}
Connection interrupted, finishing translation with error Error Domain=TranslationErrorDomain Code=14 "(null)"
Got response from extension with error: Error Domain=TranslationErrorDomain Code=14 "(null)"
Reported that remote UI finished but didn't get finished configuration, reporting the error as: Error Domain=TranslationErrorDomain Code=20 "(null)"
VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
Reported that remote UI finished but didn't get finished configuration, reporting the error as: Error Domain=TranslationErrorDomain Code=14 "(null)"
VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
VS terminated with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
Trigger the Translation:
// check if we need to create a translation configuration
if configuration == nil {
configuration = TranslationSession.Configuration.init(
source: Locale.Language(identifier: sourceLanguageCode),
target: Locale.Language(identifier: targetLanguageCode)
)
} else {
// or just update the target code then invalidate the config to re-trigger the refresh
of .translationTask()
configuration?.source = Locale.Language(identifier: sourceLanguageCode)
configuration?.target = Locale.Language(identifier: targetLanguageCode)
configuration?.invalidate()
}
Prepare and check if Download sheet should be presented:
.translationTask(configuration) { session in
do {
// prepare translation & present API download sheet if lanugage download needed.
try await session.prepareTranslation()
} catch {
print("Translate failed: \(error)")
}
}
Hi,
I've been trying to submit an app, without much success.
Describing the app in general terms, its an Augmented Reality app (for phone or tablet) that depends on a QR code to be used. The QR code is provided during a live training session (engineers go to exhibitions and provide the QR code), where the user can point the camera at and an interactive 3D object, related to the piping industry, appears.
I was signaled about "minimum functionality" for the case of users who download and don't have the QR code (in which case, the app is indeed useless). Something that I've previously seen in AppStore for other apps, btw
Please, could anyone provide me a suggestion of what to do in this case? Is an initial warning describing the condition enough? Should it have something more complex than that at the start?
The latest feedback was:
"Hello,
Thank you for your resubmission. Upon further review, we identified additional issues that need your attention. See below for more information.
If you have any questions, we are here to help. Reply to this message in App Store Connect and let us know.
Review Environment
Guideline 4.2 - Design - Minimum Functionality
We noticed that your app includes an AR or QR scanner but does not include any additional content or functionality unless the user has access to the AR marker or QR code. While we understand that your app displays additional content when an AR marker or QR code is scanned, to users who do not have access to the AR markers or QR codes, your app only appears to display a camera view.
Next Steps
We encourage you to provide your users with additional content in your app, including directions on how to use your app and information on how to obtain any necessary AR markers or QR codes.
To ensure users have the best experience, apps should provide valuable utility or entertainment, draw people in by offering compelling capabilities or content, or enable people to do something they couldn't do before or in a way they couldn't do it before."
Hi, I wanted to know what is the best way to detect whether a part of string has an unavailable character, '□' (tofu box or last resort character). So far it seems to be that we will have to parse all the strings and individually check for each character and whether or not it is a part of the Unicode Scalar. And since we are a business application that deals with a lot of data as strings, this will be rather performance heavy. So wanted to know if there were any other better or more efficient ways to go about this?
Hi everyone 👋
I’m building an iOS app in Swift where I want to do the following:
Record the user’s voice
Transcribe the spoken sentence (speech-to-text)
Auto-detect the spoken language
Translate it to another language selected by the user (e.g., English → Spanish or Hindi → English)
Speak back (text-to-speech) the translated text on the same device
Is this possible to record via phone mic and play the transcribe voice into headphone's audio?